Extracts path coefficients for a piecewise structural equation model (SEM).
a list of regressions representing the structural equation model.
specifies the type of standardization to perform:
a vector of variables with correlated errors (separated by
whether values and significance tests for the intercept should be returned; default is
Unstandardized coefficients are extracted directly from model output. For models of class
lmerMod, denominator degrees of freedom and resulting P-values are calculated using the Kenward-Rogers approximation from the
standardize = "scale", variables are scaled by mean and variance using the function
standardize = "range", variables are scaled by subtracting the minimum and dividing by the difference of the range.
If predictors are factors or dummy variables, then they are left in their original units. If the response is not normally distributed, then it is left untransformed even when
standardize = "scale" or
standardize = "range". Predictors in these models are transformed, unless they meet the previous criteria.
Variables with correlated errors have no direct relationship but rather are hypothesized to be driven by the same underlying factor. This covariance should be reflected as correlated errors (double-headed arrow in a path diagram). Correlated errors are specified using the syntax from the
var1 ~~ var2. If two exogenous variables are listed, then the partial Pearson correlation between the two is given, otherwise the correlation between the partial residuals is returned using
partial.resid. Significance tests (i.e., P-values) for correlated errors are derived from a t-distribution using the transformation in Shipley, 2000 (p.76).
data.frame with the causal path (response, predictor), the coefficient estimate, the standard error, and associated p-value.
Caution: There is some debate over whether coefficients and significance tests for interactions containing standardized variables are valid (see Bollen 1989). This usually refers to the fact that some programs standardize the product, instead of the component variables. piecewiseSEM standardizes variables before calculating their product and thus should produce valid coefficients. The standard errors on the coefficients are still a grey area: if you are concerned at all, refer to the SEs and P-values of the /un/standardized variables.
Shipley, Bill. Cause and correlation in biology: a user's guide to path analysis, structural equations and causal inference. Cambridge University Press, 2002.
Bollen, K. A. Structural equations with latent variables. New York: John Wiley & Sons, 1989.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
# Load example data data(shipley2009) # Load model packages library(lme4) library(nlme) # Create list of models shipley2009.modlist = list( lme(DD ~ lat, random = ~1|site/tree, na.action = na.omit, data = shipley2009), lme(Date ~ DD, random = ~1|site/tree, na.action = na.omit, data = shipley2009), lme(Growth ~ Date, random = ~1|site/tree, na.action = na.omit, data = shipley2009), glmer(Live ~ Growth+(1|site)+(1|tree), family=binomial(link = "logit"), data = shipley2009) ) # Get raw path coefficients sem.coefs(shipley2009.modlist, shipley2009) # Scale by mean and variance sem.coefs(shipley2009.modlist, shipley2009, standardize = "scale") # Scale by range sem.coefs(shipley2009.modlist, shipley2009, standardize = "range")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.