[R] Bug in lnme package?

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Mon Dec 14 17:01:30 CET 2009


Dear Pieter,

I suppose that you have attached your data.frame and then messed up the
Distance variable. Therefore do not use attach(your.data.frame) but use
the data = your.data.frame argument in your models.

If that does not solve the problem, then send us a reproducible example
of your problem (= models + dummy data). 

HTH,

Thierry


------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstraat 4
9500 Geraardsbergen
Belgium

Research Institute for Nature and Forest
team Biometrics & Quality Assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium

tel. + 32 54/436 185
Thierry.Onkelinx at inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey

-----Oorspronkelijk bericht-----
Van: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
Namens Pieter Deleu
Verzonden: maandag 14 december 2009 16:20
Aan: r-help at stat.math.ethz.ch
Onderwerp: [R] Bug in lnme package?

Hi!

Something funny happens to me in lnme. I don't know if it's a bug or
not.
Here's a short sketch of the problem (you could skip the introduction
and just go to the models):

I'm counting the number of spider webs ( = response variable) along two
rivers, with a two-level treatment: free-flowing and dammed.
There are three field sites (random factor) along each river, and
measurements are done six times (= random factor for repeated
measurements).

Webs are counted on four different distances along the river (fixed
effect), with six plots at each distance.

My model looks like this:

*
Model<-lme(Webslog1~Treatment*Distance,random=~Week|Uniquesite/Uniqueplo
t,method="REML")
*

I want to leave out the interaction between Treatment and Distance, so
that would go like this:
*
>ModelNoInteraction<-lme(Webslog1~Treatment+Distance,random=~Week|Unique
>site/Uniqueplot,method="REML")
*

However, then i get the error message:*
"Error in model.frame.default(formula = ~Week + Webslog1 + Treatment +
:
  invalid type (list) for variable 'Distance' "*

I first thought that it is for some reason just not allowed to leave out
the interaction. But when i try to run the first model again, i get the
same error message! Therefore i thought the thing could be a bug. The
whole thing looks like this:

*>
Model<-lme(Webslog1~Treatment*Distance,random=~Week|Uniquesite/Uniqueplo
t,method="REML")

>
ModelNoInteraction<-lme(Webslog1~Treatment+Distance,random=~Week|Uniques
ite/Uniqueplot,method="REML")

Error in model.frame.default(formula = ~Week + Webslog1 + Treatment +  :
  invalid type (list) for variable 'Distance3'

>
Model<-lme(Webslog1~Treatment*Distance,random=~Week|Uniquesite/Uniqueplo
t,method="REML")

Error in model.frame.default(formula = ~Week + Webslog1 + Treatment +  :
  invalid type (list) for variable 'Distance3'*
*>*


Someone any idea? Bug or just my poor R skills?

Thanks for having a look at this!

Pieter

	[[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Druk dit bericht a.u.b. niet onnodig af.
Please do not print this message unnecessarily.

Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message 
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not confirmed by a duly 
signed document.




More information about the R-help mailing list