Package 'betaDelta'

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

Help Index


Estimate Standardized Regression Coefficients and the Corresponding Sampling Covariance Matrix

Description

Estimate Standardized Regression Coefficients and the Corresponding Sampling Covariance Matrix

Usage

BetaDelta(
  object,
  type = "mvn",
  alpha = c(0.05, 0.01, 0.001),
  std_y = TRUE,
  std_x = NULL
)

Arguments

object

Object of class lm.

type

Character string. If type = "mvn", use the multivariate normal-theory approach. If type = "adf", use the asymptotic distribution-free approach.

alpha

Numeric vector. Significance level α\alpha.

std_y

Logical. Standardize yy. With std_y = FALSE, yy is left in its original units (bjσxjb_j \sigma_{x_j}).

std_x

Character vector or NULL. Names of the regressors to standardize. NULL (default) standardizes all regressors; character(0) standardizes none (bj/σyb_j / \sigma_y). Leaving a dummy variable out keeps its 0-1 contrast. The delta method accounts for the sampling variability of the standard deviations.

Details

Partition the covariance matrix of the outcome and the regressors as

Σ=(σy2σyx′σyxΣx).\boldsymbol{\Sigma} = \begin{pmatrix} \sigma^{2}_{y} & \boldsymbol{\sigma}_{yx}^{\prime} \\ \boldsymbol{\sigma}_{yx} & \boldsymbol{\Sigma}_{x} \end{pmatrix}.

The regression slopes and the standardized regression slopes are

β=Σx−1σyx,βj∗=βjσxjσy,\boldsymbol{\beta} = \boldsymbol{\Sigma}_{x}^{-1} \boldsymbol{\sigma}_{yx}, \quad \beta^{\ast}_{j} = \beta_{j} \frac{\sigma_{x_{j}}}{\sigma_{y}},

where σxj\sigma_{x_{j}} is the standard deviation of regressor jj. With std_y = FALSE, σy\sigma_{y} is replaced by one; for a regressor left out of std_x, σxj\sigma_{x_{j}} is replaced by one.

By the delta method, the sampling covariance matrix of β^∗\hat{\boldsymbol{\beta}}^{\ast} is

var⁡^(β^∗)=1nJΓ^J′,J=∂β∗∂vech⁡(Σ)′,\widehat{\operatorname{var}} \left( \hat{\boldsymbol{\beta}}^{\ast} \right) = \frac{1}{n} \boldsymbol{J} \hat{\boldsymbol{\Gamma}} \boldsymbol{J}^{\prime}, \quad \boldsymbol{J} = \frac{\partial \boldsymbol{\beta}^{\ast}}{\partial \operatorname{vech} \left( \boldsymbol{\Sigma} \right)^{\prime}},

where J\boldsymbol{J} is evaluated at the sample covariance matrix S\boldsymbol{S}, and Γ^\hat{\boldsymbol{\Gamma}} (gamma) estimates the asymptotic covariance matrix of nvech⁡(S)\sqrt{n} \operatorname{vech} \left( \boldsymbol{S} \right). With type = "mvn",

Γ^=2D+(S⊗S)D+′,\hat{\boldsymbol{\Gamma}} = 2 \boldsymbol{D}^{+} \left( \boldsymbol{S} \otimes \boldsymbol{S} \right) \boldsymbol{D}^{+ \prime},

where D+\boldsymbol{D}^{+} is the Moore-Penrose inverse of the duplication matrix. With type = "adf", Γ^\hat{\boldsymbol{\Gamma}} is the unbiased asymptotic distribution-free estimator

Γ^=n(n−1)(n−2)(n−3)Γ^ADF−n(n−2)(n−3)(Γ^N−2n−1vech⁡(S~)vech⁡(S~)′),\hat{\boldsymbol{\Gamma}} = \frac{n \left( n - 1 \right)}{\left( n - 2 \right) \left( n - 3 \right)} \hat{\boldsymbol{\Gamma}}_{\mathrm{ADF}} - \frac{n}{\left( n - 2 \right) \left( n - 3 \right)} \left( \hat{\boldsymbol{\Gamma}}_{\mathrm{N}} - \frac{2}{n - 1} \operatorname{vech} \left( \tilde{\boldsymbol{S}} \right) \operatorname{vech} \left( \tilde{\boldsymbol{S}} \right)^{\prime} \right),

