powered by
Get explanatory variables of a model with significance level below the threshold
getSigVars(fit, threshold = 0.2, final = TRUE)
A list containing the following components:
names of explanatory variables which have significant levels below the threshold in univariable model
names of explanatory variables included in final model as a result of step
step
An object of class lm or glm
Numeric
logical if true, perform stepwise regression using step()
library(survival) data(cancer,package="survival") fit=glm(status~rx+sex+age+obstruct+nodes,data=colon,family="binomial") getSigVars(fit) fit=lm(mpg~hp*wt+am,data=mtcars) getSigVars(fit)
Run the code above in your browser using DataLab