Package 'betaNB'

Title: Bootstrap for Regression Effect Sizes
Description: Generates nonparametric bootstrap confidence intervals (Efron and Tibshirani, 1993: <doi:10.1201/9780429246593>) for standardized regression coefficients (beta) and other effect sizes, including multiple correlation, semipartial correlations, improvement in R-squared, squared partial correlations, and differences in standardized regression coefficients, for models fitted by lm().
Authors: Ivan Jacob Agaloos Pesigan [aut, cre, cph]
Maintainer: Ivan Jacob Agaloos Pesigan <[email protected]>
License: MIT + file LICENSE
Version: 1.0.4.9000
Built: 2024-10-08 04:16:46 UTC
Source: https://github.com/jeksterslab/betaNB

Help Index


Estimate Standardized Regression Coefficients and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping

Description

Estimate Standardized Regression Coefficients and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping

Usage

BetaNB(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.

Details

The vector of standardized regression coefficients (β^\boldsymbol{\hat{\beta}}) is estimated from bootstrap samples. Confidence intervals are generated by obtaining percentiles corresponding to 100(1α)%100(1 - \alpha)\% from the generated sampling distribution of β^\boldsymbol{\hat{\beta}}, where α\alpha is the significance level.

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 β^\boldsymbol{\hat{\beta}}.

jackknife

Jackknife estimates.

est

Vector of estimated β^\boldsymbol{\hat{\beta}}.

fun

Function used ("BetaNB").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

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

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
)

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

## Methods -----------------------------------------------------------------
print(out)
summary(out)
coef(out)
vcov(out)
confint(out, level = 0.95)

Estimated Parameter Method for an Object of Class betanb

Description

Estimated Parameter Method for an Object of Class betanb

Usage

## S3 method for class 'betanb'
coef(object, ...)

Arguments

object

Object of Class betanb, that is, the output of the BetaNB(), RSqNB(), SCorNB(), DeltaRSqNB(), PCorNB(), or DiffBetaNB() functions.

...

additional arguments.

Value

Returns a vector of estimated parameters.

Author(s)

Ivan Jacob Agaloos Pesigan


Confidence Intervals Method for an Object of Class betanb

Description

Confidence Intervals Method for an Object of Class betanb

Usage

## S3 method for class 'betanb'
confint(object, parm = NULL, level = 0.95, type = "pc", ...)

Arguments

object

Object of Class betanb, that is, the output of the BetaNB(), RSqNB(), SCorNB(), DeltaRSqNB(), PCorNB(), or DiffBetaNB() functions.

parm

a specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered.

level

the confidence level required.

type

Charater string. Confidence interval type, that is, type = "pc" for percentile; type = "bc" for bias corrected; type = "bca" for bias corrected and accelerated.

...

additional arguments.

Value

Returns a matrix of confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan


Estimate Improvement in R-Squared and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping

Description

Estimate Improvement in R-Squared and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping

Usage

DeltaRSqNB(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.

Details

The vector of improvement in R-squared (ΔR2\Delta R^{2}) is estimated from bootstrap samples. Confidence intervals are generated by obtaining percentiles corresponding to 100(1α)%100(1 - \alpha)\% from the generated sampling distribution of ΔR2\Delta R^{2}, where α\alpha is the significance level.

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 ΔR2\Delta R^{2}.

vcov

Sampling variance-covariance matrix of ΔR2\Delta R^{2}.

est

Vector of estimated ΔR2\Delta R^{2}.

fun

Function used ("DeltaRSqNB").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

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

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
)

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

## Methods -----------------------------------------------------------------
print(out)
summary(out)
coef(out)
vcov(out)
confint(out, level = 0.95)

Estimate Differences of Standardized Slopes and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping

Description

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 the NB() function.

alpha

Numeric vector. Significance level α\alpha.

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α)%100(1 - \alpha)\% from the generated sampling distribution of differences of standardized regression slopes, where α\alpha is the significance level.

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").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

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

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)
summary(out)
coef(out)
vcov(out)
confint(out, level = 0.95)

1982 National Academy of Sciences Doctoral Programs Data

Description

1982 National Academy of Sciences Doctoral Programs Data

Usage

nas1982

Format

Ratings of 46 doctoral programs in psychology in the USA with the following variables:

QUALITY

Program quality ratings.

NFACUL

Number of faculty members in the program.

NGRADS

Number of program graduates.

PCTSUPP

Percentage of program graduates who received support.

PCTGRT

Percent of faculty members holding research grants.

NARTIC

Number of published articles attributed to program faculty member.

PCTPUB

Percent of faculty with one or more published article.

References

National Research Council. (1982). An assessment of research-doctorate programs in the United States: Social and behavioral sciences. doi:10.17226/9781. Reproduced with permission from the National Academy of Sciences, Courtesy of the National Academies Press, Washington, D.C.


Generate the Sampling Distribution of Sample Covariances Using Nonparametric Bootstrapping

Description

Generate the Sampling Distribution of Sample Covariances Using Nonparametric Bootstrapping

Usage

NB(object, R = 5000L, seed = NULL)

Arguments

object

Object of class lm.

R

Positive integer. Number of bootstrap replications.

seed

Integer. Seed number for reproducibility.

Value

Returns an object of class nb which is a list with the following elements:

call

Function call.

args

Function arguments.

lm_process

Processed lm object.

thetahatstar