where S~\tilde{\boldsymbol{S}} is the covariance matrix with divisor nn, Γ^N\hat{\boldsymbol{\Gamma}}_{\mathrm{N}} is the normal-theory matrix at S~\tilde{\boldsymbol{S}}, and

Γ^ADF=1n∑i=1n[vech⁡(didi′)−vech⁡(S~)][vech⁡(didi′)−vech⁡(S~)]′,\hat{\boldsymbol{\Gamma}}_{\mathrm{ADF}} = \frac{1}{n} \sum_{i = 1}^{n} \left[ \operatorname{vech} \left( \boldsymbol{d}_{i} \boldsymbol{d}_{i}^{\prime} \right) - \operatorname{vech} \left( \tilde{\boldsymbol{S}} \right) \right] \left[ \operatorname{vech} \left( \boldsymbol{d}_{i} \boldsymbol{d}_{i}^{\prime} \right) - \operatorname{vech} \left( \tilde{\boldsymbol{S}} \right) \right]^{\prime},

with di\boldsymbol{d}_{i} the deviation of observation ii from the sample means (Jones & Waller, 2015; Yuan & Chan, 2011). The confidence intervals are β^j∗±t1−α/2,n−kse⁡^(β^j∗)\hat{\beta}^{\ast}_{j} \pm t_{1 - \alpha / 2, n - k} \widehat{\operatorname{se}} \left( \hat{\beta}^{\ast}_{j} \right), where kk is the number of regression parameters, including the intercept.

Value

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

call

Function call.

args

Function arguments.

lm_process

Processed lm object.

gamma

Asymptotic covariance matrix of the sample covariance matrix.

acov

Asymptotic covariance matrix of the standardized slopes.

vcov

Sampling covariance matrix of the standardized slopes.

est

Vector of standardized slopes.

Author(s)

Ivan Jacob Agaloos Pesigan

References

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

See Also

Other Beta Delta Method Functions: DeltaRSqDelta(), DiffBetaDelta(), FSqDelta(), PCorDelta(), RSqDelta(), SCorDelta(), SCorSqDelta()

Examples

# 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

Description

Standardized Regression Slopes

Usage

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

Arguments

object

Object of class betadelta.

...

additional arguments.

Value

Returns a vector of standardized regression slopes.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

# 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

Description

Estimates

Usage

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

Arguments

object

Object of class deltamethod.

...

additional arguments.

Value

Returns a vector of estimates.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

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)

Estimates for an Object of Class esdelta

Description

Estimates for an Object of Class esdelta

Usage

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

Arguments

object

Object of class esdelta.

...

additional arguments.

Value

Returns a vector of estimates.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

# 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

Description

Confidence Intervals for Standardized Regression Slopes

Usage

## S3 method for class 'betadelta'
confint(object, parm = NULL, level = 0.95, ...)

Arguments

object

Object of class betadelta.

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.

Details

The confidence intervals are θ^±t1−α/2,n−kse⁡^(θ^)\hat{\theta} \pm t_{1 - \alpha / 2, n - k} \widehat{\operatorname{se}} \left( \hat{\theta} \right), where se⁡^\widehat{\operatorname{se}} is the square root of the diagonal of the delta-method sampling covariance matrix (see BetaDelta()), nn is the sample size, and kk is the number of regression parameters, including the intercept. The test statistic is θ^/se⁡^(θ^)\hat{\theta} / \widehat{\operatorname{se}} \left( \hat{\theta} \right) with n−kn - k degrees of freedom.

Value

Returns a matrix of confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

# 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

Description

Confidence Intervals

Usage

## S3 method for class 'deltamethod'
confint(object, parm = NULL, level = 0.95, ...)

Arguments

object

Object of class deltamethod.

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.

Value

Returns a matrix of confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

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)

Confidence Intervals for an Object of Class esdelta

Description

Confidence Intervals for an Object of Class esdelta

Usage

## S3 method for class 'esdelta'
confint(object, parm = NULL, level = 0.95, ...)

Arguments

object

Object of class esdelta.

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.

Details

