Learn R Programming

informR (version 1.0-5)

sldrop: Drop S-form Statistics or Covariates from a Statslist Array

Description

Removes variables from a statslist.

Usage

sldrop(statslist, varname, type = 1)

Arguments

statslist
A statslist object, possibly passed from gen.intercepts or other methods
varname
A vector of variable names to remove from statslist. See details.
type
Indicates where the combining is going to occur in statslist. 1 for global, 2 for local.

Details

Removes the kth element(s) from the [i,j,k] statslist array based upon regex match of the k dimnames(statslist[[x]][[type]])[[3]].

See Also

slbind, slbind.cov, abind

Examples

Run this code

#Take example from slbind.cov
example(slbind.cov)
statslist.new<-slbind.cov(covar,beta.ints)
statslist.new[[1]][[1]][,1,]

#And removes the "smokes" variable
dimnames(statslist.new[[1]][[1]])[[3]]
statslist.old<-sldrop(statslist.new,"smokes")
dimnames(statslist.old[[1]][[1]])[[3]]

Run the code above in your browser using DataLab