Sampling distribution of sample covariances.

jackknife

Jackknife estimates.

Author(s)

Ivan Jacob Agaloos Pesigan

References

Efron, B., & Tibshirani, R. J. (1993) An introduction to the bootstrap. Chapman & Hall.

See Also

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

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., 20000L for actual research
  seed = 0508
)
nb
# The `nb` object can be passed as the first argument
# to the following functions
#   - BetaNB
#   - DeltaRSqNB
#   - DiffBetaNB
#   - PCorNB
#   - RSqNB
#   - SCorNB

Estimate Squared Partial Correlation Coefficients and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping

Description

Estimate Squared Partial Correlation Coefficients and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping

Usage

PCorNB(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.

Details

The vector of squared partial correlation coefficients (rp2r^{2}_{p}) is estimated from bootstrap samples. Confidence intervals are generated by obtaining percentiles corresponding to 100(1α)%100(1 - \alpha)\% from the generated sampling distribution of rp2r^{2}_{p}, where α\alpha is the significance level.

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 rp2r^{2}_{p}.

vcov

Sampling variance-covariance matrix of rp2r^{2}_{p}.

est

Vector of estimated rp2r^{2}_{p}.

fun

Function used ("PCorNB").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

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

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
)

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

## Methods -----------------------------------------------------------------
print(out)
summary(out)
coef(out)
vcov(out)
confint(out, level = 0.95)

Print Method for an Object of Class betanb

Description

Print Method for an Object of Class betanb

Usage

## S3 method for class 'betanb'
print(x, alpha = NULL, type = "pc", digits = 4, ...)

Arguments

x

Object of Class betanb, that is, the output of the BetaNB(), RSqNB(), SCorNB(), DeltaRSqNB(), PCorNB(), or DiffBetaNB() functions.

alpha

Numeric vector. Significance level α\alpha. If alpha = NULL, use the argument alpha used in x.

type

Charater string. Confidence interval type, that is, type = "pc" for percentile; type = "bc" for bias corrected; type = "bca" for bias corrected and accelerated.

digits

Digits to print.

...

additional arguments.

Value

Prints a matrix of estimates, standard errors, number of bootstrap replications, and confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan


Print Method for an Object of Class nb

Description

Print Method for an Object of Class nb

Usage

## S3 method for class 'nb'
print(x, ...)

Arguments

x

Object of Class nb.

...

additional arguments.

Value

Prints the first six bootstrap covariance matrices.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982)
nb <- NB(object, R = 100)
print(nb)

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

Description

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.

Details

R-squared (R2R^{2}) and adjusted R-squared (Rˉ2\bar{R}^{2}) is estimated from bootstrap samples. Confidence intervals are generated by obtaining percentiles corresponding to 100(1α)%100(1 - \alpha)\% from the generated sampling distribution of R2R^{2} and Rˉ2\bar{R}^{2}, where α\alpha is the significance level.

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 R2R^{2} and Rˉ2\bar{R}^{2}.

vcov

Sampling variance-covariance matrix of R2R^{2} and Rˉ2\bar{R}^{2}.

est

Vector of estimated R2R^{2} and Rˉ2\bar{R}^{2}.

fun

Function used ("RSqNB").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

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

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)
summary(out)
coef(out)
vcov(out)
confint(out, level = 0.95)

Estimate Semipartial Correlation Coefficients and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping

Description

Estimate Semipartial Correlation Coefficients and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping

Usage

SCorNB(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.

Details

The vector of semipartial correlation coefficients (rsr_{s}) is estimated from bootstrap samples. Confidence intervals are generated by obtaining percentiles corresponding to 100(1α)%100(1 - \alpha)\% from the generated sampling distribution of rsr_{s}, where α\alpha is the significance level.

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 rsr_{s}.

vcov

Sampling variance-covariance matrix of rsr_{s}.

est

Vector of estimated rsr_{s}.

fun

Function used ("SCorNB").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

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

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
)

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

## Methods -----------------------------------------------------------------
print(out)
summary(out)
coef(out)
vcov(out)
confint(out, level = 0.95)

Summary Method for an Object of Class betanb

Description

Summary Method for an Object of Class betanb

Usage

## S3 method for class 'betanb'
summary(object, alpha = NULL, type = "pc", digits = 4, ...)

Arguments

object

Object of Class betanb, that is, the output of the BetaNB(), RSqNB(), SCorNB(), DeltaRSqNB(), PCorNB(), or DiffBetaNB() functions.

alpha

Numeric vector. Significance level α\alpha. If alpha = NULL, use the argument alpha used in object.

type

Charater string. Confidence interval type, that is, type = "pc" for percentile; type = "bc" for bias corrected; type = "bca" for bias corrected and accelerated.

digits

Digits to print.

...

additional arguments.

Value

Returns a matrix of estimates, standard errors, number of bootstrap replications, and confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan


Sampling Variance-Covariance Matrix Method for an Object of Class betanb

Description

Sampling Variance-Covariance Matrix Method for an Object of Class betanb

Usage

## S3 method for class 'betanb'
vcov(object, ...)

Arguments

object

Object of Class betanb, that is, the output of the BetaNB(), RSqNB(), SCorNB(), DeltaRSqNB(), PCorNB(), or DiffBetaNB() functions.

...

additional arguments.

Value

Returns the variance-covariance matrix of estimates.

Author(s)

Ivan Jacob Agaloos Pesigan