View source: R/fct_metamodel.R
fit_lm_metamodel | R Documentation |
This function fits and provides summary statistics of a linear regression model fitted on the input and output values of a probabilistic analysis.
fit_lm_metamodel(
df,
y_var = NULL,
x_vars = NULL,
standardise = FALSE,
partition = 1,
seed_num = 1,
validation = FALSE,
folds = 5,
show_intercept = FALSE,
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 in the dataframe. This will be the independent variable of the metamodel. |
standardise |
logical. Determine whether the parameter of the linear regression should be standardised. Default is FALSE. |
partition |
numeric. Value between 0 and 1 to determine the proportion of the observations to use to fit the metamodel. Default is 1 (fitting the metamodel using all observations). |
seed_num |
numeric. Determine which seed number to use to split the dataframe in fitting and validation sets. |
validation |
logical or character. Determine whether to validate the linear model. Choices are "test_train_split" and "cross_validation". |
folds |
numeric. Number of folds for the cross-validation. Default is 5. |
show_intercept |
logical. Determine whether to show the intercept of the perfect prediction line (x = 0, y = 0). Default is FALSE. |
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. |
Standardisation of the parameters is obtained by
(x - u(x)) / sd(x)
where x
is the variable value, u(x)
the mean over the variable and sd(x)
the standard deviation of x
.
For more details, see Jalal et al. 2013.
A list containing the fit of the model and validation estimates and plots when selected.
# Fitting linear meta model with two variables using the probabilistic data
data(df_pa)
fit_lm_metamodel(df = df_pa,
y_var = "inc_qaly",
x_vars = c("p_pfsd", "p_pdd")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.