The confidence intervals are θ^±z1−α/2se⁡^(θ^)\hat{\theta} \pm z_{1 - \alpha / 2} \widehat{\operatorname{se}} \left( \hat{\theta} \right), where se⁡^\widehat{\operatorname{se}} is the square root of the diagonal of the delta-method sampling covariance matrix of the effect size, and zpz_{p} is the pp quantile of the standard normal distribution. The test statistic is z=θ^/se⁡^(θ^)z = \hat{\theta} / \widehat{\operatorname{se}} \left( \hat{\theta} \right).

Value

Returns a matrix of confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

# 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)

Delta Method

Description

Calculates delta method sampling variance-covariance matrix for a function of parameters using a numerical Jacobian.

Usage

Delta(
  coef,
  vcov,
  func,
  ...,
  theta = 0,
  alpha = c(0.05, 0.01, 0.001),
  z = TRUE,
  df = NULL
)

Arguments

coef

Numeric vector. Vector of parameters.

vcov

Numeric matrix. Matrix of sampling variance-covariance matrix of parameters.

func

R function.

  1. The first argument x is the argument coef.

  2. The function algebraically manipulates coef to return a new numeric vector. It is best to have a named vector as an output.

  3. The function can take additional named arguments passed using ....

...

Additional arguments to pass to func.

theta

Numeric vector. Parameter values when the null hypothesis is true.

alpha

Numeric vector. Significance level/s.

z

Logical. If z = TRUE, use the standard normal distribution. If z = FALSE, use the t distribution.

df

Numeric. Degrees of freedom if z = FALSE.

Value

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

call

Function call.

args

Function arguments.

est

Estimates.

vcov

Sampling variance-covariance matrix.

jacobian

Jacobian matrix.

fun

Function used ("Delta").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other Delta Method Functions: DeltaGeneric()

Examples

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
)

Delta Method (Generic Object Input)

Description

Calculates delta method sampling variance-covariance matrix for a function of parameters using a numerical Jacobian.

Usage

DeltaGeneric(
  object,
  def,
  theta = 0,
  alpha = c(0.05, 0.01, 0.001),
  z = TRUE,
  df = NULL
)

Arguments

object

R object. Fitted model object with coef and vcov methods that return a named vector of estimated parameters and sampling variance-covariance matrix, respectively.

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 z = TRUE, use the standard normal distribution. If z = FALSE, use the t distribution.

df

Numeric. Degrees of freedom if z = FALSE.

Value

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

call

Function call.

args

Function arguments.

est

Estimates.

vcov

Sampling variance-covariance matrix.

jacobian

Jacobian matrix.

fun

Function used ("DeltaGeneric").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other Delta Method Functions: Delta()

Examples

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

Description

Estimate Improvement in R-Squared and the Corresponding Sampling Covariance Matrix

Usage

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

Arguments

object

Object of class betadelta, that is, the output of the BetaDelta() function.

alpha

Numeric vector. Significance level α\alpha.

Details

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 β∗\boldsymbol{\beta}^{\ast} be the vector of standardized slopes, Rx\boldsymbol{R}_{x} the correlation matrix of the regressors, rjjr^{jj} the jjth diagonal element of Rx−1\boldsymbol{R}_{x}^{-1}, and R2=β∗′Rxβ∗R^{2} = \boldsymbol{\beta}^{\ast\prime} \boldsymbol{R}_{x} \boldsymbol{\beta}^{\ast}. The semipartial correlation of regressor jj is

srj=βj∗/rjj=βj∗1−Rj⋅−j2,sr_{j} = \beta^{\ast}_{j} / \sqrt{r^{jj}} = \beta^{\ast}_{j} \sqrt{1 - R^{2}_{j \cdot -j}},

where Rj⋅−j2R^{2}_{j \cdot -j} is the R-squared from regressing regressor jj on the other regressors. Its square, srj2sr^{2}_{j}, is the change in R2R^{2} when regressor jj is added last. Because 1/rjj=1−Rj⋅−j21 / r^{jj} = 1 - R^{2}_{j \cdot -j}, srjsr_{j} shrinks toward zero as regressor jj becomes more redundant with the other regressors. The improvement in R-squared for regressor jj is

ΔRj2=R2−R−j2=srj2.\Delta R^{2}_{j} = R^{2} - R^{2}_{-j} = sr^{2}_{j}.

For an effect size g(θ∗)g\left( \boldsymbol{\theta}^{\ast} \right) that is a function of the standardized parameters, the sampling variance is approximated by the delta method,

