gesso.predict {gesso} | R Documentation |
Predict new outcome vector
Description
Predict new outcome vector based on the new data and estimated model coefficients.
Usage
gesso.predict(beta_0, beta_e, beta_g, beta_gxe, new_G, new_E,
beta_c=NULL, new_C=NULL, family = "gaussian")
Arguments
beta_0 |
estimated intercept value |
beta_e |
estimated environmental coefficient value |
beta_g |
a vector of estimated main effect coefficients |
beta_gxe |
a vector of estimated interaction coefficients |
new_G |
matrix of main effects, variables organized by columns |
new_E |
vector of environmental measurments |
beta_c |
a vector of estimated confounders coefficients |
new_C |
matrix of confounders, variables organized by columns |
family |
set |
Value
Returns a vector of predicted values
Examples
data = data.gen()
tune_model = gesso.cv(data$G_train, data$E_train, data$Y_train)
coefficients = gesso.coef(tune_model$fit, tune_model$lambda_min)
beta_0 = coefficients$beta_0; beta_e = coefficients$beta_e
beta_g = coefficients$beta_g; beta_gxe = coefficients$beta_gxe
new_G = data$G_test; new_E = data$E_test
new_Y = gesso.predict(beta_0, beta_e, beta_g, beta_gxe, new_G, new_E)
cor(new_Y, data$Y_test)^2
[Package gesso version 1.0.2 Index]