# 1 Introduction

Here we applied StepReg to the well-known mtcars data and lung data for clarifying how to perform linear, logistic and Cox stepwise regression.

#install.package("StepReg")
library(StepReg)

## 1.1 linear stepwise regression with data mtcar

### 1.1.1 linear stepwise regression using ‘forward’ method for variable selection and ‘AIC’ as criteria for stop rules

formula <- mpg ~ .
sForwAIC <- stepwise(formula=formula,
data=mtcars,
selection="forward",
select="AIC")
sForwAIC
##    Table 1. Summary of Parameters
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##          Paramters            Value
## —————————————————————————————————————
## Response Variable           mpg
## Included Variable           NULL
## Selection Method            forward
## Select Criterion            AIC
## Variable significance test  F
## Multicollinearity Terms     NULL
## Intercept                   1
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                 Table 2. Variables Type
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##   class                     variable
## ———————————————————————————————————————————————————————
## numeric  mpg cyl disp hp drat wt qsec vs am gear carb
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                               Table 3. Process of Selection
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  Step  EnteredEffect  RemovedEffect  DF  NumberEffectIn  NumberParmsIn        AIC
## —————————————————————————————————————————————————————————————————————————————————————————
## 0     1                             1   0               1              149.943449990894
## 1     wt                            1   1               2              107.217362866777
## 2     cyl                           1   2               3              97.1979989461637
## 3     hp                            1   3               4              96.6645623851593
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##           Table 4. Selected Varaibles
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  variables1  variables2  variables3  variables4
## ————————————————————————————————————————————————
## 1           wt          cyl         hp
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                     Table 5. Coefficients of the Selected Variables for mpg
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##   Variable         Estimate             StdError            t.value             P.value
## ———————————————————————————————————————————————————————————————————————————————————————————————
## (Intercept)  38.7517873728655     1.78686402942753    21.6870375891336   4.7993988012846e-19
## wt           -3.16697311074858    0.740575879267817   -4.27636546018709  0.000199476497472232
## cyl          -0.941616811990739   0.550916381450763   -1.70918281556834  0.0984800974797216
## hp           -0.0180381021431068  0.0118762499454497  -1.51883820448035  0.140015155016129
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗

From the above result, we can see that stepwise() output a list with 5 tables.

• ‘Summary of Parameters’ tells you what parameters is used for this function, where Intercept equals to 1 showing that this stepwise regression has a intercept, otherwise 0 has not a intercept.

• ‘Variables Type’ is the summary of the type of all variables.

• ‘Process of Selection’ let you know how variables are selected, we used AIC as the criteria so the last column is value of AIC.

• ‘Coefficients of the Selected Variables’ is the coefficients of all selected variable.

### 1.1.2 linear stepwise regression using ‘bidirection’ method for variable selection and ‘SL’ as criteria for stop rules, and we set significant level for entry(sle) is 0.15, and significant level of stay(sls) is 0.15 too.

formula <- mpg ~ .
sBidiSL <- stepwise(formula=formula,
data=mtcars,
selection="bidirection",
select="SL",
sle=0.15,
sls=0.15)
sBidiSL
##        Table 1. Summary of Parameters
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##            Paramters               Value
## ————————————————————————————————————————————
## Response Variable              mpg
## Included Variable              NULL
## Selection Method               bidirection
## Select Criterion               SL
## Entry Significance Level(sle)  0.15
## Stay Significance Level(sls)   0.15
## Variable significance test     F
## Multicollinearity Terms        NULL
## Intercept                      1
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                 Table 2. Variables Type
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##   class                     variable
## ———————————————————————————————————————————————————————
## numeric  mpg cyl disp hp drat wt qsec vs am gear carb
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                                 Table 3. Process of Selection
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  Step  EnteredEffect  RemovedEffect  DF  NumberEffectIn  NumberParmsIn           SL
## —————————————————————————————————————————————————————————————————————————————————————————————
## 0     1                             1   0               1              1
## 1     wt                            1   1               2              1.29395870135053e-10
## 2     cyl                           1   2               3              0.00106428178479493
## 3     hp                            1   3               4              0.140015155016129
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##           Table 4. Selected Varaibles
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  variables1  variables2  variables3  variables4
## ————————————————————————————————————————————————
## 1           wt          cyl         hp
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                     Table 5. Coefficients of the Selected Variables for mpg
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##   Variable         Estimate             StdError            t.value             P.value
## ———————————————————————————————————————————————————————————————————————————————————————————————
## (Intercept)  38.7517873728655     1.78686402942753    21.6870375891336   4.7993988012846e-19
## wt           -3.16697311074858    0.740575879267817   -4.27636546018709  0.000199476497472232
## cyl          -0.941616811990739   0.550916381450763   -1.70918281556834  0.0984800974797216
## hp           -0.0180381021431068  0.0118762499454497  -1.51883820448035  0.140015155016129
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗

