s-news
[Top] [All Lists]

problem when using pdBlocked and pdKron with nlme

To: "'s-news@lists.biostat.wustl.edu'" <s-news@lists.biostat.wustl.edu>
Subject: problem when using pdBlocked and pdKron with nlme
From: Gosselin Frederic <Frederic.Gosselin@nogent.cemagref.fr>
Date: Thu, 20 Feb 2003 18:14:56 +0100

Hello!

(i) I have met dimension problems when using pdKron and pdBlocked inside the nlme command. Examples of commands are provided below.

(ii) Similar commands with e.g. pdDiag work fine.

(iii) pdBlocked works well with lme.

(iv) pdKron seems to also have problems inside lme (an example is also provided).

(v) any help would be appreciated...

I thank you very much in advance ...

Frédéric Gosselin
Ingénieur-Chercheur
Cemagref
Domaine des Barres
45 290 Nogent-sur-Vernisson
FRANCE

Tel: 02-38-95-03-58 (from abroad: 33-2-38-95-03-58)
Fax: 02-38-95-03-44 (from abroad: 33-2-38-95-03-44)




(i)-a: problem with pdKron in nlme:

tempS.C.00.1_glm(formula = y ~ group.subgroup, family = poisson, data = "" & vsa1.1.SUCC.gp$cyc!="NA"& (vsa1.1.SUCC.gp$group.subgroup.60!="rest"|vsa1.1.SUCC.gp$group.subgroup.15!="rest"),])

> modS.C.00.3.il.rq.wt_nlme(model = log(y+1) ~ lien.Box.inv.const(a,0,-0.01*0.05,0,1), data = "" & (vsa1.1.SUCC.gp$biod== "C") & (vsa1.1.SUCC.gp$group.subgroup.60!="rest"|vsa1.1.SUCC.gp$group.subgroup.15!="rest"),], fixed = list(a ~group.subgroup), random = list(block = pdDiag(a ~ group.subgroup), plot = pdKron(a~scale, groups= ~as.factor(group.subgroup))), start = c(1,runif(length(tempS.C.00.1$coef)-1)), weights =varPower(form=~predict(object=get("modS.h.C.l.t",where=1),newdata=cbind.data.frame(y=fitted(.,lev=2),group.subgroup=group.subgroup,group=group,scale=scale)),fixed=list(power=0.5)),control = list(returnObject=T,maxIter=25), verbose = T)

Gives the following error:
Warning messages:
  Conflicting definitions of "formula.pdKron" on databases "nlme33" and
        "nlme3" in: UseMethod("formula")
Problem in attributes(.A0) <- .A2: Length of data (32448) doesn't match product of dimensions (29952)
Use traceback() to see the call stack

