Summarize the results of std_selected()
or
std_selected_boot()
.
# S3 method for std_selected
summary(object, ...)
The output of std_selected()
or std_selected_boot()
.
Additional arguments. Ignored by this function.
An object of class summary.std_selected
, with
bootstrap confidence intervals added if present in the object.
The object is a list. Its main element coefficients
is similar to
the
coefficient table in the summary()
printout of lm()
.
This object is for printing summary information of the results
from std_selected()
or std_selected_boot()
.
# Load a sample data set
dat <- test_x_1_w_1_v_1_cat1_n_500
# Do a moderated regression by lm
lm_raw <- lm(dv ~ iv*mod + v1 + cat1, dat)
summary(lm_raw)
#>
#> Call:
#> lm(formula = dv ~ iv * mod + v1 + cat1, data = dat)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -2146.0 -431.9 -25.0 411.2 2309.3
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 308.767 4075.066 0.076 0.9396
#> iv 52.760 271.242 0.195 0.8459
#> mod 5.127 40.772 0.126 0.9000
#> v1 -12.760 10.174 -1.254 0.2104
#> cat1gp2 -158.673 71.834 -2.209 0.0276 *
#> cat1gp3 -43.166 75.283 -0.573 0.5666
#> iv:mod 3.416 2.709 1.261 0.2080
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Residual standard error: 665 on 493 degrees of freedom
#> Multiple R-squared: 0.6352, Adjusted R-squared: 0.6307
#> F-statistic: 143 on 6 and 493 DF, p-value: < 2.2e-16
#>
# Standardize all variables except for categorical variables.
# Interaction terms are formed after standardization.
lm_std <- std_selected(lm_raw, to_scale = ~ .,
to_center = ~ .)
summary(lm_std)
#>
#> Selected variable(s) are centered by mean and/or scaled by SD
#> - Variable(s) centered: dv iv mod v1 cat1
#> - Variable(s) scaled: dv iv mod v1 cat1
#>
#> centered_by scaled_by Note
#> dv 6565.02965 1094.244465 Standardized (mean = 0, SD = 1)
#> iv 15.01576 2.039154 Standardized (mean = 0, SD = 1)
#> mod 100.39502 5.040823 Standardized (mean = 0, SD = 1)
#> v1 10.13884 2.938932 Standardized (mean = 0, SD = 1)
#> cat1 NA NA Nonnumeric
#>
#> Note:
#> - Categorical variables will not be centered or scaled even if requested.
#>
#> Call:
#> lm(formula = dv ~ iv * mod + v1 + cat1, data = dat_mod)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -1.96117 -0.39474 -0.02285 0.37579 2.11040
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 0.06458 0.04825 1.338 0.1814
#> iv 0.73738 0.02736 26.948 <2e-16 ***
#> mod 0.25990 0.02737 9.496 <2e-16 ***
#> v1 -0.03427 0.02733 -1.254 0.2104
#> cat1gp2 -0.14501 0.06565 -2.209 0.0276 *
#> cat1gp3 -0.03945 0.06880 -0.573 0.5666
#> iv:mod 0.03209 0.02545 1.261 0.2080
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Residual standard error: 0.6077 on 493 degrees of freedom
#> Multiple R-squared: 0.6352, Adjusted R-squared: 0.6307
#> F-statistic: 143 on 6 and 493 DF, p-value: < 2.2e-16
#>
#> Note:
#> - Estimates and their statistics are based on the data after mean-centering, scaling, or standardization.
# With bootstrapping
# nboot = 100 just for illustration. nboot >= 2000 should be used in read
# research.
lm_std_boot <- std_selected_boot(lm_raw, to_scale = ~ .,
to_center = ~ .,
nboot = 100)
summary(lm_std_boot)
#>
#> Selected variable(s) are centered by mean and/or scaled by SD
#> - Variable(s) centered: dv iv mod v1 cat1
#> - Variable(s) scaled: dv iv mod v1 cat1
#>
#> centered_by scaled_by Note
#> dv 6565.02965 1094.244465 Standardized (mean = 0, SD = 1)
#> iv 15.01576 2.039154 Standardized (mean = 0, SD = 1)
#> mod 100.39502 5.040823 Standardized (mean = 0, SD = 1)
#> v1 10.13884 2.938932 Standardized (mean = 0, SD = 1)
#> cat1 NA NA Nonnumeric
#>
#> Note:
#> - Categorical variables will not be centered or scaled even if requested.
#> - Nonparametric bootstrapping 95% confidence intervals computed.
#> - The number of bootstrap samples is 100.
#>
#> Call:
#> lm(formula = dv ~ iv * mod + v1 + cat1, data = dat_mod)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -1.96117 -0.39474 -0.02285 0.37579 2.11040
#>
#> Coefficients:
#> Estimate CI Lower CI Upper Std. Error t value Pr(>|t|)
#> (Intercept) 0.0645819 -0.0005936 0.1491718 0.0482503 1.338 0.1814
#> iv 0.7373838 0.6887268 0.7763855 0.0273632 26.948 <2e-16 ***
#> mod 0.2598987 0.2008832 0.3074666 0.0273687 9.496 <2e-16 ***
#> v1 -0.0342709 -0.0902115 0.0272759 0.0273250 -1.254 0.2104
#> cat1gp2 -0.1450065 -0.2768718 -0.0106607 0.0656469 -2.209 0.0276 *
#> cat1gp3 -0.0394483 -0.1964224 0.0802801 0.0687988 -0.573 0.5666
#> iv:mod 0.0320874 -0.0048116 0.0747295 0.0254507 1.261 0.2080
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Residual standard error: 0.6077 on 493 degrees of freedom
#> Multiple R-squared: 0.6352, Adjusted R-squared: 0.6307
#> F-statistic: 143 on 6 and 493 DF, p-value: < 2.2e-16
#>
#> Note:
#> - Estimates and their statistics are based on the data after mean-centering, scaling, or standardization.
#> - [CI Lower, CI Upper] are bootstrap percentile confidence intervals.
#> - Std. Error are not bootstrap SEs.