Page 1 of 1

Issue with formula specification

Posted: Wed Apr 20, 2016 9:37 am
by kaiserdominici
Hi all,

I am having some troubles passing a formula to MLwiN. I have a 3-level repeated measures model with random intercept and slopes at levels 3 (Group) and 2 (ID) and a fixed quadratic time component. I have tried both:

Code: Select all

> runMLwiN(Median.yr ~ 1 + poly(Time,2) + (1 + Time |Group) + (1 + Time |ID) + (1 |Time), data = dataset)
Returning:
Error in eval(expr, envir, enclos) : object 'Median' not found

And:

Code: Select all

> runMLwiN(Formula = "Median.yr ~ 1 + poly(Time,2) + (1 + Time |Group) + (1 + Time |ID) + (1 |Time)", data = dataset)
Returning:
Error in parse(text = x, keep.source = FALSE) :
<text>:2:0: unexpected end of input
1: ~
...^


What am I doing incorrectly?

Thank you and all the best,

k.

Re: Issue with formula specification

Posted: Wed Apr 20, 2016 10:35 am
by ChrisCharlton
There appears to be a bug in R2MLwiN where formulae are not parsed correctly if the variables contain a "." character. We will investigate what the cause for this might be, but in the mean time you should be able to work around it by renaming your response so that it does not include this character.

Re: Issue with formula specification

Posted: Wed Apr 20, 2016 10:39 am
by kaiserdominici
Hi Chris,

Thank you for your prompt reply, will do.

All the best,

k.

Re: Issue with formula specification

Posted: Thu Apr 21, 2016 10:15 am
by ChrisCharlton
I have now tracked down the cause of this error, and it should be fixed in the development version of R2MLwiN.