getSigVars | R Documentation |
Get explanatory variables of a model with significance level below the threshold
getSigVars(fit, threshold = 0.2, final = TRUE)
fit |
An object of class lm or glm |
threshold |
Numeric |
final |
logical if true, perform stepwise regression using step() |
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
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.