JJ
2004-Oct-18 04:04 UTC
[R] manual recreation of varConstPower using new fixed effects variables in nlme
Hello, I am trying to design new variance structures by using fixed effects variables in combination with the VarPower function. That is, I would like to create and evaluate my own variance function in the data frame and then incorporate it into the model using varPower, with value=.5. As a start, I am trying to recreate the function of VarConstPower by introducing two new variables in the data frame, d1 and d2. I am using a self-made function, fx, which contains a logistic equation. It all works just fine in combination with the built-in varConstPower variance structure. I try to mimic the varConstPower structure by using the varPower variance function: varPower(form= ~vartemp, fixed= .5) and then passing the variables d1 and d2 to fx and adding a statement in fx like: vartemp <- (d1+theta^d2)^2 where theta is my covariate. However, even though the built-in varConstPower function does work with my data set, the substitute function discussed above does not work, even with d1 and d2 set to the correct values. After about five passes through the fx function I get the error message: Error in MEEM(object, conLin, control$niterEM) : Singularity in backsolve at level 0, block 1 All, fixed effect variables look correct at the time the error occurs. Can anyone tell me if there is some reason why this kind of approach would not work? It seems like it should be straightforward, but I am having no luck. I actually pass the d1 and d2 variables to the function as d1.1, d1.2, d1.3, and d2.1, d2.2, d2.3 to take into account the three grouping levels I have. The three d1's are then condensed into a single d1 column with respect to group. Same with the d2's. Thanks. John PS: Can anyone tell me what the reStruct parameter means? In looking at the verbose output, I obtain a reStruct parameter value of -0.8352462 (this is for my grouping factor for the random effect). Does anyone know what it means? The actual value of my single random effect is different, as is its variance.
Douglas Bates
2004-Oct-18 15:14 UTC
[R] manual recreation of varConstPower using new fixed effects variables in nlme
> PS: Can anyone tell me what the reStruct parameter > means? In looking at the verbose output, I obtain a > reStruct parameter value of -0.8352462 (this is for my > grouping factor for the random effect). Does anyone > know what it means? The actual value of my single > random effect is different, as is its variance.IIRC it is the logarithm of the relative precision of the random effects.
JJ
2004-Oct-18 19:21 UTC
[R] manual recreation of varConstPower using new fixed effects variables in nlme
Thanks much, Dr. Bates. That helps. Would you have any comment on the other part of my other question regarding the manual recreation of varConstPower function using new fixed effects? Im guessing I obtain a singularity error because the additional fixed effects may not alter the return value of my function, fx. The goal of attempting new variance equations is to obtain in the end a variance function that is of the form: (d1 + (covariant)^d2)^2 + U, where U is a random effect. Thanks again. John --- Douglas Bates <bates at stat.wisc.edu> wrote:> > PS: Can anyone tell me what the reStruct > parameter > > means? In looking at the verbose output, I obtain > a > > reStruct parameter value of -0.8352462 (this is > for my > > grouping factor for the random effect). Does > anyone > > know what it means? The actual value of my single > > random effect is different, as is its variance. > > IIRC it is the logarithm of the relative precision > of the random effects. > > >
JJ
2004-Oct-19 03:25 UTC
[R] manual recreation of varConstPower using new fixed effects variables in nlme
Ah, I think Ive found a solution. A variance function of the form: (d1 + (covariant)^d2)^2 + U, can be made by altering the line in varWeights.varComb to read: apply(as.data.frame(lapply(object, varWeights)), 1, sum) Then the function varComb can be used as in: varComb(varPower(form = ~cov1|g1,value=list(...)), varConstPower(form = ~g2|g2, fixedlist(power=(c(...))))) That seems to work just fine. John
Apparently Analagous Threads
- Consulta gráfica
- Proper syntax for using varConstPower in nlme
- trouble with extraction/interpretation of variance structure para meters from a model built using gnls and varConstPower
- trouble with extraction/interpretation of variance struct ure para meters from a model built using gnls and varConstPower
- Network meta-analysis, varConstPower in nlme