Skip to contents

Estimate Multiple Correlation Coefficients (R-Squared and Adjusted R-Squared) and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping

Usage

RSqNB(object, alpha = c(0.05, 0.01, 0.001))

Arguments

object

Object of class nb, that is, the output of the NB() 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 \(R^{2}\) and \(\bar{R}^{2}\).

vcov

Sampling variance-covariance matrix of \(R^{2}\) and \(\bar{R}^{2}\).

est

Vector of estimated \(R^{2}\) and \(\bar{R}^{2}\).

fun

Function used ("RSqNB").

Details

R-squared (\(R^{2}\)) and adjusted R-squared (\(\bar{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 \(R^{2}\) and \(\bar{R}^{2}\), where \(\alpha\) is the significance level.

See also

Other Beta Nonparametric Bootstrap Functions: BetaNB(), DeltaRSqNB(), DiffBetaNB(), NB(), PCorNB(), SCorNB()

Author

Ivan Jacob Agaloos Pesigan

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
)

# RSqNB --------------------------------------------------------------------
out <- RSqNB(nb, alpha = 0.05)

## Methods -----------------------------------------------------------------
print(out)
#> Call:
#> RSqNB(object = nb, alpha = 0.05)
#> 
#> R-squared and adjusted R-squared
#> type = "pc"
#>        est     se   R   2.5%  97.5%
#> rsq 0.8045 0.0499 100 0.7110 0.8872
#> adj 0.7906 0.0534 100 0.6903 0.8792
summary(out)
#> Call:
#> RSqNB(object = nb, alpha = 0.05)
#> 
#> R-squared and adjusted R-squared
#> type = "pc"
#>        est     se   R   2.5%  97.5%
#> rsq 0.8045 0.0499 100 0.7110 0.8872
#> adj 0.7906 0.0534 100 0.6903 0.8792
coef(out)
#>       rsq       adj 
#> 0.8045263 0.7905638 
vcov(out)
#>             rsq         adj
#> rsq 0.002485577 0.002663118
#> adj 0.002663118 0.002853340
confint(out, level = 0.95)
#>         2.5 %    97.5 %
#> rsq 0.7109512 0.8872404
#> adj 0.6903048 0.8791862