> traceback()
6: eval(action, sys.parent())
5: doErrorAction("Problem in attributes(.A0) <- .A2: Length of data (32448) doesn't match product of dimensions (29952)",

4: attributes(.A0) <- .A2
3: nlme.formula(model = log(y + 1) ~ lien.Box.inv.const(a, 0, -0.01 * 0.05, 0,
2: eval(_expression_(modS.C.00.3.il.rq.wt <- nlme(model = log(y + 1) ~
1:


(i)-b Problem with pdBlocked inside nlme:


> tempH.C.00.1_glm(formula = y ~ group.subgroup, family = poisson, data = "" & vsa1.1.HELIO.gp$cyc!="NA"& (vsa1.1.HELIO.gp$group.subgroup.60!="rest"|vsa1.1.HELIO.gp$group.subgroup.15!="rest"),])

>
> modH.C.00.3.rts.il.wtvi_nlme(model = log(y+1) ~ lien.Box.inv.const(a,0,-0.01*0.05,0,1), data = "" fixed = list(a ~group.subgroup), start = c(1,rep(0,length(tempH.C.00.1$coef)-1)), weights =varComb(varIdent(form=~1|as.factor(group.subgroup)),varPower(form=~predict(object=get("modH.h.C.l.t",where=1),newdata=cbind.data.frame(y=fitted(.),group.subgroup=group.subgroup,group=group,scale=scale)),fixed=list(power=0.5))), subset = cyc!="NA" & (biod== "C") & (group.subgroup.60!="rest"|group.subgroup.15!="rest"),control = list(returnObject=T,maxIter=25), verbose = T,random = list(block = pdDiag(a ~ group.subgroup),plot = pdBlocked(value=list(pdSymm(a~as.numeric(group.subgroup=="b.midL"):scale-1),pdSymm(a~as.numeric(group.subgroup=="b.shad"):scale-1),pdSymm(a~as.numeric(group.subgroup=="h.helio"):scale-1),pdSymm(a~as.numeric(group.subgroup=="h.midL"):scale-1),pdSymm(a~as.numeric(group.subgroup=="h.shad"):scale-1),pdSymm(a~as.numeric(group.subgroup=="w.helio"):scale-1),pdSymm(a~as.numeric(group.subgroup=="w.midL"):scale-1),pdSymm(a~as.numeric(group.subgroup=="w.shad"):scale-1)))))

Problem in rr * t(b[[i]])[groups[[i]], rmapRel[[i]]..: Dimension attributes do not match
Use traceback() to see the call stack
> traceback()
12: eval(action, sys.parent())
11: doErrorAction("Problem in rr * t(b[[i]])[groups[[i]], rmapRel[[i]]..: Dimension attributes do not match",
10: rr * t(b[[i]])[groups[[i]], rmapRel[[i]][[nm]][[j]], drop = F]
9: (rr * t(b[[i]])[groups[[i]], rmapRel[[i]][[nm]][[j]], drop = F]) %*% rep(
8: pars[, nm] + (rr * t(b[[i]])[groups[[i]], rmapRel[[i]][[nm]][[j]], drop = F]) %*%
7: getParsNlme(plist, fmap, rmapRel, bmap, groups, beta, bvec, b, level, N)
6: eval(modelExpression[[2]], local = nlFrame)
5: nlme(model = log(y + 1) ~ lien.Box.inv.const(a, 0, -0.01 * 0.05, 0, 1), data
4: NULL
3: nlme.formula(model = log(y + 1) ~ lien.Box.inv.const(a, 0, -0.01 * 0.05, 0,
2: eval(_expression_(modH.C.00.3.rts.il.wtvi <- nlme(model = log(y + 1) ~
1:
Message: Problem in rr * t(b[[i]])[groups[[i]], rmapRel[[i]]..: Dimension attributes do not match
>

(iv) Problem of pdKron inside lme:

> test_lme(data = "" & vsa1.1.SUCC.gp$cyc!="NA"& (vsa1.1.SUCC.gp$group.subgroup.60!="rest"|vsa1.1.SUCC.gp$group.subgroup.15!="rest"),], fixed = log(y+1) ~group.subgroup, random = list(block = pdDiag(~ group.subgroup), plot = pdKron(~scale, groups= ~as.factor(group.subgroup))))

Problem in rep.int: rep() only defined for length(times)==1 or length(x): rep.int(1:newd[2], rep.int(newd[1], newd[2]))

Use traceback() to see the call stack
> traceback()
24: eval(action, sys.parent())
23: doErrorAction("Problem in rep.int: rep() only defined for length(times)==1 or length(x): rep.int(1:newd[2], rep.int(newd[1], newd[2]))",

22: rep.int(1:newd[2], rep.int(newd[1], newd[2]))
21: unclass(group)
20: split.default(newX, rep.int(1:newd[2], rep.int(newd[1], newd[2])))
19: lapply(split(newX, rep.int(1:newd[2], rep.int(newd[1], newd[2]))), FUN, trim
18: apply(aux, 2, mean, trim = 0.1, na.rm = T)
17: isObject(data, "vector")
16: !isObject(data, "vector")
15: !isObject(data, "vector") || isObject(data, "structure")
14: !isObject(data, "vector") || isObject(data, "structure") && (class(data) !=
13: array(apply(aux, 2, mean, trim = 0.1, na.rm = T), c(nC, nC))
12: "matrix<-.pdKron"(.A0, .A1)
11: MEEM(object, conLin, control$niterEM)
10: initialize.reStruct(...X.sub.i...., structure(.Data = "" = c(
9: FUN(...X.sub.i...., structure(.Data = "" = c("b.AF", "b.AF",
8: list(
7: NULL
6: lapply(object, initialize, data, conLin, control)
5: initialize.lmeStruct(lmeSt, dataMix, grps, control = controlvals)
4: initialize(lmeSt, dataMix, grps, control = controlvals)
3: lme.formula(data = "" == "C" & vsa1.1.SUCC.gp$
2: eval(_expression_(test <- lme(data = "" == "C" &
1:
Message: Problem in rep.int: rep() only defined for length(times)==1 or length(x): rep.int(1:newd[2], rep.int(newd[1], newd[2]))

>

<Prev in Thread] Current Thread [Next in Thread>
  • problem when using pdBlocked and pdKron with nlme, Gosselin Frederic <=