The output of this time is similar to the last time except that the last column name of ‘Process of Selection’ is SL.

### 1.1.3 linear stepwise regression using ‘backward’ method for variable selection and ‘SBC’ as criteria for stop rules and without intercept in stepwise regression.

#formula <- mpg ~ . -1
formula <- mpg ~ . + 0
sBackSBC <- stepwise(formula=formula,
data=mtcars,
selection="backward",
select="SBC")
sBackSBC
##     Table 1. Summary of Parameters
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##          Paramters            Value
## ——————————————————————————————————————
## Response Variable           mpg
## Included Variable           NULL
## Selection Method            backward
## Select Criterion            SBC
## Variable significance test  F
## Multicollinearity Terms     NULL
## Intercept                   0
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                 Table 2. Variables Type
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##   class                     variable
## ———————————————————————————————————————————————————————
## numeric  mpg cyl disp hp drat wt qsec vs am gear carb
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                               Table 3. Process of Selection
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  Step  EnteredEffect  RemovedEffect  DF  NumberEffectIn  NumberParmsIn        SBC
## —————————————————————————————————————————————————————————————————————————————————————————
## 0                                       10              10             84.2067855988594
## 1                    vs             1   9               9              80.753286502759
## 2                    carb           1   8               8              77.4481345907642
## 3                    cyl            1   7               7              74.2170762315502
## 4                    gear           1   6               6              71.4474257432347
## 5                    hp             1   5               5              69.6121723518218
## 6                    drat           1   4               4              67.2583479289403
## 7                    disp           1   3               3              65.8158985591381
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##           Table 4. Selected Varaibles
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  variables1  variables2  variables3  variables4
## ————————————————————————————————————————————————
## 0           wt          qsec        am
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                  Table 5. Coefficients of the Selected Variables for mpg
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  Variable      Estimate           StdError            t.value             P.value
## —————————————————————————————————————————————————————————————————————————————————————————
## wt        -3.18545457405163  0.48275857401392   -6.59844225565175  3.12884395417586e-07
## qsec      1.59982255096241   0.102127563736307  15.6649438450637   1.09152213212295e-15
## am        4.29951918563878   1.02411470721657   4.19827891870082   0.000232942305441512
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗

Note that 0 instead of 1 in table ‘Summary of Parameters’ and ‘Selected Varaibles’.

### 1.1.4 linear stepwise regression using ‘score’ method for variable selection, ‘AICc’ as criteria and we perform multivariable multiple stepwise regression with mpg and dra as dependent variables, besides, we select cyl disp hp wt vs am as independent variables, where wt is included always.

