Movatterモバイル変換


[0]ホーム

URL:


# StepReg

StepReg is an R package that streamlines stepwise regression analysisby supporting multiple regression types, incorporating popular selectionstrategies, and offering essential metrics.

Key Features

Installation

Install from CRAN

pak::pkg_install("StepReg")

or

install.packages("StepReg")

Or install from GitHub

devtools::install_github("JunhuiLi1017/StepReg")

Quick Start

library(StepReg)# Basic linear regressiondata(mtcars)formula<- mpg~ .res<-stepwise(formula = formula,data = mtcars,type ="linear",strategy ="bidirection",metric ="AIC")# View resultsressummary(res$bidirection$AIC)

Advanced Features

Strata Variables in CoxRegression

library(survival)data(lung)lung$sex<-factor(lung$sex)# Cox regression with strataformula<-Surv(time, status)~ age+ sex+ ph.ecog+strata(inst)res<-stepwise(formula = formula,data = lung,type ="cox",strategy ="forward",metric ="AIC")
Continuous-Nested-Within-ClassEffects
data(mtcars)mtcars$am<-factor(mtcars$am)# Nested effectsformula<- mpg~ am+ wt:am+ disp:am+ hp:amres<-stepwise(formula = formula,data = mtcars,type ="linear",strategy ="bidirection",metric ="AIC")

Documentation

Shiny Application

Important Note

StepReg shouldNOT be used for statistical inferenceunless the variable selection process is explicitly accounted for, as itcan compromise the validity of the results. This limitation does notapply when StepReg is used for prediction purposes.

Citation

If you use StepReg in your research, please cite:

citation("StepReg")

Questions?

Please raise an issuehere.


[8]ページ先頭

©2009-2025 Movatter.jp