Description Usage Arguments Examples
Function builds GAM and dredges saturated models, fixed to maximum of 3 covariates to prevent overfitting, then predicts response against range of predictor covariates, for either 1. the top-ranked model (AICc > 2 lower than candidate models) OR 2. across a top-ranking model set (AICc < 7 of top-ranked model)
1 2 3 4 5 6 7 8 9 | gam_predict(
dataset,
exp.names,
indicator,
family,
base_k = -1,
smoother = "cr",
n.param.max = 3
)
|
dataset |
= dataset containing y and all x covariates. should be scaled and centered (mean = 0, sd = 1) |
exp.names |
= explanatory covariate names, passed as vector of characters |
indicator |
= y variable of interest (character) |
family |
= GLM family distribution, takes 'gaussian' or 'Gamma' |
base_k |
= number of knots for each smoother term. Default = -1, mgcv uses generalized cross-validation |
smoother |
= cubic regression spline method (cr is default) |
n.param.max |
= maximum number of parameters included in each reduced model |
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.