formula <- cbind(mpg,drat) ~ cyl+disp+hp+wt+vs+am
stepwise(formula=formula,
data=mtcars,
include='wt',
selection="score",
select="AICc")
##         Table 1. Summary of Parameters
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##          Paramters                Value
## ——————————————————————————————————————————————
## Response Variable           cbind(mpg, drat)
## Included Variable           wt
## Selection Method            score
## Select Criterion            AICc
## Variable significance test  Pillai
## Multicollinearity Terms     NULL
## Intercept                   1
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##      Table 2. Variables Type
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##    class          variable
## —————————————————————————————————
## nmatrix.2  cbind(mpg, drat)
## numeric    cyl disp hp wt vs am
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                   Table 3. Process of Selection
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  NoVariable  RankModel        AICc        VariablesEnteredinModel
## ——————————————————————————————————————————————————————————————————
## 1           2          195.897376923981  1 wt
## 2           3          186.904307271046  1 wt cyl
## 2           3          196.371281316355  1 wt disp
## 2           3          189.17318360105   1 wt hp
## 2           3          194.523487851372  1 wt vs
## 2           3          194.535837853377  1 wt am
## 3           4          192.457336479145  1 wt cyl disp
## 3           4          185.177463011528  1 wt cyl hp
## 3           4          190.779194002406  1 wt cyl vs
## 3           4          184.755187612804  1 wt cyl am
## 3           4          191.382214992907  1 wt disp hp
## 3           4          198.425684821612  1 wt disp vs
## 3           4          194.538955269497  1 wt disp am
## 3           4          193.829893164651  1 wt hp vs
## 3           4          186.571791388542  1 wt hp am
## 3           4          191.027956516955  1 wt vs am
## 4           5          190.104285448931  1 wt cyl disp hp
## 4           5          196.751838279683  1 wt cyl disp vs
## 4           5          190.774200697523  1 wt cyl disp am
## 4           5          190.248327011053  1 wt cyl hp vs
## 4           5          186.392004692651  1 wt cyl hp am
## 4           5          191.020708699958  1 wt cyl vs am
## 4           5          196.60614397021   1 wt disp hp vs
## 4           5          190.549673606409  1 wt disp hp am
## 4           5          196.311249386999  1 wt disp vs am
## 4           5          189.618260351885  1 wt hp vs am
## 5           6          195.586826848026  1 wt cyl disp hp vs
## 5           6          191.874880930657  1 wt cyl disp hp am
## 5           6          197.548034971133  1 wt cyl disp vs am
## 5           6          192.868991967306  1 wt cyl hp vs am
## 5           6          194.381840779641  1 wt disp hp vs am
## 6           7          198.745196549042  1 wt cyl disp hp vs am
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##           Table 4. Selected Varaibles
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  variables1  variables2  variables3  variables4
## ————————————————————————————————————————————————
## 1           wt          cyl         am
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##               Table 5. Coefficients of the Selected Variables for Response mpg
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##   Variable        Estimate           StdError            t.value             P.value
## ————————————————————————————————————————————————————————————————————————————————————————————
## (Intercept)  39.4179334351865   2.6414572997099    14.9227978962656   7.42499755293912e-15
## wt           -3.12514220026708  0.910882701148664  -3.43089422636541  0.00188589438685631
## cyl          -1.5102456624971   0.422279222208057  -3.57641480582487  0.00129160458914754
## am           0.176493157719669  1.30445145498685   0.135300671439281  0.89334214792396
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                Table 6. Coefficients of the Selected Variables for Response drat
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##   Variable         Estimate            StdError            t.value              P.value
## ———————————————————————————————————————————————————————————————————————————————————————————————
## (Intercept)  4.31421082403332     0.332409660876704  12.9785963881282    2.29282220122696e-13
## wt           -0.0579982631143607  0.114628470360106  -0.505967347659431  0.616840130742605
## cyl          -0.116490969949067   0.053141004045333  -2.19211081991774   0.0368483162012922
## am           0.467038681922974    0.164156454783472  2.84508265324694    0.00821005565960176
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗

## 1.2 logistic stepwise regression with data mtcars

### 1.2.1 logistic stepwise regression using ‘forward’ method for variable selection and ‘AIC’ as criteria for stop rules

formula <- am ~ .
stepwiseLogit(formula=formula,
data=mtcars,
selection="forward",
select="AIC")
##    Table 1. Summary of Parameters
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##          Paramters            Value
## —————————————————————————————————————
## Response Variable           am
## Included Variable           NULL
## Selection Method            forward
## Select Criterion            AIC
## Variable significance test  Rao
## Multicollinearity Terms     NULL
## Intercept                   1
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                 Table 2. Variables Type
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##   class                     variable
## ———————————————————————————————————————————————————————
## numeric  am mpg cyl disp hp drat wt qsec vs gear carb
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                    Table 3. Process of Selection
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  Step  EnteredEffect  RemovedEffect  DF  NumberIn        AIC
## ————————————————————————————————————————————————————————————————————
## 0     1                             1   1         45.2297332768578
## 1     gear                          1   2         19.2763400880433
## 2     wt                            1   3         6.00000000576112
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##     Table 4. Selected Varaibles
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  variables1  variables2  variables3
## ————————————————————————————————————
## 1           gear        wt
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                       Table 5. Coefficients of the Selected Variables
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##   Variable        Estimate           StdError            t.value              P.value
## ———————————————————————————————————————————————————————————————————————————————————————————
## (Intercept)  24.9779264690071   211732.148224506  0.000117969456591553  0.999905873992158
## gear         105.57256202697    68256.4892424417  0.00154670366435027   0.998765909518129
## wt           -148.465697432972  84415.1659816875  -0.00175875621052714  0.998596716296849
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗

### 1.2.2 logistic stepwise regression using ‘score’ method for variable selection and ‘SL’ as criteria and only output the first 3 best model.

formula <- am ~ .
stepwiseLogit(formula=formula,
data=mtcars,
selection="score",
select="SL",
best=3)
##   Table 1. Summary of Parameters
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##          Paramters           Value
## ———————————————————————————————————
## Response Variable           am
## Included Variable           NULL
## Selection Method            score
## Select Criterion            SL
## Variable significance test  Rao
## Multicollinearity Terms     NULL
## Intercept                   1
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                 Table 2. Variables Type
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##   class                     variable
## ———————————————————————————————————————————————————————
## numeric  am mpg cyl disp hp drat wt qsec vs gear carb
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                           Table 3. Process of Selection
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  NumberOfVariables         SL                      VariablesInModel
## ——————————————————————————————————————————————————————————————————————————————————
## 2                  20.1769382094272  1 gear
## 2                  16.2546289388823  1 drat
## 2                  15.3455899772529  1 wt
## 3                  23.024782257184   1 cyl qsec
## 3                  22.7277547701151  1 wt gear
## 3                  22.1620072021874  1 mpg gear
## 4                  24.4804946492056  1 mpg qsec gear
## 4                  24.2615455927147  1 cyl qsec gear
## 4                  23.8832404475897  1 mpg cyl qsec
## 5                  25.1574753593028  1 mpg cyl qsec gear
## 5                  24.8193142254911  1 mpg drat qsec gear
## 5                  24.725686315042   1 mpg disp qsec gear
## 6                  25.4015158698094  1 mpg cyl qsec vs gear
## 6                  25.2573360971424  1 mpg cyl drat qsec gear
## 6                  25.1642182693208  1 mpg cyl qsec gear carb
## 7                  25.5008153935662  1 mpg cyl drat qsec vs gear
## 7                  25.4324233741306  1 mpg cyl hp qsec vs gear
## 7                  25.4137814512785  1 mpg cyl disp qsec vs gear
## 8                  25.5274280754659  1 mpg cyl hp drat qsec vs gear
## 8                  25.5104718026612  1 mpg cyl disp drat qsec vs gear
## 8                  25.5083472740736  1 mpg cyl drat wt qsec vs gear
## 9                  25.5604248548793  1 mpg cyl disp hp drat qsec vs gear
## 9                  25.5461866446911  1 mpg cyl hp drat wt qsec vs gear
## 9                  25.5290367298355  1 mpg cyl hp drat qsec vs gear carb
## 10                 25.5733835910141  1 mpg cyl disp hp drat qsec vs gear carb
## 10                 25.5616277385224  1 mpg cyl disp hp drat wt qsec vs gear
## 10                 25.5462397486206  1 mpg cyl hp drat wt qsec vs gear carb
## 11                 25.57543199853    1 mpg cyl disp hp drat wt qsec vs gear carb
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                                                      Table 4. Selected Varaibles
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  variables1  variables2  variables3  variables4  variables5  variables6  variables7  variables8  variables9  variables10  variables11
## ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
## 1           mpg         cyl         disp        hp          drat        wt          qsec        vs          gear         carb
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                        Table 5. Coefficients of the Selected Variables
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##   Variable         Estimate           StdError             t.value              P.value
## —————————————————————————————————————————————————————————————————————————————————————————————
## (Intercept)  -11.6408164177017   1840046.55622753  -6.3263705900832e-06   0.99999495228658
## mpg          -0.880883528085447  28843.372501277   -3.0540240328916e-05   0.999975632413762
## cyl          2.52681917330733    123556.890881509  2.04506535837855e-05   0.999983682739248
## disp         -0.415506274171229  2570.02592605466  -0.000161673962102432  0.999871002842317
## hp           0.343715471343463   2194.50394230898  0.000156625588460697   0.999875030861652
## drat         23.2030530410442    215892.85221756   0.000107474855247463   0.999914247472489
## wt           7.43558654593573    310702.702473842  2.39315155186386e-05   0.999980905413253
## qsec         -7.57708489509811   55096.6897542608  -0.000137523414362877  0.999890272191277
## vs           -47.0120531406395   240518.468503821  -0.000195461302548135  0.999844044445455
## gear         42.855441100866     271926.299875359  0.000157599471329214   0.999874253815556
## carb         -21.5677679539988   107605.517416698  -0.000200433662434599  0.999840077076349
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗

## 1.3 Cox stepwise regression with data lung

### 1.3.1 cox stepwise regression using ‘forward’ method for variable selection and ‘IC(1)’ as criteria for stop rules

lung <- survival::lung
my.data <- na.omit(lung)
my.data$status1 <- ifelse(my.data$status==2,1,0)
data <- my.data
formula = Surv(time, status1) ~ . - status

stepwiseCox(formula=formula,
data=my.data,
selection="forward",
select="IC(1)")
##         Table 1. Summary of Parameters
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##         Paramters                Value
## ——————————————————————————————————————————————
## Response Variable        Surv(time, status1)
## Included Variable        NULL
## Selection Method         forward
## Select Criterion         IC(1)
## Method                   efron
## Multicollinearity Terms  NULL
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                        Table 2. Variables Type
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##    class                            variable
## —————————————————————————————————————————————————————————————————————
## nmatrix.2  Surv(time, status1)
## numeric    inst age sex ph.ecog ph.karno pat.karno meal.cal wt.loss
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                    Table 3. Process of Selection
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  Step  EnteredEffect  RemovedEffect  DF  NumberIn       IC(1)
## ————————————————————————————————————————————————————————————————————
## 1     ph.ecog                       1   1         1004.82485042
## 2     sex                           1   2         998.751396664802
## 3     inst                          1   3         996.306462601088
## 4     wt.loss                       1   4         993.697932944162
## 5     ph.karno                      1   5         990.792621133919
## 6     pat.karno                     1   6         989.742173541071
## 7     age                           1   7         989.5365169151
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                             Table 4. Selected Varaibles
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  variables1  variables2  variables3  variables4  variables5  variables6  variables7
## ————————————————————————————————————————————————————————————————————————————————————
## ph.ecog     sex         inst        wt.loss     ph.karno    pat.karno   age
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                                 Table 5. Coefficients of the Selected Variables
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  Variable          coef              exp(coef)           se(coef)               z                Pr(>|z|)
## ————————————————————————————————————————————————————————————————————————————————————————————————————————————————
## ph.ecog    0.907317172186787    2.47766645634186   0.238503963744317   3.80420164907388   0.000142262259259765
## sex        -0.5668681013351     0.56729938352366   0.200032540541155   -2.83387942682491  0.0045986679410844
## inst       -0.0303746283354971  0.970082045244345  0.0131043742343093  -2.3178999464142   0.020454759369153
## wt.loss    -0.0167121591832758  0.983426714247836  0.0079119389785738  -2.11227099052883  0.0346632125632794
## ph.karno   0.026580081421336    1.02693648250202   0.0116170285677177  2.28802755079718   0.02213591674028
## pat.karno  -0.0108962907298638  0.98916285881416   0.00799900477152    -1.36220580448451  0.173132944510343
## age        0.0127911717927875   1.01287332875159   0.0117657197510269  1.08715591255444   0.276967911173407
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗

### 1.3.2 cox stepwise regression using ‘score’ method for variable selection and ‘SL’ as criteria and only output the first 3 best model.