var⁡^(g^)=Jg Σ^θ∗ Jg′,\widehat{\operatorname{var}} \left( \hat{g} \right) = \boldsymbol{J}_{g} \, \widehat{\boldsymbol{\Sigma}}_{\boldsymbol{\theta}^{\ast}} \, \boldsymbol{J}_{g}^{\prime},

where Jg\boldsymbol{J}_{g} is the Jacobian of gg and Σ^θ∗\widehat{\boldsymbol{\Sigma}}_{\boldsymbol{\theta}^{\ast}} is the sampling covariance matrix stored in object (BetaDelta()).

Value

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

call

Function call.

fit

The argument object.

args

Function arguments.

vcov

Sampling covariance matrix of improvement in R-squared (squared semipartial correlation coefficients).

est

Vector of improvement in R-squared (squared semipartial correlation coefficients).

fun

Function used ("DeltaRSqDelta").

Author(s)

Ivan Jacob Agaloos Pesigan

References

Algina, J., Keselman, H. J., & Penfield, R. D. (2007). Confidence intervals for an effect size measure in multiple linear regression. Educational and Psychological Measurement, 67(2), 207–218. doi:10.1177/0013164406292030

Algina, J., Keselman, H. J., & Penfield, R. D. (2008a). Confidence intervals for the squared multiple semipartial correlation coefficient. Journal of Modern Applied Statistical Methods, 7(1), 2–10. doi:10.22237/jmasm/1209614460

Algina, J., Keselman, H. J., & Penfield, R. D. (2008b). Note on a confidence interval for the squared semipartial correlation coefficient. Educational and Psychological Measurement, 68(5), 734–741. doi:10.1177/0013164407313371

Algina, J., Keselman, H. J., & Penfield, R. D. (2010). Confidence intervals for squared semipartial correlation coefficients: The effect of nonnormality. Educational and Psychological Measurement, 70(6), 926–940. doi:10.1177/0013164410379335

See Also

Other Beta Delta Method Functions: BetaDelta(), DiffBetaDelta(), FSqDelta(), PCorDelta(), RSqDelta(), SCorDelta(), SCorSqDelta()

Examples

# 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

Description

Estimate Differences of Standardized Regression Coefficients and the Corresponding Sampling Covariance Matrix

Usage

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

Arguments

object

Object of class betadelta, that is, the output of the BetaDelta() function.

alpha

Numeric vector. Significance level α\alpha.

Details

For every pair of regressors j<lj < l, the difference of the standardized regression slopes (see BetaDelta()) is

Δβjl∗=βj∗−βl∗.\Delta \beta^{\ast}_{jl} = \beta^{\ast}_{j} - \beta^{\ast}_{l}.

Collect the differences as Cβ∗\boldsymbol{C} \boldsymbol{\beta}^{\ast}, where each row of C\boldsymbol{C} has 11 in column jj, −1-1 in column ll, and zeros elsewhere. The sampling covariance matrix is

var⁡^(Cβ^∗)=Cvar⁡^(β^∗)C′,\widehat{\operatorname{var}} \left( \boldsymbol{C} \hat{\boldsymbol{\beta}}^{\ast} \right) = \boldsymbol{C} \widehat{\operatorname{var}} \left( \hat{\boldsymbol{\beta}}^{\ast} \right) \boldsymbol{C}^{\prime},

and the confidence intervals are Δβ^jl∗±z1−α/2se⁡^(Δβ^jl∗)\Delta \hat{\beta}^{\ast}_{jl} \pm z_{1 - \alpha / 2} \widehat{\operatorname{se}} \left( \Delta \hat{\beta}^{\ast}_{jl} \right). The slopes must be fully standardized (std_y = TRUE and std_x = NULL in BetaDelta()).

Value

Returns an object of class esdelta (and diffbetadelta) which is a list with the following elements:

call

Function call.

fit

The argument object.

args

Function arguments.

vcov

Sampling covariance matrix of differences of standardized slopes.

est

Vector of differences of standardized slopes.

fun

Function used ("DiffBetaDelta").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other Beta Delta Method Functions: BetaDelta(), DeltaRSqDelta(), FSqDelta(), PCorDelta(), RSqDelta(), SCorDelta(), SCorSqDelta()

Examples

# 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

Description

