peter robinson
2003-Jun-07 17:42 UTC
[R] beginner's question: Graphical presentation of t test
Hi, Is there any way to use R to present t test results for three groups of experiments, each of which involves several parallel experiment series with groups of control vs treated. I would like to present the average fold change of the experimental parameter (concentration of enzymes) as bars with standard error and the p value above the bar. So, there should be two groups (control vs treated) of three bars for the three enzymes. Thanks Peter
Warnes, Gregory R
2003-Jun-08 03:23 UTC
[R] beginner's question: Graphical presentation of t test
Take a look at the 'plotmeans' function in the gregmisc library. It will draw the means and error bars for you, allowing you to connect the means for the paired control and treated groups with something like this: <R code> # sample source data 10 replicates for each enzyme for treated and control x <- rnorm(60) enzyme <- rep(c("ABC123", "ABD124", "CCF342"), length=60) treat <- rep(c("CONTROL","TREATED"), length=60) # create a enzyme by treatment label group <- interaction(enzyme, treat) # plot the means and confidence intervals library(gregmisc) plotmeans( x ~ group, connect=list(1:2,3:4,5:6)) # add p-values data <- data.frame(x, enzyme, treat) p.vals <- by( data, enzyme, function(data) t.test( x ~ treat, data=data)$p.value ) text(x=c(1.5, 3.5, 5.5), y=rep(0,3), paste("P-value:\n", format.pval(p.vals)) ) </R code> -Greg> -----Original Message----- > From: Peter.Robinson at t-online.de [mailto:Peter.Robinson at t-online.de] > Sent: Saturday, June 07, 2003 1:43 PM > To: r-help at stat.math.ethz.ch > Subject: [R] beginner's question: Graphical presentation of t test > > > Hi, > > Is there any way to use R to present t test results for three > groups of > experiments, each of which involves several parallel > experiment series with > groups of control vs treated. I would like to present the > average fold change > of the experimental parameter (concentration of enzymes) as bars with > standard error and the p value above the bar. So, there > should be two groups > (control vs treated) of three bars for the three enzymes. > > Thanks > > Peter > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >LEGAL NOTICE\ Unless expressly stated otherwise, this message is... {{dropped}}