── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
dbl (14): CRIM, ZN, INDUS, CHAS, NOX, RM, AGE, DIS, RAD, TAX, PTRATIO, B, LS...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# フルモデルを作成full_model <-lm(MEDV ~ ., data = boston_data)# ステップワイズ法による変数選択を実行stepwise_model <-stepAIC(full_model, direction ="both")
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
dbl (14): CRIM, ZN, INDUS, CHAS, NOX, RM, AGE, DIS, RAD, TAX, PTRATIO, B, LS...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
The following object is masked from 'package:purrr':
lift
# データを読み込むboston_data <-read_csv("boston.csv")
Rows: 506 Columns: 14
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
dbl (14): CRIM, ZN, INDUS, CHAS, NOX, RM, AGE, DIS, RAD, TAX, PTRATIO, B, LS...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# ステップワイズ法のモデルを作成full_model <-lm(MEDV ~ ., data = boston_data)stepwise_model <-stepAIC(full_model, direction ="both")