betaNB: Example Using the SCorNB Function
Ivan Jacob Agaloos Pesigan
Source:vignettes/example-s-cor-nb.Rmd
example-s-cor-nb.RmdConfidence intervals for semipartial correlation coefficients are
generated using the SCorNB() 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)Semipartial Correlation Coefficients
Normal-Theory Approach
out <- SCorNB(nb, alpha = 0.05)Methods
summary
Summary of the results of SCorNB().
Percentile Confidence Intervals
summary(out, type = "pc")
#> Call:
#> SCorNB(object = nb, alpha = 0.05)
#>
#> Semipartial correlations
#> type = "pc"
#> est se R 2.5% 97.5%
#> NARTIC 0.4312 0.0688 5000 0.2902 0.5624
#> PCTGRT 0.3430 0.0747 5000 0.1823 0.4767
#> PCTSUPP 0.2385 0.0715 5000 0.0911 0.3730Bias Corrected Confidence Intervals
summary(out, type = "bc")
#> Call:
#> SCorNB(object = nb, alpha = 0.05)
#>
#> Semipartial correlations
#> type = "bc"
#> est se R 2.5% 97.5%
#> NARTIC 0.4312 0.0688 5000 0.3073 0.5807
#> PCTGRT 0.3430 0.0747 5000 0.2013 0.4965
#> PCTSUPP 0.2385 0.0715 5000 0.1069 0.3912Bias Corrected and Accelerated Confidence Intervals
summary(out, type = "bca")
#> Call:
#> SCorNB(object = nb, alpha = 0.05)
#>
#> Semipartial correlations
#> type = "bca"
#> est se R 2.5% 97.5%
#> NARTIC 0.4312 0.0688 5000 0.3143 0.5934
#> PCTGRT 0.3430 0.0747 5000 0.2115 0.5102
#> PCTSUPP 0.2385 0.0715 5000 0.1035 0.3853coef
Return the vector of estimates.
coef(out)
#> NARTIC PCTGRT PCTSUPP
#> 0.4311525 0.3430075 0.2384789vcov
Return the sampling covariance matrix.
vcov(out)
#> NARTIC PCTGRT PCTSUPP
#> NARTIC 0.0047371244 -0.0005347982 -0.0005285589
#> PCTGRT -0.0005347982 0.0055812532 -0.0009273660
#> PCTSUPP -0.0005285589 -0.0009273660 0.0051090070confint
Return confidence intervals.
Percentile Confidence Intervals
confint(out, level = 0.95, type = "pc")
#> 2.5 % 97.5 %
#> NARTIC 0.29015630 0.5623626
#> PCTGRT 0.18228393 0.4767282
#> PCTSUPP 0.09113281 0.3729530Bias Corrected Confidence Intervals
confint(out, level = 0.95, type = "bc")
#> 2.5 % 97.5 %
#> NARTIC 0.3072550 0.5807255
#> PCTGRT 0.2013438 0.4965051
#> PCTSUPP 0.1069018 0.3911692Bias Corrected and Accelerated Confidence Intervals
confint(out, level = 0.95, type = "bca")
#> 2.5 % 97.5 %
#> NARTIC 0.3143033 0.5933732
#> PCTGRT 0.2114614 0.5102281
#> PCTSUPP 0.1035383 0.3853484