fit_lasso_metamodel | R Documentation |
This function fits a lasso metamodel using the glmnet
package.
fit_lasso_metamodel(
df,
y_var = NULL,
x_vars = NULL,
seed_num = 1,
standardise = FALSE,
tune_plot = TRUE,
x_poly_2 = NULL,
x_poly_3 = NULL,
x_exp = NULL,
x_log = NULL,
x_inter = NULL
)
df |
a dataframe. |
y_var |
character. Name of the output variable in the dataframe. This will be the dependent variable of the metamodel. |
x_vars |
character or a vector for characters. Name of the input variable(s) in the dataframe. This will be the independent variable of the metamodel. |
seed_num |
numeric. Determine which seed number to use to split the dataframe in fitting an validation sets. |
standardise |
logical. Determine whether the parameter of the linear regression should be standardised. Default is FALSE. |
tune_plot |
logical. Determine whether the plot of the results of tuning the lambda should be shown. |
x_poly_2 |
character. character or a vector for characters. Name of the input variable in the dataframe. These variables will be exponentiated by factor 2. |
x_poly_3 |
character. character or a vector for characters. Name of the input variable in the dataframe. These variables will be exponentiated by factor 3. |
x_exp |
character. character or a vector for characters. Name of the input variable in the dataframe. The exponential of these variables will be included in the metamodel. |
x_log |
character. character or a vector for characters. Name of the input variable in the dataframe. The logarithm of these variables will be included in the metamodel. |
x_inter |
character. character or a vector for characters. Name of the input variables in the dataframe. This vector contains the variables for which the interaction should be considered. The interaction terms of two consecutive variables will be considered in the linear model; hence, the length of this vector should be even. |
A list contaning the following elements:
#Fit lasso metamodel with two variables using the probabilistic data
data(df_pa)
fit_lasso_metamodel(df = df_pa,
y_var = "inc_qaly",
x_vars = c("p_pfsd", "p_pdd"),
tune_plot = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.