Estimate Differences of Standardized Regression Coefficients and the Corresponding Sampling Covariance Matrix
Source:R/betaDelta-diff-beta-delta.R
DiffBetaDelta.RdEstimate Differences of Standardized Regression Coefficients and the Corresponding Sampling Covariance Matrix
Usage
DiffBetaDelta(object, alpha = c(0.05, 0.01, 0.001))Arguments
- object
Object of class
betadelta, that is, the output of theBetaDelta()function.- alpha
Numeric vector. Significance level \(\alpha\).
Value
Returns an object
of class esdelta (and diffbetadelta)
which is a list with the following elements:
- call
Function call.
- fit
The argument
object.- args
Function arguments.
- vcov
Sampling covariance matrix of differences of standardized slopes.
- est
Vector of differences of standardized slopes.
- fun
Function used ("DiffBetaDelta").
Details
For every pair of regressors \(j < l\),
the difference of the standardized regression slopes (see BetaDelta()) is
$$\Delta \beta^{\ast}_{jl} = \beta^{\ast}_{j} - \beta^{\ast}_{l}.$$
Collect the differences as \(\boldsymbol{C} \boldsymbol{\beta}^{\ast}\),
where each row of \(\boldsymbol{C}\) has \(1\) in column \(j\),
\(-1\) in column \(l\), and zeros elsewhere.
The sampling covariance matrix is
$$\widehat{\operatorname{var}} \left( \boldsymbol{C}
\hat{\boldsymbol{\beta}}^{\ast} \right) = \boldsymbol{C}
\widehat{\operatorname{var}} \left( \hat{\boldsymbol{\beta}}^{\ast} \right)
\boldsymbol{C}^{\prime},$$
and the confidence intervals are
\(\Delta \hat{\beta}^{\ast}_{jl} \pm z_{1 - \alpha / 2}
\widehat{\operatorname{se}} \left( \Delta \hat{\beta}^{\ast}_{jl} \right)\).
The slopes must be fully standardized
(std_y = TRUE and std_x = NULL in BetaDelta()).
See also
Other Beta Delta Method Functions:
BetaDelta(),
DeltaRSqDelta(),
FSqDelta(),
PCorDelta(),
RSqDelta(),
SCorDelta(),
SCorSqDelta()
Examples
# Data ---------------------------------------------------------------------
data("nas1982", package = "betaDelta")
# Fit Model in lm ----------------------------------------------------------
object <- stats::lm(
formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP,
data = nas1982
)
# BetaDelta ----------------------------------------------------------------
std <- BetaDelta(object = object)
# DiffBetaDelta ------------------------------------------------------------
diff <- DiffBetaDelta(object = std)
## Methods -----------------------------------------------------------------
print(x = diff)
#> Call:
#> DiffBetaDelta(object = std)
#>
#> Differences of standardized regression slopes with MVN standard errors:
#> est se z p 0.05% 0.5% 2.5% 97.5%
#> NARTIC-PCTGRT 0.1037 0.1357 0.7640 0.4449 -0.3428 -0.2458 -0.1623 0.3696
#> NARTIC-PCTSUPP 0.2319 0.1252 1.8524 0.0640 -0.1800 -0.0906 -0.0135 0.4773
#> PCTGRT-PCTSUPP 0.1282 0.1227 1.0451 0.2960 -0.2755 -0.1878 -0.1123 0.3688
#> 99.5% 99.95%
#> NARTIC-PCTGRT 0.4531 0.5501
#> NARTIC-PCTSUPP 0.5544 0.6438
#> PCTGRT-PCTSUPP 0.4443 0.5320
summary(object = diff)
#> Call:
#> DiffBetaDelta(object = std)
#>
#> Differences of standardized regression slopes with MVN standard errors:
#> est se z p 0.05% 0.5% 2.5% 97.5%
#> NARTIC-PCTGRT 0.1037 0.1357 0.7640 0.4449 -0.3428 -0.2458 -0.1623 0.3696
#> NARTIC-PCTSUPP 0.2319 0.1252 1.8524 0.0640 -0.1800 -0.0906 -0.0135 0.4773
#> PCTGRT-PCTSUPP 0.1282 0.1227 1.0451 0.2960 -0.2755 -0.1878 -0.1123 0.3688
#> 99.5% 99.95%
#> NARTIC-PCTGRT 0.4531 0.5501
#> NARTIC-PCTSUPP 0.5544 0.6438
#> PCTGRT-PCTSUPP 0.4443 0.5320
coef(object = diff)
#> NARTIC-PCTGRT NARTIC-PCTSUPP PCTGRT-PCTSUPP
#> 0.1036564 0.2318974 0.1282410
vcov(object = diff)
#> NARTIC-PCTGRT NARTIC-PCTSUPP PCTGRT-PCTSUPP
#> NARTIC-PCTGRT 0.018408653 0.009511262 -0.008897391
#> NARTIC-PCTSUPP 0.009511262 0.015672035 0.006160773
#> PCTGRT-PCTSUPP -0.008897391 0.006160773 0.015058164
confint(object = diff, level = 0.95)
#> 2.5 % 97.5 %
#> NARTIC-PCTGRT -0.16226855 0.3695814
#> NARTIC-PCTSUPP -0.01346652 0.4772614
#> PCTGRT-PCTSUPP -0.11226950 0.3687516