Hello,

 

My data are as following:

 

Data <- data.frame(Ind=rep(1:3,c(10,10,10)),

                   Replicate=rep(c(rep("a",5),rep("b",5)),3),

                   EggSize=rep(rnorm(5,mean=10),6)

                   ) 

attach(Data)

 

 

Using a t-test, I want to check if the mean egg sizes are significantly
different between replicates a and b for each individuals (ie. In that case,
3 outputs with 3 p-values).

I tried the following, but doesn't work: 

 

 

Fun <- function(x,y) {

       print(t.test(x ~ y))

       }

 

tapply(EggSize,Ind,Fun(EggSize,Replicate)) 

 

 

What should I do?

Many thanks.


        [[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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to