scm_reg: Use to perform Stepwise Covariate Modeling (SCM)

View source: R/scm_reg.R

scm_regR Documentation

Use to perform Stepwise Covariate Modeling (SCM)

Description

Use to perform Stepwise Covariate Modeling (SCM)

Usage

scm_reg(
  dataset,
  variable,
  variable_event = NULL,
  weights_ordered = NULL,
  covariate.list = NULL,
  test_used = "Chisq",
  p_forward = 0.01,
  p_backward = 0.001,
  regression = "lm",
  cov_corr = NULL,
  search_direction = "full",
  base_relation = NULL,
  full_relation = NULL,
  max_steps = Inf,
  ...
)

Arguments

dataset

name of dataset

variable

dependent variable

variable_event

event variable for coxph regression only

weights_ordered

weight used in the ordered-categorical regression

covariate.list

vector of covariate to be tested

test_used

test to be applied. Can be 'Chisq' or 'AIC'

p_forward

p value for forward selection and interaction phase

p_backward

p value for forward step

regression

type of regression, can be 'lm', 'logistic', 'coxph' or 'ordered-categorical'

cov_corr

list of correlated covariates you don t want to be included simultaneously like eGFR and CRCL. Can be added as a list of vectors in case of multiple vectors of correlated covariates

search_direction

step to be performed. Can be 'full', 'forward', 'interaction', 'backward', 'forward-backward', 'forward-interaction' or 'interaction-backward'

base_relation

base relation included in the base model. Note those relationships cannot be removed in the backward step. Example "age*bwt + crcl"

full_relation

starting model when performing backward step only.

max_steps

maximal number of covariates included in the forward step

...

Additional arguments

Value

Object of class scmobject

Examples

 ## Not run: 
 library(scmreg)
 library(MASS)
 haha <- scm_reg(dataset=housing,
                variable='Sat',
                covariate.list = c('Infl','Type','Cont'),
                p_forward=0.01,
                p_backward=0.001,
                test_used = 'AIC',
                regression='ordered-categorical',
                search_direction='forward-backward',
                weights_ordered='Freq',
                max_steps=Inf)

 
## End(Not run)

certara/scmreg documentation built on Jan. 29, 2024, 1:34 p.m.