stepCriterion.glmgee: Variable selection in Generalized Estimating Equations

View source: R/geeglm.R

stepCriterion.glmgeeR Documentation

Variable selection in Generalized Estimating Equations

Description

Performs variable selection in generalized estimating equations using hybrid versions of forward stepwise and backward stepwise.

Usage

## S3 method for class 'glmgee'
stepCriterion(
  model,
  criterion = c("p-value", "qic", "qicu", "agpc", "sgpc"),
  test = c("wald", "score"),
  direction = c("forward", "backward"),
  levels = c(0.05, 0.05),
  trace = TRUE,
  scope,
  digits = 5,
  varest = c("robust", "df-adjusted", "model", "bias-corrected"),
  ...
)

Arguments

model

an object of the class glmgee which is obtained from the fit of a generalized estimating equation.

criterion

an (optional) character string indicating the criterion which should be used to compare the candidate models. The available options are: QIC ("qic"), QICu ("qicu"), Akaike-type penalized gaussian pseudo-likelihood criterion ("agpc"), Schwarz-type penalized gaussian pseudo-likelihood criterion ("sgpc") and p-value of the test test ("p-value"). By default, criterion is set to be "p-value".

test

an (optional) character string indicating the statistical test which should be used to compare nested models. The available options are: Wald ("wald") and generalized score ("score") tests. By default, test is set to be "wald".

direction

an (optional) character string indicating the type of procedure which should be used. The available options are: hybrid backward stepwise ("backward") and hybrid forward stepwise ("forward"). By default, direction is set to be "forward".

levels

an (optional) two-dimensional vector of values in the interval (0,1) indicating the levels at which the variables should in and out from the model. This is only appropiate if criterion="p-value". By default, levels is set to be c(0.05,0.05).

trace

an (optional) logical switch indicating if should the stepwise reports be printed. By default, trace is set to be TRUE.

scope

an (optional) list, containing components lower and upper, both formula-type objects, indicating the range of models which should be examined in the stepwise search. By default, lower is a model with no predictors and upper is the linear predictor of the model in model.

digits

an (optional) integer indicating the number of digits which should be used to print the most of the criteria to compare the candidate models. By default, digits is set to be 5.

varest

an (optional) character string indicating the type of estimator which should be used to the variance-covariance matrix of the interest parameters in the Wald-type test. The available options are: robust sandwich-type estimator ("robust"), degrees-of-freedom-adjusted estimator ("df-adjusted"), bias-corrected estimator ("bias-corrected"), and the model-based or naive estimator ("model"). By default, varest is set to be "robust".

...

further arguments passed to or from other methods. For example, k, that is, the magnitude of the penalty in the AGPC, which by default is set to be 2.

Value

A list which contains the following objects:

  • initial: a character string indicating the linear predictor of the "initial model".

  • direction: a character string indicating the type of procedure which was used.

  • criterion: a character string indicating the criterion used to compare the candidate models.

  • final: a character string indicating the linear predictor of the "final model".

References

James G., Witten D., Hastie T., Tibshirani R. (2013, page 210) An Introduction to Statistical Learning with Applications in R. Springer, New York.

Jianwen X., Jiamao Z., Liya F. (2019) Variable selection in generalized estimating equations via empirical likelihood and Gaussian pseudo-likelihood. Communications in Statistics - Simulation and Computation 48:1239-1250.

See Also

stepCriterion.lm, stepCriterion.glm, stepCriterion.overglm

Examples

###### Example 1: Effect of ozone-enriched atmosphere on growth of sitka spruces
data(spruces)
mod <- size ~ poly(days,4)*treat
fit1 <- glmgee(mod, id=tree, family=Gamma(log), data=spruces, corstr="AR-M-dependent")
stepCriterion(fit1, criterion="p-value", direction="forward", scope=list(lower=~1,upper=mod))

###### Example 2: Treatment for severe postnatal depression
data(depression)
mod <- depressd ~ visit*group
fit2 <- glmgee(mod, id=subj, family=binomial(probit), corstr="AR-M-dependent", data=depression)
stepCriterion(fit2, criterion="agpc", direction="forward", scope=list(lower=~1,upper=mod))

###### Example 3: Treatment for severe postnatal depression (2)
mod <- dep ~ visit*group
fit2 <- glmgee(mod, id=subj, family=gaussian(identity), corstr="AR-M-dependent", data=depression)
stepCriterion(fit2, criterion="sgpc", direction="forward", scope=list(lower=~1,upper=mod))


glmtoolbox documentation built on Oct. 10, 2023, 9:06 a.m.