matdiag: Direct and Indirect Effects Matrices and Diagram

View source: R/matdiag.R

matdiagR Documentation

Direct and Indirect Effects Matrices and Diagram

Description

[Stable]

  • matdiag() extracts the direct effect and indirect effects matrices of data in path analysis along with the significance of direct effects where direct effects are shown as a vector (columnar matrix of 1*n dimensions and indirect effects are off-diagonal effects. Later, draws a diagram for path coefficient analysis based on the DiagrammeR package.

Usage

matdiag(datap, resp, verbose = FALSE)

Arguments

datap

The data set

resp

The response variable

verbose

If verbose = TRUE then some results are printed

Details

The matdiag function estimates the direct and indirect effects in path coefficient analysis as tables along with drawing the diagram of path analysis. This is apparently the only program testing the significance of direct effects in a path analysis. Note: all variables must be numeric for matrix calculations and the next plotting.

  • In a path model, path coefficients or direct effects (Pi's) indicate the direct effects of a variable on another, and are standardized partial regression coefficients (in Wright's terminology) due they are estimated from correlations or from the transformed (standardized) data as:

\loadmathjax \mjsdeqn

P_i = \beta_i\frac\sigma_X_i\sigma_Y

  • The path equations are as follows:

  • One dependent variable: \mjsdeqnP_1 + P_2r_12 + P_3r_13 + ... + P_nr_1n = rY_1 \mjsdeqnP_1r_21 + P_2 + P_3r_23 + ... + P_nr_2n = rY_2 \mjsdeqn... \mjsdeqnP_1rn_1 + P_2r_n2 + P_3r_n3 + ... + P_n = rY_n

  • Extension to more dependent variables: Path.Analysis is capable of performing this straightforward function through detailed explanations. The linear regression model with a single response in its form is as follows (Johnson and Wichern (2007): \mjseqnY = \beta_0 + \beta_1Z_1 + ... + \beta_rZ_r + \epsilon

    where the multivariate multiple linear regression model is as follows: \mjsdeqnY_1 = \beta_0 + \beta_1Z_11 + \beta_2Z12 + ... + \beta_rZ_1r + \epsilon_1 \mjsdeqnY_2 = \beta_0 + \beta_1Z_21 + \beta_2Z22 + ... + \beta_rZ_2r + \epsilon_2 \mjsdeqn... \mjsdeqnY_n = \beta_0 + \beta_1Z_n1 + \beta_2Zn2 + ... + \beta_rZ_nr + \epsilon_n

    As stated by Bondari (1990), for two dependent variables \mjseqnY_1 and \mjseqnY_2: \mjsdeqn Y_1 = p_1X_1 + p_2X_2 + p_3X_3 + ... + p_nX_n \mjsdeqn Y_2 = p'_1X_1 + p'_2X_2 + p'_3X_3 + ... + p'_nX_n \mjsdeqn ...

where: \mjsdeqn r_Y_1Y_2 = p_1p'_1 + p_2p'_2 + p_3p'_3 + ... + p_np'_n + \sigma_i=jp_ip'_1r_ij = \sigma_i,jp_ip'_ir_ij

Value

Returns a list with three objects

direff

a data frame of direct effects

matall

a matrix of direct and indirect effects

Residual

a constant of residuals

Author(s)

Ali Arminian abeyran@gmail.com

References

Arminian, A, MS Kang, M Kozak, S Houshmand, and P Mathews. 2008. “MULTPATH: A Comprehensive Minitab Program for Computing Path Coefficients and Multiple Regression for Multivariate Analyses.” Journal of Crop Improvement, 22(1): 82–120.

Bondari, K. 1990. "PATH ANALYSIS IN AGRICULTURAL RESEARCH," Conference on Applied Statistics in Agriculture. https://do i.org/10.4148/2475-7772.1439

Cramer, C.S, TC Wehner, and SB Donaghy. 1999. “PATHSAS: A SAS Computer Program for Path Coefficient Analysis of Quantitative Data.” Journal of Heredity, 90(1): 260–62. https://doi.org/10 .1093/jhered/90.1.260.

Johnson, R.A., Wichern, D.W. 2007. Applied Multivariate Statistical Analysis. Prentice Hall, USA.

Li, C.C. 1975. Path Analysis: A Primer. Boxwood Pr. 346 p.

Olivoto, T, and A Dal’Col Lúcio. 2020. “Metan: An r Package for Multi‐environment Trial Analysis.” Methods in Ecology and Evolution, 11(6): 783–89. https://doi.org/10.1111/2041-210 X.13384.

Wolfle, LM. 2003. “The Introduction of Path Analysis to the Social Sciences, and Some Emergent Themes: An Annotated Bibliography.” Structural Equation Modeling, 10(1): 1–34.

Wright, S. 1923. “The Theory of Path Coefficients a Reply to Niles’s Criticism.” Genetics, 8(3): 239.

———. 1934. “The Method of Path Coefficients.” The Annals of Mathematical Statistics, 5(3): 161–215.

———. 1960. “Path Coefficients and Path Regressions: Alternative or Complementary Concepts?” Biometrics, 16(2): 189–202.

See Also

correlation, ⁠multiple linear regression⁠, and matrix notations in mathematics.

lavaan and diagrammeR packages for drawing path diagrams

Examples


data(dtsimp)
matdiag(dtsimp, 1, verbose = FALSE)

data(dtraw)
matdiag(dtraw[, -1], 1, verbose = FALSE)

data(heart)
matdiag(heart, 2, verbose = FALSE)
 


Path.Analysis documentation built on Sept. 30, 2024, 9:25 a.m.