Re: [R] Error running lme.

From: Doran, Harold <HDoran_at_air.org>
Date: Fri 15 Jul 2005 - 03:40:56 EST


John

Your model is not properly specified for lme. You have not included any random effects or a grouping variable. Let me assume just for sake of argument that you want to include a random effect for the intercept and for time. Your lme specification would be

> fm1 <- lme(Velocity~time, random=~time|ID, gate)

Where ID is a grouping variable.

I would encourage you to work with lmer, which is now found in the Matrix package. The call to lmer differs slightly from lme,

> fm1 <- lmer(Velocity~time + (time|ID), gate)

I hope this is helpful,
Harold

-----Original Message-----
From: r-help-bounces@stat.math.ethz.ch
[mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of John Sorkin Sent: Thursday, July 14, 2005 1:05 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Error running lme.

I am trying to fit lme using R 2.1.1 under Windows 2k. I am getting the following message noted below. Any suggestions that would help me correct my error would be greatly appreciated.
Thanks,
John  

> fit1lme<-lme(Velocity~time,data=gate)
Error in getGroups.data.frame(dataMix, groups) :

        Invalid formula for groups  

John Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
Baltimore VA Medical Center GRECC and
University of Maryland School of Medicine Claude Pepper OAIC  

University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524  

410-605-7119
-- NOTE NEW EMAIL ADDRESS:
jsorkin@grecc.umaryland.edu

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jul 15 03:47:09 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:40 EST