gam_predict | R Documentation |
This function fits a GAM to the data
gam_predict(
wdata,
outcome = NA,
exposure = NA,
linear_covariates = NA,
smooth_covariates = NA,
rnt_outcome = FALSE,
return_prediction_only = TRUE,
prediction_n = 25,
outlier_cutoff = 5,
outlier_method = "iqr",
new_pred_data_frame = NA,
messages = FALSE
)
wdata |
a data frame passed to function containing necessary data for analysis. |
outcome |
a single string character of the column name for the dependent or response variable. |
exposure |
a single string character of the column name for the independent or explanatory variable. |
linear_covariates |
a vector of string(s) that are also column names used to define variables that will be set as parametric (linear) covariates. |
smooth_covariates |
a vector of string(s) that are also column names used to define variables that will be set as non-linear (smooth, s()) covariates. |
return_prediction_only |
binary TRUE or FALSE, defaulted to TRUE, asking if only a vector of exposure predicted values should be returned or a data frame of predicted values and the variable data used in the prediction. |
prediction_n |
how many values should be predicted across the range of the exposure? Default is 25. |
new_pred_data_frame |
a data matrix containing the model independent and covariates from which exposure values should be predicted. If left as NA, an equal distant range of dependent values of length 25, and the mean of each numeric and max of each factor will be used in the prediction matrix. |
messages |
should verbose messages be printed to screen |
rnt_dependent |
binary TRUE or FALSE if the dependent or response variable should be rank normal transformed. |
returns a list object containing two objects, (1) 'fit' which holds the gam() model and (2) 'summary' which is a vector of summary statistics derived from the model.
gam_predict()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.