coefs: Extract path coefficients

View source: R/coefs.R

coefsR Documentation

Extract path coefficients

Description

Extracts (standardized) path coefficients from a psem object.

Usage

coefs(
  modelList,
  standardize = "scale",
  standardize.type = "latent.linear",
  test.statistic = "F",
  test.type = "II",
  intercepts = FALSE
)

Arguments

modelList

A list of structural equations, or a model.

standardize

The type of standardization: none, scale, range. Default is scale.

standardize.type

The type of standardized for non-Gaussian responses: latent.linear, Menard.OE. Default is latent.linear for binomial; otherwise it is Menard.OE.

test.statistic

the type of test statistic generated by Anova

test.type

the type of test for significance of categorical variables from Anova. Default is type "II".

intercepts

Whether intercepts should be included in the coefficients table. Default is FALSE.

Details

P-values for models constructed using lme4 are obtained using the Kenward-Roger approximation of the denominator degrees of freedom as implemented in the Anova function.

Different forms of standardization can be implemented using the standardize argument:

  • none No standardized coefficients are reported.

  • scale Raw coefficients are scaled by the ratio of the standard deviation of x divided by the standard deviation of y. See below for cases pertaining to GLM.

  • range Raw coefficients are scaled by a pre-selected range of x divided by a preselected range of y. The default argument is range which takes the two extremes of the data, otherwise the user must supply must a named list where the names are the variables to be standardized, and each entry contains a vector of length == 2 to the ranges to be used in standardization.

For non-Gaussian responses, standardized coefficients are obtained in one of two ways:

  • latent.linear Referred to in Grace et al. 2019 as the standard form of the latent-theoretic (LT) approach. In this method, there is assumed to be a continuous latent propensity, y*, that underlies the observed binary responses. The standard deviation of y* is computed as the square-root of the variance of the predictions (on the linear or 'link' scale) plus the distribution-specific theoretical variance in the case of binomial responses (for logit links: pi^2/3, for probit links: 1).

  • Menard.OE Referred to in Grace et al. 2019 as the standard form of the observed-empirical (OE) approach. In this method, error variance is based on the differences between predicted scores and the observed binary data. The standard deviation used for standardization is computed as the square-root of the variance of the predictions (on the linear scale) plus the correlation between the observed and predicted (on the original or 'response' scale) values of y.

For categorical predictors: significance is determined using ANOVA (or analysis of deviance). Because n-1 coefficients are reported for n levels, the output instead reports model-estimated means in the Estimate column. This is done so all n paths in the corresponding path diagram have assignable values.

The means are generated using function emmeans in the emmeans package. Pairwise contrasts are further conducted among all levels using the default correction for multiple testing. The results of those comparisons are given in the significance codes (e.g., "a", "b", "ab") as reported in the multcomp::cld function.

For non-linear variables (i.e., smoothing functions from mgcv::gam), there are no linear estimates reported.

Value

Returns a data.frame of coefficients, their standard errors, degrees of freedom, and significance tests.

Author(s)

Jon Lefcheck <LefcheckJ@si.edu>, Jim Grace

References

Grace, J.B., Johnson, D.A., Lefcheck, J.S., and Byrnes, J.E. "Standardized Coefficients in Regression and Structural Models with Binary Outcomes." Ecosphere 9(6): e02283.

See Also

Anova, emmeans, cld

Examples

mod <- psem(
lm(rich ~ cover, data = keeley),
lm(cover ~ firesev, data = keeley),
lm(firesev ~ age, data = keeley),
data = keeley
)

coefs(mod)


piecewiseSEM documentation built on June 22, 2024, 9:53 a.m.