Estimate Cohen's f-Squared and Local f-Squared and the Corresponding Sampling Covariance Matrix

Usage

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

Arguments

object

Object of class betadelta, that is, the output of the BetaDelta() function.

alpha

Numeric vector. Significance level α\alpha.

Details

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 β∗\boldsymbol{\beta}^{\ast} be the vector of standardized slopes, Rx\boldsymbol{R}_{x} the correlation matrix of the regressors, rjjr^{jj} the jjth diagonal element of Rx−1\boldsymbol{R}_{x}^{-1}, and R2=β∗′Rxβ∗R^{2} = \boldsymbol{\beta}^{\ast\prime} \boldsymbol{R}_{x} \boldsymbol{\beta}^{\ast}. The semipartial correlation of regressor jj is

srj=βj∗/rjj=βj∗1−Rj⋅−j2,sr_{j} = \beta^{\ast}_{j} / \sqrt{r^{jj}} = \beta^{\ast}_{j} \sqrt{1 - R^{2}_{j \cdot -j}},

where Rj⋅−j2R^{2}_{j \cdot -j} is the R-squared from regressing regressor jj on the other regressors. Its square, srj2sr^{2}_{j}, is the change in R2R^{2} when regressor jj is added last. Because 1/rjj=1−Rj⋅−j21 / r^{jj} = 1 - R^{2}_{j \cdot -j}, srjsr_{j} shrinks toward zero as regressor jj becomes more redundant with the other regressors. Cohen's f-squared and the local f-squared of regressor jj are

f2=R21−R2,fj2=srj21−R2.f^{2} = \frac{R^{2}}{1 - R^{2}}, \quad f^{2}_{j} = \frac{sr^{2}_{j}}{1 - R^{2}}.

By convention (Cohen, 1988), values of about 0.02, 0.15, and 0.35 are small, medium, and large effects. For an effect size g(θ∗)g\left( \boldsymbol{\theta}^{\ast} \right) that is a function of the standardized parameters, the sampling variance is approximated by the delta method,

var⁡^(g^)=Jg Σ^θ∗ Jg′,\widehat{\operatorname{var}} \left( \hat{g} \right) = \boldsymbol{J}_{g} \, \widehat{\boldsymbol{\Sigma}}_{\boldsymbol{\theta}^{\ast}} \, \boldsymbol{J}_{g}^{\prime},

where Jg\boldsymbol{J}_{g} is the Jacobian of gg and Σ^θ∗\widehat{\boldsymbol{\Sigma}}_{\boldsymbol{\theta}^{\ast}} is the sampling covariance matrix stored in object (BetaDelta()).

Value

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

call

Function call.

fit

The argument object.

args

Function arguments.

vcov

Sampling covariance matrix of Cohen's f-squared (fsq) and the local f-squared of each regressor.

est

Vector of Cohen's f-squared (fsq) and the local f-squared of each regressor.

fun

Function used ("FSqDelta").

Author(s)

Ivan Jacob Agaloos Pesigan

References

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

See Also

Other Beta Delta Method Functions: BetaDelta(), DeltaRSqDelta(), DiffBetaDelta(), PCorDelta(), RSqDelta(), SCorDelta(), SCorSqDelta()

Examples

# 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

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.


Estimate Squared Partial Correlation Coefficients and the Corresponding Sampling Covariance Matrix

Description

Estimate Squared Partial Correlation Coefficients and the Corresponding Sampling Covariance Matrix

Usage

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

Arguments

object

Object of class betadelta, that is, the output of the BetaDelta() function.

alpha

Numeric vector. Significance level α\alpha.

Details

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 β∗\boldsymbol{\beta}^{\ast} be the vector of standardized slopes, Rx\boldsymbol{R}_{x} the correlation matrix of the regressors, rjjr^{jj} the jjth diagonal element of Rx−1\boldsymbol{R}_{x}^{-1}, and R2=β∗′Rxβ∗R^{2} = \boldsymbol{\beta}^{\ast\prime} \boldsymbol{R}_{x} \boldsymbol{\beta}^{\ast}. The semipartial correlation of regressor jj is

srj=βj∗/rjj=βj∗1−Rj⋅−j2,sr_{j} = \beta^{\ast}_{j} / \sqrt{r^{jj}} = \beta^{\ast}_{j} \sqrt{1 - R^{2}_{j \cdot -j}},

