[R-sig-ME] Unexpected error from pdBlocked in nlme
S Ellison
S.Ellison at LGCGroup.com
Fri Dec 30 03:48:39 CET 2011
I'm having a struggle with crossed random effects in lme, and an error message is making life unusually difficult. An example of the problem is
lme(x~1, random=list(pdBlocked(list( pdIdent(~A-1), pdIdent(~B-1)))), data=gxd)
gives the following error message:
Error in parse(text = paste("~", paste(nVal, collapse = "/"))) :
<text>:2:0: unexpected end of input
1: ~
^
Toy example data and session info are given below.
Any clues welcome...
S Ellison
(I'd use lmer but I wanted to compare confidence intervals on the mean (fixed effect ~1) with my mcmcsamp HPDinterval() on the lmer version of the same model, and I can't find out how to get a confint() or intervals() equivalent for the lmer model....)
gxd <- structure(list(A = structure(c(1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L,
3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L), .Label = c("1", "2",
"3"), class = "factor"), B = structure(c(1L, 1L, 1L, 2L, 2L,
2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L), .Label = c("1",
"2"), class = "factor"), x = c(-5.03706493725167, -3.07596237277251,
-1.67357362530508, -3.46661642894546, -0.235573955759062, -4.35266100873777,
-2.55168295085252, -1.02736054058064, -1.58115030362354, -3.2255726155801,
-2.68823055748235, -2.42489168933613, -1.78597370388329, -0.758228821072668,
-3.96279145161612, -3.47472936274356, -1.72822479360333, -4.09782688261514
), g = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "1", class = c("ordered",
"factor"))), .Names = c("A", "B", "x", "g"), row.names = c(NA,
-18L), pars = structure(list(nA = 3, nB = 2, n = 3), .Names = c("nA",
"nB", "n")), class = c("nffGroupedData", "nfGroupedData", "groupedData",
"data.frame"), formula = x ~ 1 | g, FUN = function (x)
max(x, na.rm = TRUE), order.groups = TRUE)
Session info:
> sessionInfo()
R version 2.14.1 (2011-12-22)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] nlme_3.1-102
loaded via a namespace (and not attached):
[1] grid_2.14.1 lattice_0.20-0
*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}
More information about the R-sig-mixed-models
mailing list