betaNB: Example Using the RSqNB Function
Ivan Jacob Agaloos Pesigan
Source:vignettes/example-r-sq-nb.Rmd
example-r-sq-nb.Rmd
Confidence intervals for multiple correlation coefficients are
generated using the RSqNB()
function from the
betaNB
package. In this example, we use the data set and
the model used in betaNB: Example Using
the BetaNB Function.
df <- betaNB::nas1982
Regression
Fit the regression model using the lm()
function.
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = df)
Nonparametric Bootstrap
nb <- NB(object)
Multiple Correlation Coefficients
Normal-Theory Approach
out <- RSqNB(nb, alpha = 0.05)
Methods
summary
Summary of the results of RSqNB()
.
Percentile Confidence Intervals
summary(out, type = "pc")
#> Call:
#> RSqNB(object = nb, alpha = 0.05)
#>
#> R-squared and adjusted R-squared
#> type = "pc"
#> est se R 2.5% 97.5%
#> rsq 0.8045 0.0531 5000 0.6915 0.8956
#> adj 0.7906 0.0569 5000 0.6694 0.8881
Bias Corrected Confidence Intervals
summary(out, type = "bc")
#> Call:
#> RSqNB(object = nb, alpha = 0.05)
#>
#> R-squared and adjusted R-squared
#> type = "bc"
#> est se R 2.5% 97.5%
#> rsq 0.8045 0.0531 5000 0.6486 0.8818
#> adj 0.7906 0.0569 5000 0.6235 0.8734
Bias Corrected and Accelerated Confidence Intervals
summary(out, type = "bca")
#> Call:
#> RSqNB(object = nb, alpha = 0.05)
#>
#> R-squared and adjusted R-squared
#> type = "bca"
#> est se R 2.5% 97.5%
#> rsq 0.8045 0.0531 5000 0.6429 0.8799
#> adj 0.7906 0.0569 5000 0.6174 0.8713
vcov
Return the sampling covariance matrix.
vcov(out)
#> rsq adj
#> rsq 0.002824436 0.003026182
#> adj 0.003026182 0.003242338
confint
Return confidence intervals.
Percentile Confidence Intervals
confint(out, level = 0.95, type = "pc")
#> 2.5 % 97.5 %
#> rsq 0.6914615 0.8955688
#> adj 0.6694230 0.8881094
Bias Corrected Confidence Intervals
confint(out, level = 0.95, type = "bc")
#> 2.5 % 97.5 %
#> rsq 0.6485925 0.8818217
#> adj 0.6234920 0.8733804
Bias Corrected and Accelerated Confidence Intervals
confint(out, level = 0.95, type = "bca")
#> 2.5 % 97.5 %
#> rsq 0.6428623 0.8798942
#> adj 0.6173524 0.8713152