s-news
[Top] [All Lists]

Re: [S] Repeated Measures Analysis

To: Xiao Gang Su <xgsu@wald.ucdavis.edu>
Subject: Re: [S] Repeated Measures Analysis
From: Prof Brian D Ripley <ripley@stats.ox.ac.uk>
Date: Tue, 30 May 2000 08:53:59 +0100 (BST)
Cc: s-news@wubios.wustl.edu
In-reply-to: <Pine.OSF.4.05.10005300015070.581-100000@macro.ucdavis.edu>
Sender: owner-s-news@wubios.wustl.edu
On Tue, 30 May 2000, Xiao Gang Su wrote:

> 
> 
> Hi, all,
> 
> I was trying to facilitate a repeated measures analysis on a simulated
> data with Splus 2000. And I kept getting the error message as below. 
> Is there anyone who can help me with the problem? 
> 
> 
> > data.uni <- cbind(id = rep(1:4, rep(3, 4)), 
>         time = rep(paste("time",1:3,sep=""), 4), 
>         group = as.factor(rep(c(1, 2, 2, 3), rep(3, 4))), 
>       y = rnorm(3 * 4))
> > summary(aov(y ~ group * time + Error(id), data = data.uni))
> Warning messages:
>   Numerical expression has 48 elements: only the first used
> Error: Object "id" not found
> 
> Thanks in advance for your help.

I think you want data.uni to be a data frame. Replace cbind by data.frame.
Next, I think you mean id to be a factor too.

data.uni <- data.frame(id = factor(rep(1:4, rep(3, 4))), 
        time = rep(paste("time",1:3,sep=""), 4), 
        group = factor(rep(c(1, 2, 2, 3), rep(3, 4))), 
        y = rnorm(3 * 4))
summary(aov(y ~ group * time + Error(id), data = data.uni))

gives sensible reults here.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>