To begin, load the package.
Boston Housing Data
Perform automatic variable selection using a smooth information criterion.
fit <- smoothic(
formula = lcmedv ~ .,
data = bostonhouseprice2,
family = "sgnd", # Smooth Generalized Normal Distribution
model = "mpr" # model location and scale
)
Display the estimates and standard errors.
summary(fit)
#> Call:
#> smoothic(formula = lcmedv ~ ., data = bostonhouseprice2, family = "sgnd",
#> model = "mpr")
#> Family:
#> [1] "sgnd"
#> Model:
#> [1] "mpr"
#>
#> Coefficients:
#>
#> Location:
#> Estimate SE Z Pvalue
#> intercept_0_beta 3.61593796 0.16559666 21.8358 < 2.2e-16 ***
#> crim_1_beta -0.01986098 0.00514643 -3.8592 0.0001499 ***
#> zn_2_beta 0 0 0 0
#> indus_3_beta 0 0 0 0
#> rm_4_beta 0.23415197 0.03167535 7.3922 1.603e-10 ***
#> age_5_beta -0.00106351 0.00054909 -1.9368 0.0321328 *
#> rad_6_beta 0.00875929 0.00244040 3.5893 0.0003525 ***
#> ptratio_7_beta -0.02582467 0.00376890 -6.8520 1.738e-09 ***
#> lnox_8_beta -0.27873614 0.11738902 -2.3745 0.0110743 *
#> ldis_9_beta -0.15881138 0.03060053 -5.1898 1.437e-06 ***
#> ltax_10_beta -0.18546652 0.07450491 -2.4893 0.0082330 **
#> llstat_11_beta -0.17101398 0.04888847 -3.4980 0.0004670 ***
#> chast_12_beta 0.05012851 0.01950965 2.5694 0.0066730 **
#>
#> Scale:
#> Estimate SE Z Pvalue
#> intercept_0_alpha -9.650061 2.266987 -4.2568 4.019e-05 ***
#> crim_1_alpha 0.018699 0.016471 1.1352 0.1727296
#> zn_2_alpha 0 0 0 0
#> indus_3_alpha -0.034072 0.025857 -1.3177 0.1216615
#> rm_4_alpha -0.180956 0.104532 -1.7311 0.0512618 .
#> age_5_alpha 0 0 0 0
#> rad_6_alpha 0.032101 0.018842 1.7037 0.0544038 .
#> ptratio_7_alpha 0 0 0 0
#> lnox_8_alpha 0 0 0 0
#> ldis_9_alpha -0.963366 0.229340 -4.2006 4.855e-05 ***
#> ltax_10_alpha 1.385008 0.403220 3.4349 0.0005663 ***
#> llstat_11_alpha 0 0 0 0
#> chast_12_alpha 0 0 0 0
#>
#> Shape:
#> Estimate SE Z Pvalue
#> intercept_0_nu 0.28911 0.10669 2.7098 0.004573 **
#>
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Kappa Estimate:
#> [1] 1.535242
#> Penalized Likelihood:
#> [1] 223.6369
#> IC Value:
#> [1] -447.2739
fit$kappa # shape estimate
#> [1] 1.535242
Plot the standardized coefficient values with respect to the epsilon-telescope.
plot_paths(fit)
Plot the model-based conditional density curves.
plot_effects(fit,
what = c("ltax", "rm", "ldis"), # or "all" for all selected variables
density_range = c(2.25, 3.75))