Skip to content

t-test

4 messages · Rui Barradas, Nico Met, arun

#
Hello,

I'm not quite sure I understand, but something like this?

tapply(dat$Score, dat$Name, FUN = mean)
sapply(unique(dat$Name), function(un){
     with(dat, t.test(Score[Name == un], Score[Name != un])$p.value)})

My doubt is in what you mean by "mean for CTK and all". The ?t.test 
gives a confidence interval for the difference in the means, so maybe 
you'll have to look there for what you want.

Hope this helps,

Rui Barradas
Em 04-10-2012 10:34, Nico Met escreveu:
#
HI,
Try this:
sapply(split(dat,dat$Name),function(x) t.test(x[,2],dat[,2])$p.value)
#??? CTK100???? CTK103???? CTK121 
#0.86330310 0.32706859 0.02023357 
A.K.



----- Original Message -----
From: Nico Met <nicomet80 at gmail.com>
To: Rui Barradas <ruipbarradas at sapo.pt>
Cc: r-help at r-project.org; r-help <r-help at stat.math.ethz.ch>
Sent: Thursday, October 4, 2012 6:37 AM
Subject: Re: [R] t-test

Dear Rui,

Many thanks for help.

"mean for CTK and all"? = comparison between mean of all groups ( which
means second col) vs. each groups like CTK100, CTK121 etc.

Regards

Nico
On Thu, Oct 4, 2012 at 12:28 PM, Rui Barradas <ruipbarradas at sapo.pt> wrote:

            
??? [[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.