단계적 선택방법을 통해 독립변수를 선택한다.

select_variables_stepwise(
  .data,
  .yvar,
  .xvar,
  .alpha_in = 0.05,
  .alpha_out = 0.1,
  .maxit = 100L,
  .verbose = TRUE
)

Arguments

.data

관측 데이터 프레임.

.yvar

종속변수.

.xvar

완전모형에 속할 독립변수. 독립변수가 여러 개일 때는 벡터 형태로 제공한다. (e.g. c(age, height))

.alpha_in

변수 선택 단계에서 적용할 유의수준. Default: 0.05

.alpha_out

변수 제거 단계에서 적용할 유의수준. .alpha_in 보다 크거나 같아야 한다. Default: 0.10

.maxit

최대 iteration 수. Default: 100.

.verbose

각 단계의 선택/제거 변수를 화면에 출력할 지 여부. Default: TRUE

Value

최종 선택된 독립변수 이름 벡터.

Examples

data(biometric, package = "dmtr") select_variables_stepwise(biometric, weight, c(age, height))
#> Inital variable: age , p-value = 0.03902789 < 0.05 #> Iteration 1 : forward selection - height , p-value = 0.00579269 < 0.05 #> Iteration 1 : backward elimination - no variable can be deleted without a statistically significant loss of fit. #> Every variable provides statistically significant improvement of fit.
#> [1] "age" "height"