gamfit | R Documentation |
This function fits a GAM to the data
gamfit(
wdata,
dependent = NA,
independent = NA,
linear_covariates = NA,
smooth_covariates = NA,
rnt_dependent = FALSE,
return_prediction = FALSE,
new_prediction_data = NA,
exposure_trait = NA
)
wdata |
a data frame passed to function containing necessary data for analysis. |
dependent |
a single string character of the column name for the dependent or response variable. |
independent |
a single string character of the column name for the independent or explanatory variable that will be modeled as a smooth. This can be left NA, and you can instead add the exposure trait to the list of "linear_covariates", to define a null model where the exposure is modeled as a parametric term. |
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. |
rnt_dependent |
binary TRUE or FALSE if the dependent or response variable should be rank normal transformed. |
exposure_trait |
a single string character of the column name with the focus exposure trait of interest. If the "dependent" is set to NA, the string defined here will be used to estimate exposure summary stats (n, mean, min, max, sd) for your model. |
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.
gamfit()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.