[R-sig-ME] Questions about porting pedigreemm to the new lme4

Joehanes, Roby (NIH/NHLBI) [F] roby.joehanes at nih.gov
Tue Apr 3 21:04:54 CEST 2012


Hi all:

Attached please find the patch to pedigreemm toward using the new lme4 (with the patch I submitted earlier). However, the patch does NOT work with the following error:
Error in function (value)  : Field "Zt" is read-only

I believe the error is thrown at this statement:
lmf$rho$pp$Zt <- relfac[[i]] %*% Zt

I have no idea how to proceed. Any help is appreciated.

Thank you,
Roby

On Apr 3, 2012, at 1:53 PM, Joehanes, Roby (NIH/NHLBI) [F] wrote:

Hi all:

I have created a patch for the latest lmer.R to accommodate calls by pedigreemm. I see that there is potentially a way to create a single "finalize" method instead of one for each lmer, glmer, and nlmer. I assume that nAGQ is 0 for lmer, correct? Or is it possible for glmer or nlmer to specify nAGQ=0?

Perhaps I should submit the patch into the patch database to see whether it is accepted or not. If it is accepted, then I can make the changes to pedigreemm accordingly.

Thank you,
Roby


On Apr 2, 2012, at 6:19 PM, Joehanes, Roby (NIH/NHLBI) [F] wrote:

Hi all:

Just a follow up: It seems that some changes need to be made in the new lme4 so that the pedigreemm can be modified to use it. They are:
1. To allow the return of all necessary internal variables required for invoking the optimizer (especially rho plus devfun in one call), without invoking the optimizer itself. Right now I did two calls, the first to get the devfun, the second to get the rest. However, I cannot obtain rho in all cases.
#lmerc$doFit <- FALSE # call lmer without pedigree and with doFit = FALSE
l... <- list(...)
lmerc$devFunOnly <- TRUE
devFun <- eval(lmerc, parent.frame())
lmerc$devFunOnly <- FALSE
lmf <- eval(lmerc, parent.frame())

2. Some partitioning of Zt that allows duplicate level names for multiple random factors. That is, if random factors 1 and 2 (let's call them RF1 and RF2) share the same level-string, my current hack will not work. Perhaps someone can propose a better way. My current hack is as follows:
Zt <- getME(lmf, "Zt")
Zt <- Zt[rownames(Zt) %in% levels(getME(lmf, "flist")[[tn]]), ]
(The original was: Zt <- lmf$FL$trms[[tn]]$Zt)

Since I cannot get rho, I cannot realize the lmer_finalize or glmer_finalize. Any help is appreciated. I am stuck right now since I have installed the lme4 SVN version, but the pedigreemm package still assumes the CRAN version.

Thank you,
Roby

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pedigreemm-patch-svnlme4-v1-notworking.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20120403/a0322610/attachment-0002.txt>


More information about the R-sig-mixed-models mailing list