hello guys, I need to do a BLUP in the simplest model y = Xm + Zg + e however I have missing data in the analysis which I can´t consider as 0(zero). So I need to generate the matrix X'Z, Z'X and Z'Z step by step; I can´t use crossprod(x) #neither X'X <- t(x)%*%x
because I should skip the elements with missing data in the matrix I´ll try to be more clear, supposing a matrix x and a z dim (t(x)) = 2275 788 dim (z) = 788 1 but I have in my matrix the effect 0(zero) which is not missing, therefore I can´t just replace the missing values by 0(zero) and i can´t just remove it from the matrix because it would unbalance it A way to do it could be generate Z'X step by step e.g Z'X [1, 1] is equal the sum of the product between the elements in the first collumn of X and the first collumn of Z skipping the elements whenever there is a missing data However I can´t do this in R Does anybody know how to do it this way or an easier way to do it? -- View this message in context: http://www.nabble.com/BLUP-with-missing-data-tp25530949p25530949.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.