betaNB: Example Using the BetaNB Function
Ivan Jacob Agaloos Pesigan
Source:vignettes/example-beta-nb.Rmd
example-beta-nb.RmdIn 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::nas1982Regression
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")
#> Call:
#> BetaNB(object = nb, alpha = 0.05)
#>
#> Standardized regression slopes
#> type = "pc"
#> est se R 2.5% 97.5%
#> NARTIC 0.4951 0.0719 5000 0.3532 0.6375
#> PCTGRT 0.3915 0.0768 5000 0.2332 0.5392
#> PCTSUPP 0.2632 0.0795 5000 0.1035 0.4129Bias Corrected Confidence Intervals
summary(out, type = "bc")
#> Call:
#> BetaNB(object = nb, alpha = 0.05)
#>
#> Standardized regression slopes
#> type = "bc"
#> est se R 2.5% 97.5%
#> NARTIC 0.4951 0.0719 5000 0.3531 0.6375
#> PCTGRT 0.3915 0.0768 5000 0.2335 0.5400
#> PCTSUPP 0.2632 0.0795 5000 0.1106 0.4178Bias Corrected and Accelerated Confidence Intervals
summary(out, type = "bca")
#> Call:
#> BetaNB(object = nb, alpha = 0.05)
#>
#> Standardized regression slopes
#> type = "bca"
#> est se R 2.5% 97.5%
#> NARTIC 0.4951 0.0719 5000 0.3550 0.6379
#> PCTGRT 0.3915 0.0768 5000 0.2393 0.5452
#> PCTSUPP 0.2632 0.0795 5000 0.1030 0.4126coef
Return the vector of estimates.
coef(out)
#> NARTIC PCTGRT PCTSUPP
#> 0.4951451 0.3914887 0.2632477vcov
Return the sampling covariance matrix.
vcov(out)
#> NARTIC PCTGRT PCTSUPP
#> NARTIC 0.005176367 -0.003086391 -0.001956563
#> PCTGRT -0.003086391 0.005904248 -0.001982019
#> PCTSUPP -0.001956563 -0.001982019 0.006325444confint
Return confidence intervals.
Percentile Confidence Intervals
confint(out, level = 0.95, type = "pc")
#> 2.5 % 97.5 %
#> NARTIC 0.3532004 0.6375480
#> PCTGRT 0.2331858 0.5392322
#> PCTSUPP 0.1035042 0.4128834Bias Corrected Confidence Intervals
confint(out, level = 0.95, type = "bc")
#> 2.5 % 97.5 %
#> NARTIC 0.3530666 0.6375255
#> PCTGRT 0.2335470 0.5399795
#> PCTSUPP 0.1106288 0.4177795Bias Corrected and Accelerated Confidence Intervals
confint(out, level = 0.95, type = "bca")
#> 2.5 % 97.5 %
#> NARTIC 0.3549886 0.6378954
#> PCTGRT 0.2393090 0.5452485
#> PCTSUPP 0.1030325 0.4125984