Learn R Programming

autoReg (version 0.3.3)

autoReg: Perform univariable and multivariable regression and stepwise backward regression automatically

Description

Perform univariable and multivariable regression and stepwise backward regression automatically

Usage

autoReg(x, ...)

# S3 method for lm autoReg(x, ...)

# S3 method for glm autoReg(x, ...)

# S3 method for coxph autoReg(x, ...)

# S3 method for survreg autoReg(x, ...)

Value

autoReg returns an object of class "autoReg" which inherits from the class "data.frame" with at least the following attributes:

attr(*,"yvars)

character. name of dependent variable

attr(*,"model")

name of model. One of "lm","glm" or "coxph"

Arguments

x

An object of class lm, glm or coxph

...

Further arguments

Methods (by class)

  • autoReg(lm): S3 method for a class lm

  • autoReg(glm): S3 method for a class glm

  • autoReg(coxph): S3 method for a class coxph

  • autoReg(survreg): S3 method for a class survreg

Examples

Run this code
data(cancer,package="survival")
fit=glm(status~rx+sex+age+obstruct+nodes,data=colon,family="binomial")
autoReg(fit)
autoReg(fit,uni=FALSE,final=TRUE)
autoReg(fit,uni=FALSE,imputed=TRUE)
fit=lm(mpg~wt*hp+am+I(wt^2),data=mtcars)
autoReg(fit,final=TRUE)
autoReg(fit,imputed=TRUE)

Run the code above in your browser using DataLab