where Rj⋅−j2R^{2}_{j \cdot -j} is the R-squared from regressing regressor jj on the other regressors. Its square, srj2sr^{2}_{j}, is the change in R2R^{2} when regressor jj is added last. Because 1/rjj=1−Rj⋅−j21 / r^{jj} = 1 - R^{2}_{j \cdot -j}, srjsr_{j} shrinks toward zero as regressor jj becomes more redundant with the other regressors. The squared partial correlation is

prj2=srj21−R2+srj2,pr^{2}_{j} = \frac{sr^{2}_{j}}{1 - R^{2} + sr^{2}_{j}},

the proportion of the variance in the outcome not explained by the other regressors that is explained by regressor jj. For an effect size g(θ∗)g\left( \boldsymbol{\theta}^{\ast} \right) that is a function of the standardized parameters, the sampling variance is approximated by the delta method,

var⁡^(g^)=Jg Σ^θ∗ Jg′,\widehat{\operatorname{var}} \left( \hat{g} \right) = \boldsymbol{J}_{g} \, \widehat{\boldsymbol{\Sigma}}_{\boldsymbol{\theta}^{\ast}} \, \boldsymbol{J}_{g}^{\prime},

where Jg\boldsymbol{J}_{g} is the Jacobian of gg and Σ^θ∗\widehat{\boldsymbol{\Sigma}}_{\boldsymbol{\theta}^{\ast}} is the sampling covariance matrix stored in object (BetaDelta()).

Value

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

call

Function call.

fit

The argument object.

args

Function arguments.

vcov

Sampling covariance matrix of squared partial correlation coefficients.

est

Vector of squared partial correlation coefficients.

fun

Function used ("PCorDelta").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other Beta Delta Method Functions: BetaDelta(), DeltaRSqDelta(), DiffBetaDelta(), FSqDelta(), RSqDelta(), SCorDelta(), SCorSqDelta()

Examples

# 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)

Print Method for an Object of Class betadelta

Description

Print Method for an Object of Class betadelta

Usage

## S3 method for class 'betadelta'
print(x, alpha = NULL, digits = 4, ...)

Arguments

x

Object of class betadelta.

alpha

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

digits

Digits to print.

...

additional arguments.

Value

Prints a matrix of standardized regression slopes, standard errors, test statistics, degrees of freedom, p-values, and confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

# 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)

Print Method for an Object of Class deltamethod

Description

Print Method for an Object of Class deltamethod

Usage

## S3 method for class 'deltamethod'
print(x, alpha = NULL, digits = 4, ...)

Arguments

x

Object of class deltamethod.

alpha

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

digits

Digits to print.

...

additional arguments.

Value

Returns a matrix of coefficients, standard errors, test statistics, degrees of freedom (if z = FALSE), p-values, and confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

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)

Print Method for an Object of Class esdelta

Description

Print Method for an Object of Class esdelta

Usage

## S3 method for class 'esdelta'
print(x, alpha = NULL, digits = 4, ...)

Arguments

x

Object of class esdelta.

alpha

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

digits

Digits to print.

...

additional arguments.

Value

Prints a matrix of estimates, standard errors, test statistics, p-values, and confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

# 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)

Print Method for an Object of Class summary.esdelta

Description

Print Method for an Object of Class summary.esdelta

Usage

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

Arguments

x

Object of class summary.esdelta.

...

additional arguments.

Value

Prints a matrix of estimates, standard errors, test statistics, p-values, and confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

# 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

Description

Estimate R-Squared and Adjusted R-Squared and the Corresponding Sampling Covariance Matrix

Usage

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

Arguments

object

Object of class betadelta, that is, the output of the BetaDelta() function.

alpha

Numeric vector. Significance level α\alpha.

Details

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 β∗\boldsymbol{\beta}^{\ast} be the vector of standardized slopes, Rx\boldsymbol{R}_{x} the correlation matrix of the regressors, rjjr^{jj} the jjth diagonal element of Rx−1\boldsymbol{R}_{x}^{-1}, and R2=β∗′Rxβ∗R^{2} = \boldsymbol{\beta}^{\ast\prime} \boldsymbol{R}_{x} \boldsymbol{\beta}^{\ast}. The R-squared and the adjusted R-squared are

