To begin, load the package.
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.61484896 0.09473284 38.1584 < 2.2e-16 ***
#> crim_1_beta -0.02083915 0.00525492 -3.9656 9.521e-05 ***
#> zn_2_beta 0 0 0 0
#> indus_3_beta 0 0 0 0
#> rm_4_beta 0.23370359 0.01233188 18.9512 < 2.2e-16 ***
#> age_5_beta -0.00105836 0.00035072 -3.0177 0.0018230 **
#> rad_6_beta 0.00893513 0.00236064 3.7850 0.0001725 ***
#> ptratio_7_beta -0.02602475 0.00280413 -9.2809 1.070e-14 ***
#> lnox_8_beta -0.28290631 0.08344519 -3.3903 0.0006006 ***
#> ldis_9_beta -0.16020525 0.02301161 -6.9619 7.788e-10 ***
#> ltax_10_beta -0.18402351 0.02603465 -7.0684 4.848e-10 ***
#> llstat_11_beta -0.17194746 0.02055909 -8.3636 1.094e-12 ***
#> chast_12_beta 0.04804492 0.01958231 2.4535 0.0086759 **
#>
#> Scale:
#> Estimate SE Z Pvalue
#> intercept_0_alpha -9.652431 2.293223 -4.2091 4.194e-05 ***
#> crim_1_alpha 0.021396 0.015921 1.3439 0.1139337
#> zn_2_alpha 0 0 0 0
#> indus_3_alpha -0.033849 0.022387 -1.5120 0.0806782 .
#> rm_4_alpha -0.205594 0.102716 -2.0016 0.0268356 *
#> age_5_alpha 0 0 0 0
#> rad_6_alpha 0.033704 0.017691 1.9052 0.0337295 *
#> ptratio_7_alpha 0 0 0 0
#> lnox_8_alpha -0.478042 0.817158 -0.5850 0.4314891
#> ldis_9_alpha -1.049942 0.269546 -3.8952 0.0001204 ***
#> ltax_10_alpha 1.375999 0.391715 3.5128 0.0004103 ***
#> llstat_11_alpha 0 0 0 0
#> chast_12_alpha 0 0 0 0
#>
#> Shape:
#> Estimate SE Z Pvalue
#> intercept_0_nu 0.29520 0.10618 2.7801 0.003585 **
#>
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Kappa Estimate:
#> [1] 1.54339
#> Penalized Likelihood:
#> [1] 221.1142
#> IC Value:
#> [1] -442.2284
fit$kappa # shape estimate
#> [1] 1.54339Plot the standardized coefficient values with respect to the epsilon-telescope.
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))