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-11-21 05:51:01 UTC |
Source: | https://github.com/jeksterslab/betaNB |
Estimate Standardized Regression Coefficients and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping
BetaNB(object, alpha = c(0.05, 0.01, 0.001))
BetaNB(object, alpha = c(0.05, 0.01, 0.001))
object |
Object of class |
alpha |
Numeric vector.
Significance level |
The vector of standardized regression coefficients
()
is estimated from bootstrap samples.
Confidence intervals are generated by obtaining
percentiles corresponding to
from the generated sampling
distribution of
,
where
is the significance level.
Returns an object
of class betanb
which is a list with the following elements:
Function call.
Function arguments.
Sampling distribution of
.
Jackknife estimates.
Vector of estimated
.
Function used ("BetaNB").
Ivan Jacob Agaloos Pesigan
Other Beta Nonparametric Bootstrap Functions:
DeltaRSqNB()
,
DiffBetaNB()
,
NB()
,
PCorNB()
,
RSqNB()
,
SCorNB()
# 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)
# 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)
betanb
Estimated Parameter Method for an Object of Class
betanb
## S3 method for class 'betanb' coef(object, ...)
## S3 method for class 'betanb' coef(object, ...)
object |
Object of Class |
... |
additional arguments. |
Returns a vector of estimated parameters.
Ivan Jacob Agaloos Pesigan
betanb
Confidence Intervals Method for an Object of Class
betanb
## S3 method for class 'betanb' confint(object, parm = NULL, level = 0.95, type = "pc", ...)
## S3 method for class 'betanb' confint(object, parm = NULL, level = 0.95, type = "pc", ...)
object |
Object of Class |
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,
|
... |
additional arguments. |
Returns a matrix of confidence intervals.
Ivan Jacob Agaloos Pesigan
Estimate Improvement in R-Squared and Generate the Corresponding Sampling Distribution Using Nonparametric Bootstrapping
DeltaRSqNB(object, alpha = c(0.05, 0.01, 0.001))
DeltaRSqNB(object, alpha = c(0.05, 0.01, 0.001))
object |
Object of class |
alpha |
Numeric vector.
Significance level |
The vector of improvement in R-squared
()
is estimated from bootstrap samples.
Confidence intervals are generated by obtaining
percentiles corresponding to
from the generated sampling
distribution of
,
where
is the significance level.
Returns an object
of class betanb
which is a list with the following elements:
Function call.
Function arguments.
Sampling distribution of
.
Sampling variance-covariance matrix of
.
Vector of estimated
.
Function used ("DeltaRSqNB").
Ivan Jacob Agaloos Pesigan
Other Beta Nonparametric Bootstrap Functions:
BetaNB()
,
DiffBetaNB()
,
NB()
,
PCorNB()
,
RSqNB()
,
SCorNB()
# 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)
# 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
DiffBetaNB(object, alpha = c(0.05, 0.01, 0.001))
DiffBetaNB(object, alpha = c(0.05, 0.01, 0.001))
object |
Object of class |
alpha |
Numeric vector.
Significance level |
The vector of differences of standardized regression slopes
is estimated from bootstrap samples.
Confidence intervals are generated by obtaining
percentiles corresponding to
from the generated sampling
distribution of differences of standardized regression slopes,
where
is the significance level.
Returns an object
of class betanb
which is a list with the following elements:
Function call.
Function arguments.
Sampling distribution of differences of standardized regression slopes.
Sampling variance-covariance matrix of differences of standardized regression slopes.
Vector of estimated differences of standardized regression slopes.
Function used ("DiffBetaNB").
Ivan Jacob Agaloos Pesigan
Other Beta Nonparametric Bootstrap Functions:
BetaNB()
,
DeltaRSqNB()
,
NB()
,
PCorNB()
,
RSqNB()
,
SCorNB()
# 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)
# 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
nas1982
nas1982
Ratings of 46 doctoral programs in psychology in the USA with the following variables:
Program quality ratings.
Number of faculty members in the program.
Number of program graduates.
Percentage of program graduates who received support.
Percent of faculty members holding research grants.
Number of published articles attributed to program faculty member.
Percent of faculty with one or more published article.
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
NB(object, R = 5000L, seed = NULL)
NB(object, R = 5000L, seed = NULL)
object |
Object of class |
R |
Positive integer. Number of bootstrap replications. |
seed |
Integer. Seed number for reproducibility. |
Returns an object
of class nb
which is a list with the following elements:
Function call.
Function arguments.
Processed lm
object.
Sampling distribution of sample covariances.
Jackknife estimates.
Ivan Jacob Agaloos Pesigan
Efron, B., & Tibshirani, R. J. (1993) An introduction to the bootstrap. Chapman & Hall.
Other Beta Nonparametric Bootstrap Functions:
BetaNB()
,
DeltaRSqNB()
,
DiffBetaNB()
,
PCorNB()
,
RSqNB()
,
SCorNB()
# 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
# 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
PCorNB(object, alpha = c(0.05, 0.01, 0.001))
PCorNB(object, alpha = c(0.05, 0.01, 0.001))
object |
Object of class |
alpha |
Numeric vector.
Significance level |
The vector of squared partial correlation coefficients
()
is estimated from bootstrap samples.
Confidence intervals are generated by obtaining
percentiles corresponding to
from the generated sampling
distribution of
,
where
is the significance level.
Returns an object
of class betanb
which is a list with the following elements:
Function call.
Function arguments.
Sampling distribution of
.
Sampling variance-covariance matrix of
.
Vector of estimated
.
Function used ("PCorNB").
Ivan Jacob Agaloos Pesigan
Other Beta Nonparametric Bootstrap Functions:
BetaNB()
,
DeltaRSqNB()
,
DiffBetaNB()
,
NB()
,
RSqNB()
,
SCorNB()
# 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)
# 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)
betanb
Print Method for an Object of Class
betanb
## S3 method for class 'betanb' print(x, alpha = NULL, type = "pc", digits = 4, ...)
## S3 method for class 'betanb' print(x, alpha = NULL, type = "pc", digits = 4, ...)
x |
Object of Class |
alpha |
Numeric vector.
Significance level |
type |
Charater string.
Confidence interval type, that is,
|
digits |
Digits to print. |
... |
additional arguments. |
Prints a matrix of estimates, standard errors, number of bootstrap replications, and confidence intervals.
Ivan Jacob Agaloos Pesigan
nb
Print Method for an Object of Class nb
## S3 method for class 'nb' print(x, ...)
## S3 method for class 'nb' print(x, ...)
x |
Object of Class |
... |
additional arguments. |
Prints the first six bootstrap covariance matrices.
Ivan Jacob Agaloos Pesigan
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982) nb <- NB(object, R = 100) print(nb)
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
RSqNB(object, alpha = c(0.05, 0.01, 0.001))
RSqNB(object, alpha = c(0.05, 0.01, 0.001))
object |
Object of class |
alpha |
Numeric vector.
Significance level |
R-squared () and
adjusted R-squared (
)
is estimated from bootstrap samples.
Confidence intervals are generated by obtaining
percentiles corresponding to
from the generated sampling
distribution of
and
,
where
is the significance level.
Returns an object
of class betanb
which is a list with the following elements:
Function call.
Function arguments.
Sampling distribution of
and
.
Sampling variance-covariance matrix of
and
.
Vector of estimated
and
.
Function used ("RSqNB").
Ivan Jacob Agaloos Pesigan
Other Beta Nonparametric Bootstrap Functions:
BetaNB()
,
DeltaRSqNB()
,
DiffBetaNB()
,
NB()
,
PCorNB()
,
SCorNB()
# 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)
# 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
SCorNB(object, alpha = c(0.05, 0.01, 0.001))
SCorNB(object, alpha = c(0.05, 0.01, 0.001))
object |
Object of class |
alpha |
Numeric vector.
Significance level |
The vector of semipartial correlation coefficients
()
is estimated from bootstrap samples.
Confidence intervals are generated by obtaining
percentiles corresponding to
from the generated sampling
distribution of
,
where
is the significance level.
Returns an object
of class betanb
which is a list with the following elements:
Function call.
Function arguments.
Sampling distribution of
.
Sampling variance-covariance matrix of
.
Vector of estimated
.
Function used ("SCorNB").
Ivan Jacob Agaloos Pesigan
Other Beta Nonparametric Bootstrap Functions:
BetaNB()
,
DeltaRSqNB()
,
DiffBetaNB()
,
NB()
,
PCorNB()
,
RSqNB()
# 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)
# 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)
betanb
Summary Method for an Object of Class
betanb
## S3 method for class 'betanb' summary(object, alpha = NULL, type = "pc", digits = 4, ...)
## S3 method for class 'betanb' summary(object, alpha = NULL, type = "pc", digits = 4, ...)
object |
Object of Class |
alpha |
Numeric vector.
Significance level |
type |
Charater string.
Confidence interval type, that is,
|
digits |
Digits to print. |
... |
additional arguments. |
Returns a matrix of estimates, standard errors, number of bootstrap replications, and confidence intervals.
Ivan Jacob Agaloos Pesigan
betanb
Sampling Variance-Covariance Matrix Method for an Object of Class
betanb
## S3 method for class 'betanb' vcov(object, ...)
## S3 method for class 'betanb' vcov(object, ...)
object |
Object of Class |
... |
additional arguments. |
Returns the variance-covariance matrix of estimates.
Ivan Jacob Agaloos Pesigan