| Title: | Confidence Intervals for Standardized Regression Coefficients |
|---|---|
| Description: | Generates confidence intervals for standardized regression coefficients using delta method standard errors for models fitted by lm() as described in Yuan and Chan (2011) <doi:10.1007/s11336-011-9224-6> and Jones and Waller (2015) <doi:10.1007/s11336-013-9380-y>. The package can also be used to generate confidence intervals for R-squared, adjusted R-squared, differences of standardized regression coefficients, semipartial correlations, squared partial correlations, the improvement in R-squared, and Cohen's f-squared, and as a general approach to performing the delta method. A description of the package and code examples are presented in Pesigan, Sun, and Cheung (2023) <doi:10.1080/00273171.2023.2201277>. |
| Authors: | Ivan Jacob Agaloos Pesigan [aut, cre, cph] (ORCID: <https://orcid.org/0000-0003-4818-8420>) |
| Maintainer: | Ivan Jacob Agaloos Pesigan <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.1.0 |
| Built: | 2026-11-23 04:40:12 UTC |
| Source: | https://github.com/jeksterslab/betaDelta |
Estimate Standardized Regression Coefficients and the Corresponding Sampling Covariance Matrix
BetaDelta( object, type = "mvn", alpha = c(0.05, 0.01, 0.001), std_y = TRUE, std_x = NULL )BetaDelta( object, type = "mvn", alpha = c(0.05, 0.01, 0.001), std_y = TRUE, std_x = NULL )
object |
Object of class |
type |
Character string.
If |
alpha |
Numeric vector.
Significance level |
std_y |
Logical.
Standardize |
std_x |
Character vector or |
Partition the covariance matrix of the outcome and the regressors as
The regression slopes and the standardized regression slopes are
where is the standard deviation of regressor .
With std_y = FALSE, is replaced by one;
for a regressor left out of std_x, is replaced by one.
By the delta method,
the sampling covariance matrix of is
where is evaluated at the sample covariance matrix
,
and (gamma) estimates the asymptotic
covariance matrix of .
With type = "mvn",
where is the Moore-Penrose inverse of the
duplication matrix.
With type = "adf", is the unbiased
asymptotic distribution-free estimator
where is the covariance matrix with divisor
,
is the normal-theory matrix
at , and
with the deviation of observation from the
sample means (Jones & Waller, 2015; Yuan & Chan, 2011).
The confidence intervals are
,
where is the number of regression parameters,
including the intercept.
Returns an object
of class betadelta which is a list with the following elements:
Function call.
Function arguments.
Processed lm object.
Asymptotic covariance matrix of the sample covariance matrix.
Asymptotic covariance matrix of the standardized slopes.
Sampling covariance matrix of the standardized slopes.
Vector of standardized slopes.
Ivan Jacob Agaloos Pesigan
Jones, J. A., & Waller, N. G. (2015). The normal-theory and asymptotic distribution-free (ADF) covariance matrix of standardized regression coefficients: Theoretical extensions and finite sample behavior. Psychometrika, 80(2), 365–378. doi:10.1007/s11336-013-9380-y
Pesigan, I. J. A., Sun, R. W., & Cheung, S. F. (2023). betaDelta and betaSandwich: Confidence intervals for standardized regression coefficients in R. Multivariate Behavioral Research. doi:10.1080/00273171.2023.2201277
Yuan, K.-H., & Chan, W. (2011). Biases and standard errors of standardized regression coefficients. Psychometrika, 76(4), 670–690. doi:10.1007/s11336-011-9224-6
Other Beta Delta Method Functions:
DeltaRSqDelta(),
DiffBetaDelta(),
FSqDelta(),
PCorDelta(),
RSqDelta(),
SCorDelta(),
SCorSqDelta()
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) ## Methods ----------------------------------------------------------------- print(x = std) summary(object = std) coef(object = std) vcov(object = std) confint(object = std, level = 0.95)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) ## Methods ----------------------------------------------------------------- print(x = std) summary(object = std) coef(object = std) vcov(object = std) confint(object = std, level = 0.95)
Standardized Regression Slopes
## S3 method for class 'betadelta' coef(object, ...)## S3 method for class 'betadelta' coef(object, ...)
object |
Object of class |
... |
additional arguments. |
Returns a vector of standardized regression slopes.
Ivan Jacob Agaloos Pesigan
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) ## Methods ----------------------------------------------------------------- coef(object = std)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) ## Methods ----------------------------------------------------------------- coef(object = std)
Estimates
## S3 method for class 'deltamethod' coef(object, ...)## S3 method for class 'deltamethod' coef(object, ...)
object |
Object of class |
... |
additional arguments. |
Returns a vector of estimates.
Ivan Jacob Agaloos Pesigan
object <- stats::glm( formula = vs ~ wt + disp, family = "binomial", data = mtcars ) def <- list("exp(wt)", "exp(disp)") out <- DeltaGeneric( object = object, def = def, alpha = 0.05 ) coef(out)object <- stats::glm( formula = vs ~ wt + disp, family = "binomial", data = mtcars ) def <- list("exp(wt)", "exp(disp)") out <- DeltaGeneric( object = object, def = def, alpha = 0.05 ) coef(out)
esdelta
Estimates for an Object of Class esdelta
## S3 method for class 'esdelta' coef(object, ...)## S3 method for class 'esdelta' coef(object, ...)
object |
Object of class |
... |
additional arguments. |
Returns a vector of estimates.
Ivan Jacob Agaloos Pesigan
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # RSqDelta ----------------------------------------------------------------- out <- RSqDelta(object = std) ## Methods ----------------------------------------------------------------- coef(object = out)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # RSqDelta ----------------------------------------------------------------- out <- RSqDelta(object = std) ## Methods ----------------------------------------------------------------- coef(object = out)
Confidence Intervals for Standardized Regression Slopes
## S3 method for class 'betadelta' confint(object, parm = NULL, level = 0.95, ...)## S3 method for class 'betadelta' confint(object, parm = NULL, level = 0.95, ...)
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. |
... |
additional arguments. |
The confidence intervals are
,
where is the square root of the
diagonal of the delta-method sampling covariance matrix (see BetaDelta()),
is the sample size, and is the number of regression
parameters, including the intercept.
The test statistic is
with degrees of freedom.
Returns a matrix of confidence intervals.
Ivan Jacob Agaloos Pesigan
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) ## Methods ----------------------------------------------------------------- confint(object = std, level = 0.95)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) ## Methods ----------------------------------------------------------------- confint(object = std, level = 0.95)
Confidence Intervals
## S3 method for class 'deltamethod' confint(object, parm = NULL, level = 0.95, ...)## S3 method for class 'deltamethod' confint(object, parm = NULL, level = 0.95, ...)
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. |
... |
additional arguments. |
Returns a matrix of confidence intervals.
Ivan Jacob Agaloos Pesigan
object <- stats::glm( formula = vs ~ wt + disp, family = "binomial", data = mtcars ) def <- list("exp(wt)", "exp(disp)") out <- DeltaGeneric( object = object, def = def, alpha = 0.05 ) confint(out, level = 0.95)object <- stats::glm( formula = vs ~ wt + disp, family = "binomial", data = mtcars ) def <- list("exp(wt)", "exp(disp)") out <- DeltaGeneric( object = object, def = def, alpha = 0.05 ) confint(out, level = 0.95)
esdelta
Confidence Intervals for an Object of Class esdelta
## S3 method for class 'esdelta' confint(object, parm = NULL, level = 0.95, ...)## S3 method for class 'esdelta' confint(object, parm = NULL, level = 0.95, ...)
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. |
... |
additional arguments. |
The confidence intervals are
,
where is the square root of the
diagonal of the delta-method sampling covariance matrix of the effect size,
and is the quantile of the standard normal
distribution.
The test statistic is
.
Returns a matrix of confidence intervals.
Ivan Jacob Agaloos Pesigan
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # RSqDelta ----------------------------------------------------------------- out <- RSqDelta(object = std) ## Methods ----------------------------------------------------------------- confint(object = out, level = 0.95)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # RSqDelta ----------------------------------------------------------------- out <- RSqDelta(object = std) ## Methods ----------------------------------------------------------------- confint(object = out, level = 0.95)
Calculates delta method sampling variance-covariance matrix for a function of parameters using a numerical Jacobian.
Delta( coef, vcov, func, ..., theta = 0, alpha = c(0.05, 0.01, 0.001), z = TRUE, df = NULL )Delta( coef, vcov, func, ..., theta = 0, alpha = c(0.05, 0.01, 0.001), z = TRUE, df = NULL )
coef |
Numeric vector. Vector of parameters. |
vcov |
Numeric matrix. Matrix of sampling variance-covariance matrix of parameters. |
func |
R function.
|
... |
Additional arguments to pass to |
theta |
Numeric vector. Parameter values when the null hypothesis is true. |
alpha |
Numeric vector. Significance level/s. |
z |
Logical.
If |
df |
Numeric.
Degrees of freedom if |
Returns an object
of class deltamethod which is a list with the following elements:
Function call.
Function arguments.
Estimates.
Sampling variance-covariance matrix.
Jacobian matrix.
Function used ("Delta").
Ivan Jacob Agaloos Pesigan
Other Delta Method Functions:
DeltaGeneric()
object <- stats::glm( formula = vs ~ wt + disp, family = "binomial", data = mtcars ) func <- function(x) { y <- exp(x) names(y) <- paste0("exp", "(", names(x), ")") y[-1] } Delta( coef = stats::coef(object), vcov = stats::vcov(object), func = func, alpha = 0.05 )object <- stats::glm( formula = vs ~ wt + disp, family = "binomial", data = mtcars ) func <- function(x) { y <- exp(x) names(y) <- paste0("exp", "(", names(x), ")") y[-1] } Delta( coef = stats::coef(object), vcov = stats::vcov(object), func = func, alpha = 0.05 )
Calculates delta method sampling variance-covariance matrix for a function of parameters using a numerical Jacobian.
DeltaGeneric( object, def, theta = 0, alpha = c(0.05, 0.01, 0.001), z = TRUE, df = NULL )DeltaGeneric( object, def, theta = 0, alpha = c(0.05, 0.01, 0.001), z = TRUE, df = NULL )
object |
R object.
Fitted model object with |
def |
List of character strings. A list of defined functions of parameters. The string should be a valid R expression when parsed and should result a single value when evaluated. |
theta |
Numeric vector. Parameter values when the null hypothesis is true. |
alpha |
Numeric vector. Significance level/s. |
z |
Logical.
If |
df |
Numeric.
Degrees of freedom if |
Returns an object
of class deltamethod which is a list with the following elements:
Function call.
Function arguments.
Estimates.
Sampling variance-covariance matrix.
Jacobian matrix.
Function used ("DeltaGeneric").
Ivan Jacob Agaloos Pesigan
Other Delta Method Functions:
Delta()
object <- stats::glm( formula = vs ~ wt + disp, family = "binomial", data = mtcars ) def <- list("exp(wt)", "exp(disp)") DeltaGeneric( object = object, def = def, alpha = 0.05 )object <- stats::glm( formula = vs ~ wt + disp, family = "binomial", data = mtcars ) def <- list("exp(wt)", "exp(disp)") DeltaGeneric( object = object, def = def, alpha = 0.05 )
Estimate Improvement in R-Squared and the Corresponding Sampling Covariance Matrix
DeltaRSqDelta(object, alpha = c(0.05, 0.01, 0.001))DeltaRSqDelta(object, alpha = c(0.05, 0.01, 0.001))
object |
Object of class |
alpha |
Numeric vector.
Significance level |
The sampling covariance matrix is obtained by the delta method
from the sampling covariance matrix of the variances and covariances
stored in object (normal-theory or asymptotically distribution-free).
Two or more regressors are required.
Let be the vector of standardized slopes,
the correlation matrix of the regressors,
the th diagonal element of ,
and .
The semipartial correlation of regressor is
where is the R-squared from regressing regressor
on the other regressors.
Its square, , is the change in when regressor
is added last.
Because , shrinks
toward zero
as regressor becomes more redundant with the other regressors.
The improvement in R-squared for regressor is
For an effect size
that is a function of the standardized parameters,
the sampling variance is approximated by the delta method,
where is the Jacobian of and
is the
sampling covariance matrix
stored in object (BetaDelta()).
Returns an object of class esdelta
which is a list with the following elements:
Function call.
The argument object.
Function arguments.
Sampling covariance matrix of improvement in R-squared (squared semipartial correlation coefficients).
Vector of improvement in R-squared (squared semipartial correlation coefficients).
Function used ("DeltaRSqDelta").
Ivan Jacob Agaloos Pesigan
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
Other Beta Delta Method Functions:
BetaDelta(),
DiffBetaDelta(),
FSqDelta(),
PCorDelta(),
RSqDelta(),
SCorDelta(),
SCorSqDelta()
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # DeltaRSqDelta ------------------------------------------------------------ out <- DeltaRSqDelta(object = std) ## Methods ----------------------------------------------------------------- print(x = out) summary(object = out) coef(object = out) vcov(object = out) confint(object = out, level = 0.95)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # DeltaRSqDelta ------------------------------------------------------------ out <- DeltaRSqDelta(object = std) ## Methods ----------------------------------------------------------------- print(x = out) summary(object = out) coef(object = out) vcov(object = out) confint(object = out, level = 0.95)
Estimate Differences of Standardized Regression Coefficients and the Corresponding Sampling Covariance Matrix
DiffBetaDelta(object, alpha = c(0.05, 0.01, 0.001))DiffBetaDelta(object, alpha = c(0.05, 0.01, 0.001))
object |
Object of class |
alpha |
Numeric vector.
Significance level |
For every pair of regressors ,
the difference of the standardized regression slopes (see BetaDelta()) is
Collect the differences as ,
where each row of has in column ,
in column , and zeros elsewhere.
The sampling covariance matrix is
and the confidence intervals are
.
The slopes must be fully standardized
(std_y = TRUE and std_x = NULL in BetaDelta()).
Returns an object
of class esdelta (and diffbetadelta)
which is a list with the following elements:
Function call.
The argument object.
Function arguments.
Sampling covariance matrix of differences of standardized slopes.
Vector of differences of standardized slopes.
Function used ("DiffBetaDelta").
Ivan Jacob Agaloos Pesigan
Other Beta Delta Method Functions:
BetaDelta(),
DeltaRSqDelta(),
FSqDelta(),
PCorDelta(),
RSqDelta(),
SCorDelta(),
SCorSqDelta()
# 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) summary(object = diff) coef(object = diff) vcov(object = diff) confint(object = diff, level = 0.95)# 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) summary(object = diff) coef(object = diff) vcov(object = diff) confint(object = diff, level = 0.95)
Estimate Cohen's f-Squared and Local f-Squared and the Corresponding Sampling Covariance Matrix
FSqDelta(object, alpha = c(0.05, 0.01, 0.001))FSqDelta(object, alpha = c(0.05, 0.01, 0.001))
object |
Object of class |
alpha |
Numeric vector.
Significance level |
The sampling covariance matrix is obtained by the delta method
from the sampling covariance matrix of the variances and covariances
stored in object (normal-theory or asymptotically distribution-free).
Let be the vector of standardized slopes,
the correlation matrix of the regressors,
the th diagonal element of ,
and .
The semipartial correlation of regressor is
where is the R-squared from regressing regressor
on the other regressors.
Its square, , is the change in when regressor
is added last.
Because , shrinks
toward zero
as regressor becomes more redundant with the other regressors.
Cohen's f-squared and the local f-squared of regressor are
By convention (Cohen, 1988), values of about 0.02, 0.15, and 0.35 are small,
medium, and large effects.
For an effect size
that is a function of the standardized parameters,
the sampling variance is approximated by the delta method,
where is the Jacobian of and
is the
sampling covariance matrix
stored in object (BetaDelta()).
Returns an object of class esdelta
which is a list with the following elements:
Function call.
The argument object.
Function arguments.
Sampling covariance matrix of Cohen's f-squared (fsq) and the local f-squared of each regressor.
Vector of Cohen's f-squared (fsq) and the local f-squared of each regressor.
Function used ("FSqDelta").
Ivan Jacob Agaloos Pesigan
Selya, A. S., Rose, J. S., Dierker, L. C., Hedeker, D., & Mermelstein, R. J. (2012). A practical guide to calculating Cohen's f2, a measure of local effect size, from PROC MIXED. Frontiers in Psychology, 3, 111. doi:10.3389/fpsyg.2012.00111
Other Beta Delta Method Functions:
BetaDelta(),
DeltaRSqDelta(),
DiffBetaDelta(),
PCorDelta(),
RSqDelta(),
SCorDelta(),
SCorSqDelta()
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # FSqDelta ----------------------------------------------------------------- out <- FSqDelta(object = std) ## Methods ----------------------------------------------------------------- print(x = out) summary(object = out) coef(object = out) vcov(object = out) confint(object = out, level = 0.95)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # FSqDelta ----------------------------------------------------------------- out <- FSqDelta(object = std) ## Methods ----------------------------------------------------------------- print(x = out) summary(object = out) coef(object = out) vcov(object = out) confint(object = out, level = 0.95)
1982 National Academy of Sciences Doctoral Programs Data
nas1982nas1982
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.
Estimate Squared Partial Correlation Coefficients and the Corresponding Sampling Covariance Matrix
PCorDelta(object, alpha = c(0.05, 0.01, 0.001))PCorDelta(object, alpha = c(0.05, 0.01, 0.001))
object |
Object of class |
alpha |
Numeric vector.
Significance level |
The sampling covariance matrix is obtained by the delta method
from the sampling covariance matrix of the variances and covariances
stored in object (normal-theory or asymptotically distribution-free).
Two or more regressors are required.
Let be the vector of standardized slopes,
the correlation matrix of the regressors,
the th diagonal element of ,
and .
The semipartial correlation of regressor is
where is the R-squared from regressing regressor
on the other regressors.
Its square, , is the change in when regressor
is added last.
Because , shrinks
toward zero
as regressor becomes more redundant with the other regressors.
The squared partial correlation is
the proportion of the variance in the outcome not explained by the other
regressors
that is explained by regressor .
For an effect size
that is a function of the standardized parameters,
the sampling variance is approximated by the delta method,
where is the Jacobian of and
is the
sampling covariance matrix
stored in object (BetaDelta()).
Returns an object of class esdelta
which is a list with the following elements:
Function call.
The argument object.
Function arguments.
Sampling covariance matrix of squared partial correlation coefficients.
Vector of squared partial correlation coefficients.
Function used ("PCorDelta").
Ivan Jacob Agaloos Pesigan
Other Beta Delta Method Functions:
BetaDelta(),
DeltaRSqDelta(),
DiffBetaDelta(),
FSqDelta(),
RSqDelta(),
SCorDelta(),
SCorSqDelta()
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # PCorDelta ---------------------------------------------------------------- out <- PCorDelta(object = std) ## Methods ----------------------------------------------------------------- print(x = out) summary(object = out) coef(object = out) vcov(object = out) confint(object = out, level = 0.95)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # PCorDelta ---------------------------------------------------------------- out <- PCorDelta(object = std) ## Methods ----------------------------------------------------------------- print(x = out) summary(object = out) coef(object = out) vcov(object = out) confint(object = out, level = 0.95)
betadelta
Print Method for an Object of Class betadelta
## S3 method for class 'betadelta' print(x, alpha = NULL, digits = 4, ...)## S3 method for class 'betadelta' print(x, alpha = NULL, digits = 4, ...)
x |
Object of class |
alpha |
Numeric vector.
Significance level |
digits |
Digits to print. |
... |
additional arguments. |
Prints a matrix of standardized regression slopes, standard errors, test statistics, degrees of freedom, p-values, and confidence intervals.
Ivan Jacob Agaloos Pesigan
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) ## Methods ----------------------------------------------------------------- print(x = std)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) ## Methods ----------------------------------------------------------------- print(x = std)
deltamethod
Print Method for an Object of Class deltamethod
## S3 method for class 'deltamethod' print(x, alpha = NULL, digits = 4, ...)## S3 method for class 'deltamethod' print(x, alpha = NULL, digits = 4, ...)
x |
Object of class |
alpha |
Numeric vector.
Significance level |
digits |
Digits to print. |
... |
additional arguments. |
Returns a matrix of coefficients, standard errors, test statistics, degrees of freedom (if z = FALSE), p-values, and confidence intervals.
Ivan Jacob Agaloos Pesigan
object <- stats::glm( formula = vs ~ wt + disp, family = "binomial", data = mtcars ) def <- list("exp(wt)", "exp(disp)") out <- DeltaGeneric( object = object, def = def, alpha = 0.05 ) print(out)object <- stats::glm( formula = vs ~ wt + disp, family = "binomial", data = mtcars ) def <- list("exp(wt)", "exp(disp)") out <- DeltaGeneric( object = object, def = def, alpha = 0.05 ) print(out)
esdelta
Print Method for an Object of Class esdelta
## S3 method for class 'esdelta' print(x, alpha = NULL, digits = 4, ...)## S3 method for class 'esdelta' print(x, alpha = NULL, digits = 4, ...)
x |
Object of class |
alpha |
Numeric vector.
Significance level |
digits |
Digits to print. |
... |
additional arguments. |
Prints a matrix of estimates, standard errors, test statistics, p-values, and confidence intervals.
Ivan Jacob Agaloos Pesigan
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # RSqDelta ----------------------------------------------------------------- out <- RSqDelta(object = std) ## Methods ----------------------------------------------------------------- print(x = out)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # RSqDelta ----------------------------------------------------------------- out <- RSqDelta(object = std) ## Methods ----------------------------------------------------------------- print(x = out)
summary.esdelta
Print Method for an Object of Class summary.esdelta
## S3 method for class 'summary.esdelta' print(x, ...)## S3 method for class 'summary.esdelta' print(x, ...)
x |
Object of class |
... |
additional arguments. |
Prints a matrix of estimates, standard errors, test statistics, p-values, and confidence intervals.
Ivan Jacob Agaloos Pesigan
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # RSqDelta ----------------------------------------------------------------- out <- RSqDelta(object = std) ## Methods ----------------------------------------------------------------- summary(object = out)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # RSqDelta ----------------------------------------------------------------- out <- RSqDelta(object = std) ## Methods ----------------------------------------------------------------- summary(object = out)
Estimate R-Squared and Adjusted R-Squared and the Corresponding Sampling Covariance Matrix
RSqDelta(object, alpha = c(0.05, 0.01, 0.001))RSqDelta(object, alpha = c(0.05, 0.01, 0.001))
object |
Object of class |
alpha |
Numeric vector.
Significance level |
The sampling covariance matrix is obtained by the delta method
from the sampling covariance matrix of the variances and covariances
stored in object (normal-theory or asymptotically distribution-free).
Let be the vector of standardized slopes,
the correlation matrix of the regressors,
the th diagonal element of ,
and .
The R-squared and the adjusted R-squared are
where is the sample size and is the number of parameters
in the regression model, including the intercept.
For an effect size
that is a function of the standardized parameters,
the sampling variance is approximated by the delta method,
where is the Jacobian of and
is the
sampling covariance matrix
stored in object (BetaDelta()).
Returns an object of class esdelta
which is a list with the following elements:
Function call.
The argument object.
Function arguments.
Sampling covariance matrix of R-squared and adjusted R-squared.
Vector of R-squared and adjusted R-squared.
Function used ("RSqDelta").
Ivan Jacob Agaloos Pesigan
Other Beta Delta Method Functions:
BetaDelta(),
DeltaRSqDelta(),
DiffBetaDelta(),
FSqDelta(),
PCorDelta(),
SCorDelta(),
SCorSqDelta()
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # RSqDelta ----------------------------------------------------------------- out <- RSqDelta(object = std) ## Methods ----------------------------------------------------------------- print(x = out) summary(object = out) coef(object = out) vcov(object = out) confint(object = out, level = 0.95)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # RSqDelta ----------------------------------------------------------------- out <- RSqDelta(object = std) ## Methods ----------------------------------------------------------------- print(x = out) summary(object = out) coef(object = out) vcov(object = out) confint(object = out, level = 0.95)
Estimate Semipartial Correlation Coefficients and the Corresponding Sampling Covariance Matrix
SCorDelta(object, alpha = c(0.05, 0.01, 0.001))SCorDelta(object, alpha = c(0.05, 0.01, 0.001))
object |
Object of class |
alpha |
Numeric vector.
Significance level |
The sampling covariance matrix is obtained by the delta method
from the sampling covariance matrix of the variances and covariances
stored in object (normal-theory or asymptotically distribution-free).
Two or more regressors are required.
Let be the vector of standardized slopes,
the correlation matrix of the regressors,
the th diagonal element of ,
and .
The semipartial correlation of regressor is
where is the R-squared from regressing regressor
on the other regressors.
Its square, , is the change in when regressor
is added last.
Because , shrinks
toward zero
as regressor becomes more redundant with the other regressors.
The sign of follows the sign of .
For an effect size
that is a function of the standardized parameters,
the sampling variance is approximated by the delta method,
where is the Jacobian of and
is the
sampling covariance matrix
stored in object (BetaDelta()).
Returns an object of class esdelta
which is a list with the following elements:
Function call.
The argument object.
Function arguments.
Sampling covariance matrix of semipartial correlation coefficients.
Vector of semipartial correlation coefficients.
Function used ("SCorDelta").
Ivan Jacob Agaloos Pesigan
Other Beta Delta Method Functions:
BetaDelta(),
DeltaRSqDelta(),
DiffBetaDelta(),
FSqDelta(),
PCorDelta(),
RSqDelta(),
SCorSqDelta()
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # SCorDelta ---------------------------------------------------------------- out <- SCorDelta(object = std) ## Methods ----------------------------------------------------------------- print(x = out) summary(object = out) coef(object = out) vcov(object = out) confint(object = out, level = 0.95)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # SCorDelta ---------------------------------------------------------------- out <- SCorDelta(object = std) ## Methods ----------------------------------------------------------------- print(x = out) summary(object = out) coef(object = out) vcov(object = out) confint(object = out, level = 0.95)
Square the signed interval as a set, with lower limit zero if it contains zero. This differs from an interval of squared draws. No draws are generated and no endpoints are clipped to one. Failed signed endpoints remain missing.
SCorSqDelta(object, level = 0.95)SCorSqDelta(object, level = 0.95)
object |
Context accepted by |
level |
Single confidence level in (0, 1). |
The semipartial correlation (see SCorDelta()) is signed,
and its confidence interval may contain zero.
The interval for is the image of that interval under
squaring.
The squared interval is
if ,
if ,
and
if the signed interval contains zero.
This is not the interval of squared draws, and it is not an interval for
DeltaRSqDelta(), which is based on the delta method.
Data frame with est, lower and upper columns and predictor row names. The point estimate is the squared signed estimate. No standard error is implied by this interval transformation.
Ivan Jacob Agaloos Pesigan
Other Beta Delta Method Functions:
BetaDelta(),
DeltaRSqDelta(),
DiffBetaDelta(),
FSqDelta(),
PCorDelta(),
RSqDelta(),
SCorDelta()
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # SCorSqDelta -------------------------------------------------------------- SCorSqDelta(object = std, level = 0.95)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # SCorSqDelta -------------------------------------------------------------- SCorSqDelta(object = std, level = 0.95)
betadelta
Summary Method for an Object of Class betadelta
## S3 method for class 'betadelta' summary(object, alpha = NULL, digits = 4, ...)## S3 method for class 'betadelta' summary(object, alpha = NULL, digits = 4, ...)
object |
Object of class |
alpha |
Numeric vector.
Significance level |
digits |
Digits to print. |
... |
additional arguments. |
The confidence intervals are
,
where is the square root of the
diagonal of the delta-method sampling covariance matrix (see BetaDelta()),
is the sample size, and is the number of regression
parameters, including the intercept.
The test statistic is
with degrees of freedom.
Returns a matrix of standardized regression slopes, standard errors, test statistics, degrees of freedom, p-values, and confidence intervals.
Ivan Jacob Agaloos Pesigan
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) ## Methods ----------------------------------------------------------------- summary(object = std)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) ## Methods ----------------------------------------------------------------- summary(object = std)
deltamethod
Summary Method for an Object of Class deltamethod
## S3 method for class 'deltamethod' summary(object, alpha = NULL, digits = 4, ...)## S3 method for class 'deltamethod' summary(object, alpha = NULL, digits = 4, ...)
object |
Object of class |
alpha |
Numeric vector.
Significance level |
digits |
Digits to print. |
... |
additional arguments. |
Returns a matrix of estimates, standard errors, test statistics, degrees of freedom (if z = FALSE), p-values, and confidence intervals.
Ivan Jacob Agaloos Pesigan
object <- stats::glm( formula = vs ~ wt + disp, family = "binomial", data = mtcars ) def <- list("exp(wt)", "exp(disp)") out <- DeltaGeneric( object = object, def = def, alpha = 0.05 ) summary(out)object <- stats::glm( formula = vs ~ wt + disp, family = "binomial", data = mtcars ) def <- list("exp(wt)", "exp(disp)") out <- DeltaGeneric( object = object, def = def, alpha = 0.05 ) summary(out)
esdelta
Summary Method for an Object of Class esdelta
## S3 method for class 'esdelta' summary(object, alpha = NULL, digits = 4, ...)## S3 method for class 'esdelta' summary(object, alpha = NULL, digits = 4, ...)
object |
Object of class |
alpha |
Numeric vector.
Significance level |
digits |
Digits to print. |
... |
additional arguments. |
The confidence intervals are
,
where is the square root of the
diagonal of the delta-method sampling covariance matrix of the effect size,
and is the quantile of the standard normal
distribution.
The test statistic is
.
Returns a matrix of estimates, standard errors, test statistics, p-values, and confidence intervals.
Ivan Jacob Agaloos Pesigan
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # RSqDelta ----------------------------------------------------------------- out <- RSqDelta(object = std) ## Methods ----------------------------------------------------------------- summary(object = out)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # RSqDelta ----------------------------------------------------------------- out <- RSqDelta(object = std) ## Methods ----------------------------------------------------------------- summary(object = out)
Sampling Covariance Matrix of the Standardized Regression Slopes
## S3 method for class 'betadelta' vcov(object, ...)## S3 method for class 'betadelta' vcov(object, ...)
object |
Object of class |
... |
additional arguments. |
Returns a matrix of the variance-covariance matrix of standardized slopes.
Ivan Jacob Agaloos Pesigan
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) ## Methods ----------------------------------------------------------------- vcov(object = std)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) ## Methods ----------------------------------------------------------------- vcov(object = std)
Sampling Covariance Matrix
## S3 method for class 'deltamethod' vcov(object, ...)## S3 method for class 'deltamethod' vcov(object, ...)
object |
Object of class |
... |
additional arguments. |
Returns a matrix of the variance-covariance matrix.
Ivan Jacob Agaloos Pesigan
object <- stats::glm( formula = vs ~ wt + disp, family = "binomial", data = mtcars ) def <- list("exp(wt)", "exp(disp)") out <- DeltaGeneric( object = object, def = def, alpha = 0.05 ) vcov(out)object <- stats::glm( formula = vs ~ wt + disp, family = "binomial", data = mtcars ) def <- list("exp(wt)", "exp(disp)") out <- DeltaGeneric( object = object, def = def, alpha = 0.05 ) vcov(out)
esdelta
Sampling Covariance Matrix for an Object of Class esdelta
## S3 method for class 'esdelta' vcov(object, ...)## S3 method for class 'esdelta' vcov(object, ...)
object |
Object of class |
... |
additional arguments. |
Returns a matrix of the variance-covariance matrix of the estimates.
Ivan Jacob Agaloos Pesigan
# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # RSqDelta ----------------------------------------------------------------- out <- RSqDelta(object = std) ## Methods ----------------------------------------------------------------- vcov(object = out)# Data --------------------------------------------------------------------- data("nas1982", package = "betaDelta") # Fit Model in lm ---------------------------------------------------------- object <- stats::lm( formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982 ) # BetaDelta ---------------------------------------------------------------- std <- BetaDelta(object = object) # RSqDelta ----------------------------------------------------------------- out <- RSqDelta(object = std) ## Methods ----------------------------------------------------------------- vcov(object = out)