| path.analysis {agricolae} | R Documentation |
If the cause and effect relationship is well defined, it is possible to represent the whole system of variables in a diagram form known as path-analysis. The function calculates the direct and indirect effects and uses the variables correlation or covariance.
path.analysis(corr.x, corr.y)
corr.x |
Matrix of correlations of the independent variables |
corr.y |
vector of dependent correlations with each one of the independent ones |
It is necessary first to calculate the correlations.
corr.x |
Numeric |
corr.y |
Numeric |
Felipe de Mendiburu
Biometrical Methods in Quantitative Genetic Analysis, Singh, Chaudhary. 1979
# Path analysis. Multivarial Analysis. Anderson. Prentice Hall, pag 616
library(agricolae)
# Example 1
corr.x<- matrix(c(1,0.5,0.5,1),c(2,2))
corr.y<- rbind(0.6,0.7)
names<-c("X1","X2")
dimnames(corr.x)<-list(names,names)
dimnames(corr.y)<-list(names,"Y")
path.analysis(corr.x,corr.y)
# Example 2
# data of the progress of the disease related bacterial wilt to the ground
# for the component EC Ca K2 Cu
data(wilt)
cor.y<-correlation(wilt[,1],wilt[,-1])$correlation
cor.x<-correlation(wilt[,-1])$correlation
path.analysis(cor.x,cor.y)