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.
matdiag(datap, resp, verbose = FALSE)Returns a list with three objects
a data frame of direct effects
a matrix of direct and indirect effects
a constant of residuals
The data set
The response variable
If verbose = TRUE then some results are printed
Ali Arminian abeyran@gmail.com
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:
P_i = _i_X_i_Y
The path equations are as follows:
One dependent variable: P_1 + P_2r_12 + P_3r_13 + ... + P_nr_1n = rY_1 P_1r_21 + P_2 + P_3r_23 + ... + P_nr_2n = rY_2 ... P_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):
Y = _0 + _1Z_1 + ... + _rZ_r +
where the multivariate multiple linear regression model is as follows: Y_1 = _0 + _1Z_11 + _2Z12 + ... + _rZ_1r + _1 Y_2 = _0 + _1Z_21 + _2Z22 + ... + _rZ_2r + _2 ... Y_n = _0 + _1Z_n1 + _2Zn2 + ... + _rZ_nr + _n
As stated by Bondari (1990), for two dependent variables Y_1 and Y_2: Y_1 = p_1X_1 + p_2X_2 + p_3X_3 + ... + p_nX_n Y_2 = p'_1X_1 + p'_2X_2 + p'_3X_3 + ... + p'_nX_n ...
where:
r_Y_1Y_2 = p_1p'_1 + p_2p'_2 + p_3p'_3 + ... + p_np'_n + _i=jp_ip'_1r_ij = _i,jp_ip'_ir_ij
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.
correlation, multiple linear regression,
and matrix notations in mathematics.
lavaan and diagrammeR packages for
drawing path diagrams
# \donttest{
data(dtsimp)
matdiag(dtsimp, 1, verbose = FALSE)
data(dtraw)
matdiag(dtraw[, -1], 1, verbose = FALSE)
data(heart)
matdiag(heart, 2, verbose = FALSE)
# }
Run the code above in your browser using DataLab