getSigVars: Get explanatory variables of a model with significance level...

View source: R/getSigVars.R

getSigVarsR Documentation

Get explanatory variables of a model with significance level below the threshold

Description

Get explanatory variables of a model with significance level below the threshold

Usage

getSigVars(fit, threshold = 0.2, final = TRUE)

Arguments

fit

An object of class lm or glm

threshold

Numeric

final

logical if true, perform stepwise regression using step()

Value

A list containing the following components:

sigVars

names of explanatory variables which have significant levels below the threshold in univariable model

finalVars

names of explanatory variables included in final model as a result of step

Examples

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)

autoReg documentation built on Nov. 14, 2023, 9:07 a.m.