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 = max(3, getOption("digits") - 2),
  varest = c("robust", "df-adjusted", "model", "bias-corrected"),
  force.in,
  force.out,
  ...
)

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 "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. As default, test is set to "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"). As default, direction is set to "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 c(0.05,0.05).

trace

an (optional) logical switch indicating if should the stepwise reports be printed. By default, trace is set to 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. As 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. As default, digits is set to max(3, getOption("digits") - 2).

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"). As default, varest is set to "robust".

force.in

an (optional) formula-type object indicating the effects that should be in all models

force.out

an (optional) formula-type object indicating the effects that should be in no models

...

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 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".

final.fit

an object of class glmgee with the results of the fit to the data 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.

Vanegas L.H., Rondon L.M., Paula G.A. (2023) Generalized Estimating Equations using the new R package glmtoolbox. The R Journal 15:105-133.

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(upper=mod),force.in=~treat)

###### 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(upper=mod),force.in=~group)

###### 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(upper=mod),force.in=~group)


glmtoolbox documentation built on Sept. 11, 2024, 7:32 p.m.