Estimate Differences of Standardized Slopes and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping
Source:R/betaNB-diff-beta-nb.R
DiffBetaNB.Rd
Estimate Differences of Standardized Slopes and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping
Usage
DiffBetaNB(object, alpha = c(0.05, 0.01, 0.001))
Arguments
- object
Object of class
nb
, that is, the output of theNB()
function.- alpha
Numeric vector. Significance level \(\alpha\).
Value
Returns an object
of class betanb
which is a list with the following elements:
- call
Function call.
- args
Function arguments.
- thetahatstar
Sampling distribution of differences of standardized regression slopes.
- vcov
Sampling variance-covariance matrix of differences of standardized regression slopes.
- est
Vector of estimated differences of standardized regression slopes.
- fun
Function used ("DiffBetaNB").
Details
The vector of differences of standardized regression slopes is estimated from bootstrap samples. Confidence intervals are generated by obtaining percentiles corresponding to \(100(1 - \alpha)\%\) from the generated sampling distribution of differences of standardized regression slopes, where \(\alpha\) is the significance level.
Examples
# Data ---------------------------------------------------------------------
data("nas1982", package = "betaNB")
# Fit Model in lm ----------------------------------------------------------
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982)
# NB -----------------------------------------------------------------------
nb <- NB(
object,
R = 100, # use a large value e.g., 5000L for actual research
seed = 0508
)
# DiffBetaNB ---------------------------------------------------------------
out <- DiffBetaNB(nb, alpha = 0.05)
## Methods -----------------------------------------------------------------
print(out)
#> 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.1283 100 -0.1579 0.3251
#> NARTIC-PCTSUPP 0.2319 0.1271 100 0.0284 0.4791
#> PCTGRT-PCTSUPP 0.1282 0.1326 100 -0.1146 0.3731
summary(out)
#> 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.1283 100 -0.1579 0.3251
#> NARTIC-PCTSUPP 0.2319 0.1271 100 0.0284 0.4791
#> PCTGRT-PCTSUPP 0.1282 0.1326 100 -0.1146 0.3731
coef(out)
#> NARTIC-PCTGRT NARTIC-PCTSUPP PCTGRT-PCTSUPP
#> 0.1036564 0.2318974 0.1282410
vcov(out)
#> NARTIC-PCTGRT NARTIC-PCTSUPP PCTGRT-PCTSUPP
#> NARTIC-PCTGRT 0.016459509 0.007515380 -0.008944129
#> NARTIC-PCTSUPP 0.007515380 0.016165350 0.008649969
#> PCTGRT-PCTSUPP -0.008944129 0.008649969 0.017594099
confint(out, level = 0.95)
#> 2.5 % 97.5 %
#> NARTIC-PCTGRT -0.15787042 0.3250606
#> NARTIC-PCTSUPP 0.02839849 0.4790846
#> PCTGRT-PCTSUPP -0.11463617 0.3730821