R2=β∗′Rxβ∗,Rˉ2=1−(1−R2)n−1n−k,R^{2} = \boldsymbol{\beta}^{\ast\prime} \boldsymbol{R}_{x} \boldsymbol{\beta}^{\ast}, \quad \bar{R}^{2} = 1 - \left( 1 - R^{2} \right) \frac{n - 1}{n - k},

where nn is the sample size and kk is the number of parameters in the regression model, including the intercept. For an effect size g(θ∗)g\left( \boldsymbol{\theta}^{\ast} \right) that is a function of the standardized parameters, the sampling variance is approximated by the delta method,

var⁡^(g^)=Jg Σ^θ∗ Jg′,\widehat{\operatorname{var}} \left( \hat{g} \right) = \boldsymbol{J}_{g} \, \widehat{\boldsymbol{\Sigma}}_{\boldsymbol{\theta}^{\ast}} \, \boldsymbol{J}_{g}^{\prime},

where Jg\boldsymbol{J}_{g} is the Jacobian of gg and Σ^θ∗\widehat{\boldsymbol{\Sigma}}_{\boldsymbol{\theta}^{\ast}} is the sampling covariance matrix stored in object (BetaDelta()).

Value

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

call

Function call.

fit

The argument object.

args

Function arguments.

vcov

Sampling covariance matrix of R-squared and adjusted R-squared.

est

Vector of R-squared and adjusted R-squared.

fun

Function used ("RSqDelta").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other Beta Delta Method Functions: BetaDelta(), DeltaRSqDelta(), DiffBetaDelta(), FSqDelta(), PCorDelta(), SCorDelta(), SCorSqDelta()

Examples

# 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

Description

Estimate Semipartial Correlation Coefficients and the Corresponding Sampling Covariance Matrix

Usage

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

Arguments

object

Object of class betadelta, that is, the output of the BetaDelta() function.

alpha

Numeric vector. Significance level α\alpha.

Details

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 β∗\boldsymbol{\beta}^{\ast} be the vector of standardized slopes, Rx\boldsymbol{R}_{x} the correlation matrix of the regressors, rjjr^{jj} the jjth diagonal element of Rx−1\boldsymbol{R}_{x}^{-1}, and R2=β∗′Rxβ∗R^{2} = \boldsymbol{\beta}^{\ast\prime} \boldsymbol{R}_{x} \boldsymbol{\beta}^{\ast}. The semipartial correlation of regressor jj is

srj=βj∗/rjj=βj∗1−Rj⋅−j2,sr_{j} = \beta^{\ast}_{j} / \sqrt{r^{jj}} = \beta^{\ast}_{j} \sqrt{1 - R^{2}_{j \cdot -j}},

where Rj⋅−j2R^{2}_{j \cdot -j} is the R-squared from regressing regressor jj on the other regressors. Its square, srj2sr^{2}_{j}, is the change in R2R^{2} when regressor jj is added last. Because 1/rjj=1−Rj⋅−j21 / r^{jj} = 1 - R^{2}_{j \cdot -j}, srjsr_{j} shrinks toward zero as regressor jj becomes more redundant with the other regressors. The sign of srjsr_{j} follows the sign of βj∗\beta^{\ast}_{j}. For an effect size g(θ∗)g\left( \boldsymbol{\theta}^{\ast} \right) that is a function of the standardized parameters, the sampling variance is approximated by the delta method,

var⁡^(g^)=Jg Σ^θ∗ Jg′,\widehat{\operatorname{var}} \left( \hat{g} \right) = \boldsymbol{J}_{g} \, \widehat{\boldsymbol{\Sigma}}_{\boldsymbol{\theta}^{\ast}} \, \boldsymbol{J}_{g}^{\prime},

where Jg\boldsymbol{J}_{g} is the Jacobian of gg and Σ^θ∗\widehat{\boldsymbol{\Sigma}}_{\boldsymbol{\theta}^{\ast}} is the sampling covariance matrix stored in object (BetaDelta()).

Value

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

call

Function call.

fit

The argument object.

args

Function arguments.

vcov

Sampling covariance matrix of semipartial correlation coefficients.

est

Vector of semipartial correlation coefficients.

fun

Function used ("SCorDelta").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other Beta Delta Method Functions: BetaDelta(), DeltaRSqDelta(), DiffBetaDelta(), FSqDelta(), PCorDelta(), RSqDelta(), SCorSqDelta()

