Learn R Programming

gesso (version 1.0.2)

gesso.coef: Get model coefficients

Description

A function to obtain coefficients from the model fit object corresponding to the desired pair of tuning parameters lambda = (lambda_1, lambda_2).

Usage

gesso.coef(fit, lambda)

Arguments

fit

model fit object obtained either by using function gesso.fit or gesso.cv

lambda

a pair of tuning parameters organized in a tibble (ex: lambda = tibble(lambda_1=grid[1], lambda_2=grid[1]))

Value

A list of model coefficients corresponding to lambda values of tuning parameters

beta_0

estimated intercept value

beta_e

estimated environmental coefficient value

beta_g

a vector of estimated main effect coefficients

beta_c

a vector of estimated confounders coefficients

beta_gxe

a vector of estimated interaction coefficients

Examples

Run this code
# NOT RUN {
data = data.gen()
model = gesso.cv(data$G_train, data$E_train, data$Y_train, grid_size=20, 
        parallel=TRUE, nfolds=3)
gxe_coefficients = gesso.coef(model$fit, model$lambda_min)$beta_gxe                
g_coefficients = gesso.coef(model$fit, model$lambda_min)$beta_g     
# }

Run the code above in your browser using DataLab