Estimate Improvement in R-Squared and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping
Source:R/betaNB-delta-r-sq-nb.R
DeltaRSqNB.RdEstimate Improvement in R-Squared and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping
Usage
DeltaRSqNB(object, alpha = c(0.05, 0.01, 0.001), adj = FALSE)Arguments
- object
Object of class
nb, that is, the output of theNB()function.- alpha
Numeric vector. Significance level \(\alpha\).
- adj
Logical. Use differences in adjusted R-squared. Default
FALSEpreserves unadjusted estimates and output.
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 \(\Delta R^{2}\).
- vcov
Sampling variance-covariance matrix of \(\Delta R^{2}\).
- est
Vector of estimated \(\Delta R^{2}\).
- fun
Estimator label:
"DeltaRSqNB"or"DeltaRSqAdjNB".
Details
The vector of improvement in R-squared (\(\Delta R^{2}\)) is estimated from bootstrap samples. Confidence intervals are generated by obtaining percentiles corresponding to \(100(1 - \alpha)\%\) from the generated sampling distribution of \(\Delta R^{2}\), where \(\alpha\) is the significance level.
With adj = TRUE, estimates and draws are differences between the
adjusted R-squared values of the full model and the model without
each regressor. The population target remains the unadjusted increment.
Negative adjusted estimates and draws are retained.
With type = "mpc" in confint() or summary(), an unadjusted
lower limit is set to zero when the sample F test is nonsignificant.
For adjusted estimates, a nonpositive percentile lower limit becomes
.001 if significant, or zero if nonsignificant; positive lower
limits are retained. Upper limits are unchanged, without clipping.
Both modes use the unadjusted sample F statistic and test at the
interval's error probability alpha (equality is nonsignificant).
These lower-limit rules follow Algina et al. (2007, p. 210; 2008a, pp. 3–5; 2008b, pp. 735, 737; 2010, pp. 928–929, 931–932). Unlike their ranked endpoints, betaNB retains its ordinary interpolated percentile calculation. Their studies used pairs resampling; coverage for wild draws or heteroskedastic F testing is not established by those studies.
Let \(\boldsymbol{\beta}^{\ast}\) be the vector of standardized slopes,
\(\boldsymbol{R}_{x}\) the correlation matrix of the regressors,
\(r^{jj}\) the \(j\)th diagonal element of \(\boldsymbol{R}_{x}^{-1}\),
and \(R^{2} = \boldsymbol{\beta}^{\ast\prime} \boldsymbol{R}_{x}
\boldsymbol{\beta}^{\ast}\).
The semipartial correlation of regressor \(j\) is
$$sr_{j} = \beta^{\ast}_{j} / \sqrt{r^{jj}} = \beta^{\ast}_{j} \sqrt{1 -
R^{2}_{j \cdot -j}},$$
where \(R^{2}_{j \cdot -j}\) is the R-squared from regressing regressor
\(j\)
on the other regressors.
Its square, \(sr^{2}_{j}\), is the change in \(R^{2}\) when regressor
\(j\) is added last.
Because \(1 / r^{jj} = 1 - R^{2}_{j \cdot -j}\), \(sr_{j}\) shrinks
toward zero
as regressor \(j\) becomes more redundant with the other regressors.
The improvement in R-squared for regressor \(j\) is
$$\Delta R^{2}_{j} = R^{2} - R^{2}_{-j} = sr^{2}_{j}.$$
Each effect size is computed from every bootstrap sample
(see NB()), and the confidence intervals are percentile-based.
References
Algina, J., Keselman, H. J., & Penfield, R. D. (2007). Confidence intervals for an effect size measure in multiple linear regression. Educational and Psychological Measurement, 67(2), 207–218. doi:10.1177/0013164406292030
Algina, J., Keselman, H. J., & Penfield, R. D. (2008a). Confidence intervals for the squared multiple semipartial correlation coefficient. Journal of Modern Applied Statistical Methods, 7(1), 2–10. doi:10.22237/jmasm/1209614460
Algina, J., Keselman, H. J., & Penfield, R. D. (2008b). Note on a confidence interval for the squared semipartial correlation coefficient. Educational and Psychological Measurement, 68(5), 734–741. doi:10.1177/0013164407313371
Algina, J., Keselman, H. J., & Penfield, R. D. (2010). Confidence intervals for squared semipartial correlation coefficients: The effect of nonnormality. Educational and Psychological Measurement, 70(6), 926–940. doi:10.1177/0013164410379335
Examples
# Data ---------------------------------------------------------------------
data("nas1982", package = "betaNB")
# Fit Model in lm ----------------------------------------------------------
object <- stats::lm(
formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP,
data = nas1982
)
# NB -----------------------------------------------------------------------
nb <- NB(
object = object,
R = 100, # use a large value e.g., 5000L for actual research
seed = 0508
)
# DeltaRSqNB ---------------------------------------------------------------
out <- DeltaRSqNB(object = nb, alpha = 0.05)
## Methods -----------------------------------------------------------------
print(x = out)
#> Call:
#> DeltaRSqNB(object = nb, alpha = 0.05)
#>
#> Improvement in R-squared
#> type = "pc"
#> est se R 2.5% 97.5%
#> NARTIC 0.1859 0.0543 100 0.0797 0.2945
#> PCTGRT 0.1177 0.0507 100 0.0374 0.2216
#> PCTSUPP 0.0569 0.0342 100 0.0091 0.1396
summary(object = out)
#> Call:
#> DeltaRSqNB(object = nb, alpha = 0.05)
#>
#> Improvement in R-squared
#> type = "pc"
#> est se R 2.5% 97.5%
#> NARTIC 0.1859 0.0543 100 0.0797 0.2945
#> PCTGRT 0.1177 0.0507 100 0.0374 0.2216
#> PCTSUPP 0.0569 0.0342 100 0.0091 0.1396
coef(object = out)
#> NARTIC PCTGRT PCTSUPP
#> 0.1858925 0.1176542 0.0568722
vcov(object = out)
#> NARTIC PCTGRT PCTSUPP
#> NARTIC 0.0029458986 0.0003342570 -0.0004080511
#> PCTGRT 0.0003342570 0.0025659708 -0.0002009029
#> PCTSUPP -0.0004080511 -0.0002009029 0.0011699276
confint(object = out, level = 0.95)
#> 2.5 % 97.5 %
#> NARTIC 0.079688018 0.2944650
#> PCTGRT 0.037358975 0.2216272
#> PCTSUPP 0.009079169 0.1395662
confint(object = out, level = 0.95, type = "mpc")
#> 2.5 % 97.5 %
#> NARTIC 0.079688018 0.2944650
#> PCTGRT 0.037358975 0.2216272
#> PCTSUPP 0.009079169 0.1395662
adjusted <- DeltaRSqNB(object = nb, alpha = 0.05, adj = TRUE)
confint(object = adjusted, level = 0.95, type = "mpc")
#> 2.5 % 97.5 %
#> NARTIC 0.07846053 0.3026643
#> PCTGRT 0.03560112 0.2264941
#> PCTSUPP 0.00476836 0.1411020