formula = Surv(time, status1) ~ . - status
stepwiseCox(formula=formula,
data=my.data,
selection="score",
select="SL",
best=3)
##         Table 1. Summary of Parameters
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##         Paramters                Value
## ——————————————————————————————————————————————
## Response Variable        Surv(time, status1)
## Included Variable        NULL
## Selection Method         score
## Select Criterion         SL
## Method                   efron
## Multicollinearity Terms  NULL
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                        Table 2. Variables Type
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##    class                            variable
## —————————————————————————————————————————————————————————————————————
## nmatrix.2  Surv(time, status1)
## numeric    inst age sex ph.ecog ph.karno pat.karno meal.cal wt.loss
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                                  Table 3. Process of Selection
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  NumberOfVariables         SL                             VariablesInModel
## ———————————————————————————————————————————————————————————————————————————————————————————————
## 1                  12.6106639278655  ph.ecog
## 1                  9.40464427478488  pat.karno
## 1                  6.05453549008767  sex
## 2                  19.6188613806345  sex ph.ecog
## 2                  16.1813654333712  inst ph.ecog
## 2                  14.6996068825757  ph.ecog ph.karno
## 3                  22.8462568222864  inst sex ph.ecog
## 3                  22.275079322983   sex ph.ecog ph.karno
## 3                  21.7185245910322  sex ph.ecog wt.loss
## 4                  25.9731431898165  inst sex ph.ecog ph.karno
## 4                  25.9575424705573  inst sex ph.ecog wt.loss
## 4                  24.6127743544862  sex ph.ecog ph.karno wt.loss
## 5                  29.489722041723   inst sex ph.ecog ph.karno wt.loss
## 5                  27.6371652705792  sex ph.ecog ph.karno pat.karno wt.loss
## 5                  27.4244378783933  inst sex ph.ecog pat.karno wt.loss
## 6                  31.8004249527573  inst sex ph.ecog ph.karno pat.karno wt.loss
## 6                  30.4167375088391  inst age sex ph.ecog ph.karno wt.loss
## 6                  29.8108012992351  inst sex ph.ecog ph.karno meal.cal wt.loss
## 7                  32.4668080659739  inst age sex ph.ecog ph.karno pat.karno wt.loss
## 7                  31.9273069224212  inst sex ph.ecog ph.karno pat.karno meal.cal wt.loss
## 7                  30.5707472827073  inst age sex ph.ecog ph.karno meal.cal wt.loss
## 8                  32.5131173841979  inst age sex ph.ecog ph.karno pat.karno meal.cal wt.loss
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                                   Table 4. Selected Varaibles
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  variables1  variables2  variables3  variables4  variables5  variables6  variables7  variables8
## ————————————————————————————————————————————————————————————————————————————————————————————————
## inst        age         sex         ph.ecog     ph.karno    pat.karno   meal.cal    wt.loss
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##
##                                   Table 5. Coefficients of the Selected Variables
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗
##  Variable           coef              exp(coef)           se(coef)                 z                 Pr(>|z|)
## ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
## inst       -0.0303685592659294   0.97008793275763   0.0131188382544396   -2.31488175072607    0.0206194043459998
## age        0.0128110652843044    1.01289347853898   0.0119427514304991   1.07270634902338     0.283402890823254
## sex        -0.566644726715653    0.567426117961668  0.201352245143781    -2.81419621773288    0.00488993706146962
## ph.ecog    0.907380784608605     2.4778240717187    0.238601969045798    3.80290568530237     0.000143008810713775
## ph.karno   0.0265846510127879    1.02694117519292   0.0116272658879958   2.28640604497008     0.0222305150198986
## pat.karno  -0.0109109725399694   0.989148336219512  0.00814092662689389  -1.34026174660812    0.180160263382842
## meal.cal   2.60198066453765e-06  1.00000260198405   0.00026768513236283  0.00972030325916956  0.992244442233114
## wt.loss    -0.0167116544277056   0.983427210638073  0.00791098319435414  -2.11246238515995    0.0346468089838536
## ‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗‗

# 2 Session Info

## R version 4.1.3 (2022-03-10)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Big Sur/Monterey 10.16
##
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
##
## locale:
## [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base
##
## other attached packages:
## [1] StepReg_1.4.4    BiocStyle_2.22.0
##
## loaded via a namespace (and not attached):
##  [1] bslib_0.4.1         compiler_4.1.3      pillar_1.8.1
##  [4] BiocManager_1.30.19 jquerylib_0.1.4     tools_4.1.3
##  [7] digest_0.6.30       jsonlite_1.8.4      evaluate_0.18
## [10] lifecycle_1.0.3     tibble_3.1.8        lattice_0.20-45
## [13] pkgconfig_2.0.3     rlang_1.0.6         Matrix_1.5-3
## [16] DBI_1.1.3           cli_3.4.1           rstudioapi_0.14
## [19] yaml_2.3.6          xfun_0.35           fastmap_1.1.0
## [22] withr_2.5.0         stringr_1.5.0       dplyr_1.0.10
## [25] knitr_1.41          generics_0.1.3      vctrs_0.5.1
## [28] sass_0.4.4          tidyselect_1.2.0    grid_4.1.3
## [31] glue_1.6.2          R6_2.5.1            fansi_1.0.3
## [34] survival_3.4-0      rmarkdown_2.18      bookdown_0.30
## [37] purrr_0.3.5         magrittr_2.0.3      htmltools_0.5.4
## [40] splines_4.1.3       assertthat_0.2.1    utf8_1.2.2
## [43] stringi_1.7.8       cachem_1.0.6

1. China Agricultural University, ↩︎

2. University of Massachusset Chan medical school, ↩︎