betaSandwich: Example Using the RSqBetaSandwich Function
Ivan Jacob Agaloos Pesigan
Source:vignettes/example-r-sq-beta-sandwich.Rmd
example-r-sq-beta-sandwich.Rmd
Confidence intervals for multiple correlation are generated using the
RSqBetaSandwich()
function from the
betaSandwich
package. In this example, we use the data set
and the model used in betaSandwich:
Example Using the BetaHC Function.
df <- betaSandwich::nas1982
Fit the regression model using the lm()
function.
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = df)
Estimate the standardized regression slopes and the corresponding sampling covariance matrix.
Multivariate Normal-Theory Approach
std_mvn <- BetaN(object)
Asymptotic Distribution-Free Approach
std_adf <- BetaADF(object)
HC3
std_hc3 <- BetaHC(object, type = "hc3")
Estimate the multiple correlation coefficients (R-squared and adjusted R-squared) and the corresponding sampling covariance matrix.
mvn <- RSqBetaSandwich(std_mvn, alpha = 0.05)
adf <- RSqBetaSandwich(std_adf, alpha = 0.05)
hc3 <- RSqBetaSandwich(std_hc3, alpha = 0.05)
Methods
summary
Summary of the results of RSqBetaSandwich()
.
summary(mvn)
#> Call:
#> RSqBetaSandwich(object = std_mvn, alpha = 0.05)
#>
#> Multiple correlation with MVN standard errors:
#> est se t df p 2.5% 97.5%
#> rsq 0.8045 4.1345 0.1946 42 0.8467 -7.5393 9.1483
#> adj 0.7906 4.4299 0.1785 42 0.8592 -8.1492 9.7304
summary(adf)
#> Call:
#> RSqBetaSandwich(object = std_adf, alpha = 0.05)
#>
#> Multiple correlation with MVN standard errors:
#> est se t df p 2.5% 97.5%
#> rsq 0.8045 3.6172 0.2224 42 0.8251 -6.4953 8.1044
#> adj 0.7906 3.8756 0.2040 42 0.8394 -7.0307 8.6118
summary(hc3)
#> Call:
#> RSqBetaSandwich(object = std_hc3, alpha = 0.05)
#>
#> Multiple correlation with HC3 standard errors:
#> est se t df p 2.5% 97.5%
#> rsq 0.8045 3.9483 0.2038 42 0.8395 -7.1635 8.7725
#> adj 0.7906 4.2303 0.1869 42 0.8527 -7.7466 9.3277
References
Dudgeon, P. (2017). Some improvements in confidence intervals for
standardized regression coefficients. Psychometrika,
82(4), 928–951. https://doi.org/10.1007/s11336-017-9563-z
National Research Council. (1982). An assessment of
research-doctorate programs in the United States: Social
and behavioral sciences. National Academies Press. https://doi.org/10.17226/9781
Pesigan, I. J. A., Sun, R. W., & Cheung, S. F. (2023). betaDelta and betaSandwich: Confidence intervals for
standardized regression coefficients in R. Multivariate
Behavioral Research, 58(6), 1183–1186. https://doi.org/10.1080/00273171.2023.2201277