To begin, load the package.
library(smoothic)
Perform automatic variable selection using a smooth information criterion.
<- smoothic(
fit 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:
#> Estimate SEE Z Pvalue
#> intercept_0_beta 3.61136944 0.07097461 50.8826 < 2.2e-16 ***
#> crim_1_beta -0.02087987 0.00510433 -4.0906 5.122e-05 ***
#> zn_2_beta 0 0 0 0
#> indus_3_beta 0 0 0 0
#> rm_4_beta 0.23351548 0.01013492 23.0407 < 2.2e-16 ***
#> age_5_beta -0.00106744 0.00033431 -3.1930 0.0009644 ***
#> rad_6_beta 0.00888114 0.00224680 3.9528 8.239e-05 ***
#> ptratio_7_beta -0.02584035 0.00243260 -10.6225 < 2.2e-16 ***
#> lnox_8_beta -0.28333271 0.08040520 -3.5238 0.0003415 ***
#> ldis_9_beta -0.16080844 0.02245545 -7.1612 1.721e-10 ***
#> ltax_10_beta -0.18360925 0.01598370 -11.4873 < 2.2e-16 ***
#> llstat_11_beta -0.17173098 0.01643777 -10.4473 < 2.2e-16 ***
#> chast_12_beta 0.04881278 0.01980792 2.4643 0.0078328 **
#> intercept_0_alpha -9.65538752 2.34917955 -4.1101 4.795e-05 ***
#> crim_1_alpha 0.02269813 0.01564627 1.4507 0.0890931 .
#> zn_2_alpha 0 0 0 0
#> indus_3_alpha -0.03371923 0.02188524 -1.5407 0.0735639 .
#> rm_4_alpha -0.20051538 0.10084591 -1.9883 0.0264247 *
#> age_5_alpha 0.00159679 0.00374685 0.4262 0.5363418
#> rad_6_alpha 0.03381129 0.01746317 1.9361 0.0299475 *
#> ptratio_7_alpha 0 0 0 0
#> lnox_8_alpha -0.65242459 0.83315211 -0.7831 0.3127381
#> ldis_9_alpha -1.04204621 0.27808068 -3.7473 0.0001648 ***
#> ltax_10_alpha 1.33390312 0.38883292 3.4305 0.0004596 ***
#> llstat_11_alpha 0 0 0 0
#> chast_12_alpha 0 0 0 0
#> nu_0 0.30581625 0.10335134 2.9590 0.0019454 **
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> Penalized Likelihood:
#> [1] 218.3393
$kappa # shape estimate
fit#> [1] 1.557733
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("median", "ltax", "rm", "ldis"), # or "all" for all selected variables
density_range = c(2.25, 3.75))