require(SFSI)
data(wheatHTP)
index = which(Y$trial %in% 1:6) # Use only a subset of data
Y = Y[index,]
X = scale(X_E1[index,30:50]) # Subset reflectance data
M = scale(M[index,])/sqrt(ncol(M)) # Subset and scale markers
G = tcrossprod(M) # Genomic relationship matrix
y = as.vector(scale(Y[,"E1"])) # Scale response variable
fm = getGenCov(y,X,K=G)
covU = fm$covU # Genetic covariance
covP_corrected = fm$covU+fm$covE # Phenotypic covariance
covP_uncorrected = cov(y,X) # Sample phenotypic covariance
plot(covP_corrected,covP_uncorrected)
plot(covU,covP_uncorrected)
plot(covU,covP_corrected)
Run the code above in your browser using DataLab