Skip to contents

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

coef

Calculate R-squared and adjusted R-squared.

coef(mvn)
#>   rsq.rsq   adj.adj 
#> 0.8045263 0.7905638
coef(adf)
#>   rsq.rsq   adj.adj 
#> 0.8045263 0.7905638
coef(hc3)
#>   rsq.rsq   adj.adj 
#> 0.8045263 0.7905638

vcov

Calculate the sampling covariance matrix of R-squared and adjusted R-squared.

vcov(mvn)
#>          rsq      adj
#> rsq 17.09432 18.31534
#> adj 18.31534 19.62358
vcov(adf)
#>          rsq      adj
#> rsq 13.08433 14.01893
#> adj 14.01893 15.02028
vcov(hc3)
#>          rsq      adj
#> rsq 15.58911 16.70262
#> adj 16.70262 17.89567

confint

Generate confidence intervals for R-squared and adjusted R-squared.

confint(mvn, level = 0.95)
#>         2.5 %   97.5 %
#> rsq -7.539288 9.148341
#> adj -8.149238 9.730365
confint(adf, level = 0.95)
#>         2.5 %   97.5 %
#> rsq -6.495334 8.104386
#> adj -7.030715 8.611842
confint(hc3, level = 0.95)
#>         2.5 %   97.5 %
#> rsq -7.163476 8.772529
#> adj -7.746582 9.327709

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