Skip to contents

Confidence intervals for differences of standardized regression slopes are generated using the DiffBetaNB() 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)

Differences of Standardized Regression Slopes

Normal-Theory Approach

out <- DiffBetaNB(nb, alpha = 0.05)

Methods

summary

Summary of the results of DiffBetaNB().

Percentile Confidence Intervals

summary(out, type = "pc")
#> Call:
#> DiffBetaNB(object = nb, alpha = 0.05)
#> 
#> Differences of standardized regression slopes
#> type = "pc"
#>                   est     se    R    2.5%  97.5%
#> NARTIC-PCTGRT  0.1037 0.1328 5000 -0.1504 0.3764
#> NARTIC-PCTSUPP 0.2319 0.1246 5000 -0.0046 0.4816
#> PCTGRT-PCTSUPP 0.1282 0.1262 5000 -0.1150 0.3812

Bias Corrected Confidence Intervals

summary(out, type = "bc")
#> Call:
#> DiffBetaNB(object = nb, alpha = 0.05)
#> 
#> Differences of standardized regression slopes
#> type = "bc"
#>                   est     se    R    2.5%  97.5%
#> NARTIC-PCTGRT  0.1037 0.1328 5000 -0.1554 0.3710
#> NARTIC-PCTSUPP 0.2319 0.1246 5000 -0.0046 0.4816
#> PCTGRT-PCTSUPP 0.1282 0.1262 5000 -0.1117 0.3827

Bias Corrected and Accelerated Confidence Intervals

summary(out, type = "bca")
#> Call:
#> DiffBetaNB(object = nb, alpha = 0.05)
#> 
#> Differences of standardized regression slopes
#> type = "bca"
#>                   est     se    R    2.5%  97.5%
#> NARTIC-PCTGRT  0.1037 0.1328 5000 -0.1569 0.3692
#> NARTIC-PCTSUPP 0.2319 0.1246 5000 -0.0069 0.4785
#> PCTGRT-PCTSUPP 0.1282 0.1262 5000 -0.1051 0.3945

coef

Return the vector of estimates.

coef(out)
#>  NARTIC-PCTGRT NARTIC-PCTSUPP PCTGRT-PCTSUPP 
#>      0.1036564      0.2318974      0.1282410

vcov

Return the sampling covariance matrix.

vcov(out)
#>                NARTIC-PCTGRT NARTIC-PCTSUPP PCTGRT-PCTSUPP
#> NARTIC-PCTGRT    0.017641175    0.008614489   -0.009026686
#> NARTIC-PCTSUPP   0.008614489    0.015522225    0.006907736
#> PCTGRT-PCTSUPP  -0.009026686    0.006907736    0.015934423

confint

Return confidence intervals.

Percentile Confidence Intervals

confint(out, level = 0.95, type = "pc")
#>                       2.5 %    97.5 %
#> NARTIC-PCTGRT  -0.150354129 0.3763935
#> NARTIC-PCTSUPP -0.004598945 0.4816455
#> PCTGRT-PCTSUPP -0.114970474 0.3812283

Bias Corrected Confidence Intervals

confint(out, level = 0.95, type = "bc")
#>                       2.5 %    97.5 %
#> NARTIC-PCTGRT  -0.155389732 0.3710497
#> NARTIC-PCTSUPP -0.004624517 0.4815714
#> PCTGRT-PCTSUPP -0.111719371 0.3827235

Bias Corrected and Accelerated Confidence Intervals

confint(out, level = 0.95, type = "bca")
#>                       2.5 %    97.5 %
#> NARTIC-PCTGRT  -0.156859277 0.3691607
#> NARTIC-PCTSUPP -0.006879625 0.4784554
#> PCTGRT-PCTSUPP -0.105104206 0.3945000

References