Skip to content

lme4: Error in getResponseFormula(form) : "Form" must be a two sided formula

9 messages · Chris Evans, Douglas Bates, Spencer Graves +4 more

#
I'm sure I'm being stupid so flame away...

R2.2.1 on Windoze (boohoo) latest updates of packages.

I'm exploring a dataset (land) with three variables looking at an
narrowly unbalanced two group (GROUP) ANCOVA of a randomised
controlled trial analysing endpoint score (SFQ.LOCF.ENDPOINT) entering
the baseline score (SFQ.BASELINE) as covariate and the following work
fine:
I try:
Call:
Error in getResponseFormula(form) : "Form" must be a two sided formula

I'm puzzled.  That looks like a two sided formula very like the one in
the help for lme4 (which had been loaded) and the data look OK:
3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 23
 1  1  2  4  8  5 16  9  7 14 18  7 16  9  6  8  4  6  2  3
3  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 1  1  3  3  4 11  7  7 10 12  9 16 14  9  8  7  8  6  1  1
1  2
87 89

Advice accepted gratefully and flames ruefully!

Chris
#
Please check which packages you have attached when you call lmList. 
That error message looks as if it is coming from the version of lmList
that is in the nlme package, not the one in lme4.
On 2/6/06, Chris Evans <stats at psyctc.org> wrote:
3 days later
#
Hi, Doug and Chris:

	  I just got the same error message with the "lmList" example in lme4:

 >      (fm1 <- lmList(breaks ~ wool | tension, warpbreaks))
Call:
Error in getResponseFormula(form) : "Form" must be a two sided formula
 > sessionInfo()
R version 2.2.1, 2005-12-20, i386-pc-mingw32

attached base packages:
[1] "methods"   "stats"     "graphics"  "grDevices" "utils"     "datasets"
[7] "base"

other attached packages:
      lme4   lattice    Matrix
"0.995-2" "0.12-11" "0.995-5"

	  I quit then restarted R and tried the same example in nlme:  It 
seemed to work fine.

	  Chris, have you tried this in nlme?  If you absolutely need some 
feature of lme4, at least you could do this kind of preliminary work in 
nlme, then switch to lme4 (after quitting and restarting R to avoid 
potential conflicts between nlme and lme4).

	  hope this helps.
	  spencer graves
Douglas Bates wrote:
#
On 2/10/06, Spencer Graves <spencer.graves at pdf.com> wrote:
Hmm.  I am unable to reproduce that in either R-devel or R-patched under Linux
Loading required package: Matrix
Loading required package: lattice
Call: lmList(formula = breaks ~ wool | tension, data = warpbreaks)
Coefficients:
  (Intercept)      woolB
L    44.55556 -16.333333
M    24.00000   4.777778
H    24.55556  -5.777778

Degrees of freedom: 54 total; 48 residual
Residual standard error: 10.94028
Version 2.3.0 Under development (unstable) (2006-02-11 r37328)
i686-pc-linux-gnu

attached base packages:
[1] "methods"   "stats"     "graphics"  "grDevices" "utils"     "datasets"
[7] "base"

other attached packages:
     lme4   lattice    Matrix
"0.995-2"  "0.13-3" "0.995-5"
Loading required package: Matrix
Loading required package: lattice
Call: lmList(formula = breaks ~ wool | tension, data = warpbreaks)
Coefficients:
  (Intercept)      woolB
L    44.55556 -16.333333
M    24.00000   4.777778
H    24.55556  -5.777778

Degrees of freedom: 54 total; 48 residual
Residual standard error: 10.94028
R version 2.2.1, 2005-12-20, i486-pc-linux-gnu

attached base packages:
[1] "methods"   "stats"     "graphics"  "grDevices" "utils"     "datasets"
[7] "base"

other attached packages:
     lme4   lattice    Matrix
"0.995-2"  "0.12-3" "0.995-5"
#
Hi all,
I have a basic question. how can i visualize two or more density curves on
the same plot?

ex:
x1<-runif(100,10,80)
x2<-runif(100,1,100)
kernelgraf<-density(x1,kernel = "gaussian", width= 20)
plot(kernelgraf, xlab="Probability", xlim=c(0,100), ylim=c(0,.1),
col=rgb(0,1,0), main="")
kernelgraf<-density(x2,kernel = "gaussian", width= 20)
points(kernelgraf, xlab="Probability", xlim=c(0,100), ylim=c(0,.1),
col=rgb(0,0,1), main="")

here i am using plot + points, but i do not like the graphical output for
points.

can anybody help me?

thanks in advance

Roberto Furlan
University of Turin


----------------------------------------
La mia Cartella di Posta in Arrivo e protetta da SPAMfighter
204 messaggi contenenti spam sono stati bloccati con successo.
Scarica gratuitamente SPAMfighter!
#
You could substitute
 
lines(kernelgraf)


for your last line:

points(kernelgraf, xlab="Probability", xlim=c(0,100), ylim=c(0,.1),
col=rgb(0,0,1), main="")



See 
?lines


Charles Annis, P.E.

Charles.Annis at StatisticalEngineering.com
phone: 561-352-9699
eFax:  614-455-3265
http://www.StatisticalEngineering.com
 

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of
statistical.model at googlemail.com
Sent: Saturday, February 11, 2006 1:44 PM
To: r-help at stat.math.ethz.ch
Subject: [R] plots

Hi all,
I have a basic question. how can i visualize two or more density curves on
the same plot?

ex:
x1<-runif(100,10,80)
x2<-runif(100,1,100)
kernelgraf<-density(x1,kernel = "gaussian", width= 20)
plot(kernelgraf, xlab="Probability", xlim=c(0,100), ylim=c(0,.1),
col=rgb(0,1,0), main="")
kernelgraf<-density(x2,kernel = "gaussian", width= 20)
points(kernelgraf, xlab="Probability", xlim=c(0,100), ylim=c(0,.1),
col=rgb(0,0,1), main="")

here i am using plot + points, but i do not like the graphical output for
points.

can anybody help me?

thanks in advance

Roberto Furlan
University of Turin


----------------------------------------
La mia Cartella di Posta in Arrivo e protetta da SPAMfighter
204 messaggi contenenti spam sono stati bloccati con successo.
Scarica gratuitamente SPAMfighter!
#
Le 11.02.2006 19:44, statistical.model at googlemail.com a ??crit :
You are almost there, replace your last command by :

points(kernelgraf, type="l", col="blue")

Romain

PS : Maybe a function points.density setting type="l" would be a good 
thing ?

  
    
#
Romain Francois wrote:
Or maybe use

lines(kernelgraf, type="l", col="blue")

As I always say, when you want lines, use lines().

Duncan Murdoch
#
Le 11.02.2006 19:59, Duncan Murdoch a ??crit :
You are right Duncan,

I wish there was a coffea() function in R

;-)