betaNB: Example Using the RSqNB Function
Ivan Jacob Agaloos Pesigan
Source:vignettes/example-r-sq-nb.Rmd
example-r-sq-nb.RmdConfidence 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::nas1982Regression
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.0529 5000 0.6941 0.8989
#> adj 0.7906 0.0567 5000 0.6722 0.8917Bias 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.0529 5000 0.6459 0.8805
#> adj 0.7906 0.0567 5000 0.6206 0.8719Bias 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.0529 5000 0.6402 0.8790
#> adj 0.7906 0.0567 5000 0.6145 0.8704vcov
Return the sampling covariance matrix.
vcov(out)
#> rsq adj
#> rsq 0.002795797 0.002995497
#> adj 0.002995497 0.003209461confint
Return confidence intervals.
Percentile Confidence Intervals
confint(out, level = 0.95, type = "pc")
#> 2.5 % 97.5 %
#> rsq 0.6940991 0.8989497
#> adj 0.6722490 0.8917318Bias Corrected Confidence Intervals
confint(out, level = 0.95, type = "bc")
#> 2.5 % 97.5 %
#> rsq 0.6459249 0.8804642
#> adj 0.6206338 0.8719260Bias Corrected and Accelerated Confidence Intervals
confint(out, level = 0.95, type = "bca")
#> 2.5 % 97.5 %
#> rsq 0.6401815 0.8790311
#> adj 0.6144802 0.8703905