Examples

# 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)

Estimate Squared Semipartial Correlation Coefficients and the Corresponding Confidence Intervals From the Signed Intervals

Description

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.

Usage

SCorSqDelta(object, level = 0.95)

Arguments

object

Context accepted by SCorDelta().

level

Single confidence level in (0, 1).

Details

The semipartial correlation srjsr_{j} (see SCorDelta()) is signed, and its confidence interval [l,u]\left[ l, u \right] may contain zero. The interval for srj2sr^{2}_{j} is the image of that interval under squaring. The squared interval is [l2,u2]\left[ l^{2}, u^{2} \right] if 0<l0 < l, [u2,l2]\left[ u^{2}, l^{2} \right] if u<0u < 0, and [0,max⁡(l2,u2)]\left[ 0, \max \left( l^{2}, u^{2} \right) \right] 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.

Value

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.

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other Beta Delta Method Functions: BetaDelta(), DeltaRSqDelta(), DiffBetaDelta(), FSqDelta(), PCorDelta(), RSqDelta(), SCorDelta()

Examples

# 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)

Summary Method for an Object of Class betadelta

Description

Summary Method for an Object of Class betadelta

Usage

## S3 method for class 'betadelta'
summary(object, alpha = NULL, digits = 4, ...)

Arguments

object

Object of class betadelta.

alpha

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

digits

Digits to print.

...

additional arguments.

Details

The confidence intervals are θ^±t1−α/2,n−kse⁡^(θ^)\hat{\theta} \pm t_{1 - \alpha / 2, n - k} \widehat{\operatorname{se}} \left( \hat{\theta} \right), where se⁡^\widehat{\operatorname{se}} is the square root of the diagonal of the delta-method sampling covariance matrix (see BetaDelta()), nn is the sample size, and kk is the number of regression parameters, including the intercept. The test statistic is θ^/se⁡^(θ^)\hat{\theta} / \widehat{\operatorname{se}} \left( \hat{\theta} \right) with n−kn - k degrees of freedom.

Value

Returns a matrix of standardized regression slopes, standard errors, test statistics, degrees of freedom, p-values, and confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

# 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)

Summary Method for an Object of Class deltamethod

Description

Summary Method for an Object of Class deltamethod

Usage

## S3 method for class 'deltamethod'
summary(object, alpha = NULL, digits = 4, ...)

Arguments

object

Object of class deltamethod.

alpha

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

digits

Digits to print.

...

additional arguments.

Value

Returns a matrix of estimates, standard errors, test statistics, degrees of freedom (if z = FALSE), p-values, and confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

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)

Summary Method for an Object of Class esdelta

Description

Summary Method for an Object of Class esdelta

Usage

## S3 method for class 'esdelta'
summary(object, alpha = NULL, digits = 4, ...)

Arguments

object

Object of class esdelta.

alpha

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

digits

Digits to print.

...

additional arguments.

Details

The confidence intervals are θ^±z1−α/2se⁡^(θ^)\hat{\theta} \pm z_{1 - \alpha / 2} \widehat{\operatorname{se}} \left( \hat{\theta} \right), where se⁡^\widehat{\operatorname{se}} is the square root of the diagonal of the delta-method sampling covariance matrix of the effect size, and zpz_{p} is the pp quantile of the standard normal distribution. The test statistic is z=θ^/se⁡^(θ^)z = \hat{\theta} / \widehat{\operatorname{se}} \left( \hat{\theta} \right).

Value

Returns a matrix of estimates, standard errors, test statistics, p-values, and confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

# 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

Description

Sampling Covariance Matrix of the Standardized Regression Slopes

Usage

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

Arguments

object

Object of class betadelta.

...

additional arguments.

Value

Returns a matrix of the variance-covariance matrix of standardized slopes.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

# 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

Description

Sampling Covariance Matrix

Usage

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

Arguments

object

Object of class deltamethod.

...

additional arguments.

Value

Returns a matrix of the variance-covariance matrix.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

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)

Sampling Covariance Matrix for an Object of Class esdelta

Description

Sampling Covariance Matrix for an Object of Class esdelta

Usage

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

Arguments

object

Object of class esdelta.

...

additional arguments.

Value

Returns a matrix of the variance-covariance matrix of the estimates.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

# 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)