Mackay Peter wrote:> I am a relatively new user of R, and have a question on ANOVA
>
> I have a sumamrised data set of the form (data dummy only)
>
> Cell Treatment Total Resp
> 1 1 25000 682
> 1 0 35000 600
> 2 1 5000 40
> 2 0 4000 30
> 3 1 36000 2400
> 3 0 400 250
>
> and wish to perform ANOVA. Because its sumamrised I need to tell R to
> treat the data as if I had all the individual rows. Otherwise, I only
> end up with 1 or 2 DF.
>
> I know in SAS, ANOVA has a 'FREQ' option ... does something similar
> exist in R?
>
>
An explicit rep(x, count) does the same as the FREQ option. Without the
group standard deviations, neither will produce anything useful, though.
If you do have SDs, there's a technique used in my book
fake.trypsin<-local({
xrnorm<-function(n,xbar,s){
t<-rnorm(n);t<-(t-mean(t))/sd(t);xbar+s*t}
g.1<-xrnorm(32,128,50.9)
g.2<-xrnorm(137,152,58.5)
g.3<-xrnorm(38,194,49.3)
g.4<-xrnorm(44,207,66.3)
g.5<-xrnorm(16,215,60)
g.6<-xrnorm(4,218,14)
trypsin<-c(g.1,g.2,g.3,g.4,g.5,g.6)
grp<-rep(1:6,c(32,137,38,44,16,4))
grpf<-factor(grp)
data.frame(trypsin,grp,grpf)})
or you can use the equivalent of this SAS trick:
http://ssc.utexas.edu/consulting/answers/sas/sas48.html
--
O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B
c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907