Varibility analysis in R - III: Genotypic path analysis
The blog is third and last part of a series of three blogs related to variability analysis using R software. The blog demonstrates use of variability package available in R for carrying out genotpyic path analysis among traits in one line of code. (Reading time 9 min.)
Before heading further to read this blog it is highly recommended to go through first blog Variability analysis in R - I: Genetic parameters .Reading the first blog will give an idea about how to arrange the data in excel sheet, import the data in RStudio and install the package named variability required for the analysis.
For path analysis we need have one dependent variable (trait) and other as independent variables. We generally choose yield or yield attributing trait as a dependent variable. In our case we will use GRY as a dependent variable. Make sure the dependent variable is kept in last column of data set.
R Script for Genotypic correlation
Open a new script by clicking on New and than selecting R script or by pressing Ctrl+Shift+N.
library(variability)
library() will load the variability package
?geno.path
In variability package we have function named geno.path() to carryout genotypic path analysis. To know more about the function run the below mentioned line.
Run the below line to carry out genotypic path analysis
geno.path(vardata1[8],vardata1[3:7],vardata1$Genotypes,vardata1$Replication)
geno.path is the function for genotypic path analysis
vardata1[8] here square bracket are used for indexing. First we need to place dependent variable. GRY is our dependent variable and located on eighth column, so 8 is written in square bracket.
vardata1[3:7] here square bracket are used for indexing. In second position we need to place independent variables which are located between third to seventh column, so 3:7 is written in square bracket.
vardata1$Genotypes is used to use genotypes as an input. R will look for a column named Genotypes in vardata1 dataset
vardata1$Replication is used to use replication as an input. R will look for a column named Replication in vardata1 dataset
Output
$Effects
PH LL MRP GRW DRWR
PH 0.01767 -0.02402 -0.00270 0.42371 0.00988
LL 0.01385 -0.03063 0.00193 0.15121 0.00716
MRP -0.00394 -0.00487 0.01211 0.76361 0.00687
GRW 0.00769 -0.00476 0.00950 0.97397 0.01356
DRWR -0.01053 0.01323 -0.00501 -0.79621 -0.01659
$Residual
[,1]
[1,] 1e-04
The direct effects are on diagonal and indirect effects are on off-diagonal of the output matrix
How to check if the path analysis output is right or not?
Path analysis is basically breaking down the correlation between dependent variable and one independent variable into direct effect and indirect effects.
For example,
Genotypic correlation (PH, GRY) = Direct effect of PH + Sum of indirect effects of PH via LL, MRP, GRW and DRWR
Lets check it out
Genotypic correlation (PH, GRY) = 0.4245 (obtained from second blog of variability series)
- Direct effect of PH = 0.01767
- Indirect effect of PH via LL = -0.02402
- Indirect effect of PH via MRP = -0.00270
- Indirect effect of PH via GRW = 0.42371
- Indirect effect of PH via DRWR = 0.00988
Summation of these five values gives 0.42454 which indicates our calculation is right.
Hope you find this blog helpful
Raj Popat, Rumit Patel and Dinesh Parmar (2020). variability: Genetic Variability Analysis for Plant Breeding Research. R package version 0.1.0.https://CRAN.R-project.org/package=variability
Topics you might be interested:
Comments
Post a Comment