how to add SD onto a plot
2
0
Entering edit mode
Jianping Jin ▴ 890
@jianping-jin-1212
Last seen 10.2 years ago
Dear list, Does any one know how to add SD information of a data set onto a plot which displays mean values for each group? I did something like: > x = c(0,1,2,3) > y = apply(data,2,mean) > plot(x,y) Thanks for you help! Jianping ################################## Jianping Jin Ph.D. Bioinformatics scientist Center for Bioinformatics Room 3133 Bioinformatics building CB# 7104 University of Chapel Hill Chapel Hill, NC 27599 Phone: (919)843-6105 FAX: (919)843-3103 E-Mail: jjin at email.unc.edu
• 1.0k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 3 hours ago
United States
Hi Jianping, Jianping Jin wrote: > Dear list, > > Does any one know how to add SD information of a data set onto a plot which > displays mean values for each group? I did something like: > > >>x = c(0,1,2,3) >>y = apply(data,2,mean) >>plot(x,y) z <- apply(dat, 2, sd)/2 for(i in seq(along = x)) arrows(x[i], y[i]-z[i], x[i], y[i]+z[i], angle=90, length=0.1, code=3) Best, Jim > > > Thanks for you help! > > Jianping > > ################################## > Jianping Jin Ph.D. > Bioinformatics scientist > Center for Bioinformatics > Room 3133 Bioinformatics building > CB# 7104 > University of Chapel Hill > Chapel Hill, NC 27599 > Phone: (919)843-6105 > FAX: (919)843-3103 > E-Mail: jjin at email.unc.edu > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.
ADD COMMENT
0
Entering edit mode
Matthias Kohl ▴ 160
@matthias-kohl-1678
Last seen 10.2 years ago
Hello, function plotCI in package gplots or function plotCI in package plotrix might do what you want. hth Matthias Jianping Jin schrieb: > Dear list, > > Does any one know how to add SD information of a data set onto a plot which > displays mean values for each group? I did something like: > > >> x = c(0,1,2,3) >> y = apply(data,2,mean) >> plot(x,y) >> > > Thanks for you help! > > Jianping > > ################################## > Jianping Jin Ph.D. > Bioinformatics scientist > Center for Bioinformatics > Room 3133 Bioinformatics building > CB# 7104 > University of Chapel Hill > Chapel Hill, NC 27599 > Phone: (919)843-6105 > FAX: (919)843-3103 > E-Mail: jjin at email.unc.edu > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > -- Dr. rer. nat. Matthias Kohl E-Mail: matthias.kohl at stamats.de Home: www.stamats.de
ADD COMMENT
0
Entering edit mode
Here is how I usually do this: # (1) Create and plot some sample data bar <- barplot(x <- abs(rnorm(10,2,1)), names.arg = letters[1:10], col="red", ylim=c(0,5)) stdev <- x/5 # (2) Add error bars arrows(bar, x, bar, x + stdev, length=0.15, angle = 90) arrows(bar, x, bar, x + -(stdev), length=0.15, angle = 90) Thomas On Mon 11/20/06 20:05, Matthias Kohl wrote: > Hello, > > function plotCI in package gplots or function plotCI in package plotrix > might do what you want. > > hth > Matthias > > > Jianping Jin schrieb: > > Dear list, > > > > Does any one know how to add SD information of a data set onto a plot which > > displays mean values for each group? I did something like: > > > > > >> x = c(0,1,2,3) > >> y = apply(data,2,mean) > >> plot(x,y) > >> > > > > Thanks for you help! > > > > Jianping > > > > ################################## > > Jianping Jin Ph.D. > > Bioinformatics scientist > > Center for Bioinformatics > > Room 3133 Bioinformatics building > > CB# 7104 > > University of Chapel Hill > > Chapel Hill, NC 27599 > > Phone: (919)843-6105 > > FAX: (919)843-3103 > > E-Mail: jjin at email.unc.edu > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor at stat.math.ethz.ch > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > > > > > -- > Dr. rer. nat. Matthias Kohl > E-Mail: matthias.kohl at stamats.de > Home: www.stamats.de > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > -- Thomas Girke, Ph.D. 1008 Noel T. Keen Hall Center for Plant Cell Biology (CEPCEB) University of California Riverside, CA 92521 E-mail: thomas.girke at ucr.edu Website: http://faculty.ucr.edu/~tgirke Ph: 951-827-2469 Fax: 951-827-4437
ADD REPLY

Login before adding your answer.

Traffic: 662 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6