betaNB: Example Using the BetaNB Function
Ivan Jacob Agaloos Pesigan
Source:vignettes/example-beta-nb.Rmd
example-beta-nb.Rmd
In this example, a multiple regression model is fitted using program
quality ratings (QUALITY
) as the regressand/outcome
variable and number of published articles attributed to the program
faculty members (NARTIC
), percent of faculty members
holding research grants (PCTGRT
), and percentage of program
graduates who received support (PCTSUPP
) as
regressor/predictor variables using a data set from 1982 ratings of 46
doctoral programs in psychology in the USA (National Research Council,
1982). Confidence intervals for the standardized regression coefficients
are generated using the BetaNB()
function from the
betaNB
package.
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)
Standardized Regression Slopes
out <- BetaNB(nb, alpha = 0.05)
Methods
summary
Summary of the results of BetaNB()
.
Percentile Confidence Intervals
summary(out, type = "pc")
#> est se R 2.5% 97.5%
#> NARTIC 0.4951 0.0727 5000 0.3505 0.6368
#> PCTGRT 0.3915 0.0780 5000 0.2399 0.5430
#> PCTSUPP 0.2632 0.0795 5000 0.1000 0.4119
Bias Corrected Confidence Intervals
summary(out, type = "bc")
#> est se R 2.5% 97.5%
#> NARTIC 0.4951 0.0727 5000 0.3532 0.6378
#> PCTGRT 0.3915 0.0780 5000 0.2407 0.5438
#> PCTSUPP 0.2632 0.0795 5000 0.1012 0.4130
Bias Corrected and Accelerated Confidence Intervals
summary(out, type = "bca")
#> est se R 2.5% 97.5%
#> NARTIC 0.4951 0.0727 5000 0.3548 0.6396
#> PCTGRT 0.3915 0.0780 5000 0.2466 0.5511
#> PCTSUPP 0.2632 0.0795 5000 0.0948 0.4068
coef
Return the vector of estimates.
coef(out)
#> NARTIC PCTGRT PCTSUPP
#> 0.4951451 0.3914887 0.2632477
vcov
Return the sampling covariance matrix.
vcov(out)
#> NARTIC PCTGRT PCTSUPP
#> NARTIC 0.005279073 -0.003222810 -0.001843517
#> PCTGRT -0.003222810 0.006084715 -0.002122900
#> PCTSUPP -0.001843517 -0.002122900 0.006315603
confint
Return confidence intervals.
Percentile Confidence Intervals
confint(out, level = 0.95, type = "pc")
#> 2.5 % 97.5 %
#> NARTIC 0.3505052 0.6368357
#> PCTGRT 0.2398945 0.5430368
#> PCTSUPP 0.1000139 0.4119124
Bias Corrected Confidence Intervals
confint(out, level = 0.95, type = "bc")
#> 2.5 % 97.5 %
#> NARTIC 0.3532288 0.6378052
#> PCTGRT 0.2407240 0.5437935
#> PCTSUPP 0.1011797 0.4130461
Bias Corrected and Accelerated Confidence Intervals
confint(out, level = 0.95, type = "bca")
#> 2.5 % 97.5 %
#> NARTIC 0.3547965 0.6396365
#> PCTGRT 0.2466146 0.5511055
#> PCTSUPP 0.0947524 0.4067674