gam_predict: GAM predictions

Description Usage Arguments Examples

View source: R/gam_predict.R

Description

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)

Usage

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
)

Arguments

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

Examples

1

jpwrobinson/funk documentation built on Nov. 21, 2021, 11:23 p.m.