An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20130809/6ad7cd18/attachment.pl>
using nlme
2 messages · Robert Corty, Ben Bolker
1 day later
Robert Corty <rcorty at ...> writes:
I am having trouble running nlme. Here is the relevant snippet of my
code. Any ideas?
df <- data.frame(phen = phen.info.box[,2], hap = as.factor(mouse.haps),
strain = as.factor(mouse.strains))
fit <- nlme(model = phen ~ hap + strain,
data = df,
fixed = hap + strain ~ 1,
random = strain ~ 1,
start = rep(0, nrow(df)),
correlation = K)
The error is:
Error in getGroups.data.frame(dataMix, eval(parse(text = paste("~1",
deparse(groups[[2]]), :
invalid formula for groups
-Robert
Can you give a small reproducible example and say a little more about what you're trying to do? It looks like you're fitting an additive model, which seems odd (although perhaps you're just warming up for something more complex). You don't seem to have a grouping variable in your 'random' specification ... ? That only works if you use a groupedData object to fit ...