Lineplot Ci Error Bars
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow plot confidence interval matlab the company Business Learn more about hiring developers or posting ads with us Stack
Ggplot2 Error Bars
Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of standard error 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up r / sciplot: overlapping whiskers in lineplot.CI up vote 2 down vote favorite When making an interaction plot plot in r using lineplot.CI in the sciplot library, error bars can overlap across groups. For example, data = c(1,5,3,7,3,7,5,9) grp1 = c(1,1,1,1,2,2,2,2) grp2 = c(1,1,2,2,1,1,2,2) lineplot.CI(grp1, data, grp2) The groups can be separated along the x axis by adding jitter to the grouping variable and setting x.cont to TRUE, but this makes the lines in the plot disappear: data = c(1,5,3,7,3,7,5,9) grp1 = c(1,1,1,1,2,2,2,2) + c(-0.05, -0.05, 0.05, 0.05, -0.05, -0.05, 0.05, 0.05) grp2
Boxplot
= c(1,1,2,2,1,1,2,2) lineplot.CI(grp1, data, grp2, x.cont=TRUE) Is it possible to get the lines to appear and to jitter the points, so that the error bars don't overlap? Or is there a better way to make this kind of plot? r plot confidence-interval share|improve this question asked Feb 21 '12 at 2:05 jm.carp 26828 add a comment| 1 Answer 1 active oldest votes up vote 4 down vote accepted You can use ggplot2 for that. Here is an example with a built-in dataset (as I don't have your standard errors or CIs). The key is to use position_dodge(). ToothGrowth$dose.cat <- factor(ToothGrowth$dose, labels=paste("d", 1:3, sep="")) df <- with(ToothGrowth , aggregate(len, list(supp=supp, dose=dose.cat), mean)) df$se <- with(ToothGrowth , aggregate(len, list(supp=supp, dose=dose.cat), function(x) sd(x)/sqrt(10)))[,3] opar <- theme_update(panel.grid.major = theme_blank(), panel.grid.minor = theme_blank(), panel.background = theme_rect(colour = "black")) xgap <- position_dodge(0.2) gp <- ggplot(df, aes(x=dose, y=x, colour=supp, group=supp)) gp + geom_line(aes(linetype=supp), size=.6, position=xgap) + geom_point(aes(shape=supp), size=3, position=xgap) + geom_errorbar(aes(ymax=x+se, ymin=x-se), width=.1, position=xgap) theme_set(opar) share|improve this answer answered Feb 21 '12 at 12:32 chl 15.2k43557 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer,
Search All Support Resources Support Documentation MathWorks Search MathWorks.com MathWorks Documentation Support Documentation Toggle navigation Trial Software Product Updates Documentation Home MATLAB Examples Functions Release Notes pch r PDF Documentation Graphics 2-D and 3-D Plots Line Plots MATLAB Functions errorbar box plot On this page Syntax Description Examples Plot Vertical Error Bars of Equal Length Plot Vertical Error Bars that
Standard Deviation
Vary in Length Plot Horizontal Error Bars Plot Vertical and Horizontal Error Bars Plot Error Bars with No Line Control Error Bars Lengths in All Directions Add Colored Markers to http://stackoverflow.com/questions/9371147/r-sciplot-overlapping-whiskers-in-lineplot-ci Each Data Point Control Error Bar Cap Size Modify Error Bars After Creation Input Arguments y x err neg pos yneg ypos xneg xpos ornt linespec ax Name-Value Pair Arguments 'CapSize' 'LineWidth' See Also This is machine translation Translated by Mouse over text to see original. Click the button below to return to the English verison of the page. Back to https://www.mathworks.com/help/matlab/ref/errorbar.html English × Translate This Page Select Language Bulgarian Catalan Chinese Simplified Chinese Traditional Czech Danish Dutch English Estonian Finnish French German Greek Haitian Creole Hindi Hmong Daw Hungarian Indonesian Italian Japanese Korean Latvian Lithuanian Malay Maltese Norwegian Polish Portuguese Romanian Russian Slovak Slovenian Spanish Swedish Thai Turkish Ukrainian Vietnamese Welsh MathWorks Machine Translation The automated translation of this page is provided by a general purpose third party translator tool. MathWorks does not warrant, and disclaims all liability for, the accuracy, suitability, or fitness for purpose of the translation. Translate errorbarLine plot with error barscollapse all in page Syntaxerrorbar(y,err)errorbar(x,y,err) exampleerrorbar(x,y,neg,pos)errorbar(___,ornt) exampleerrorbar(x,y,yneg,ypos,xneg,xpos) exampleerrorbar(___,linespec) exampleerrorbar(___,Name,Value) exampleerrorbar(ax,___)e = errorbar(___) exampleDescription errorbar(y
,err) creates a line plot of the data in y and draws a vertical error bar at each data point. The values in err determine the lengths of each error bar above and below the data points, so the total error bar lengths are double the err values. exampleerrorbar(x
,y,err) plots y versus x and draws a vertical error bar at each data point.
Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the http://stats.stackexchange.com/questions/64880/plotting-confidence-interval-bars-from-summary-statistics company Business Learn more about hiring developers or posting ads with us Cross Validated Questions Tags Users Badges Unanswered Ask Question _ Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to error bars the top Plotting confidence interval bars from summary statistics up vote 6 down vote favorite 1 A bit like a box plot. I mean not necessarily the standard upper confidence interval, lower confidence interval, mean, and data range-showing box plots, but I mean like a box plot with just the three pieces of data: the 95% confidence interval and mean. This is a screenshot of a journal article which had exactly what I want: lineplot ci error I would also like to know how I would use the software the answerer mentions to create such a plot. confidence-interval data-visualization summary-statistics software boxplot share|improve this question edited Oct 19 '15 at 18:05 Andre Silva 2,41751647 asked Jul 19 '13 at 19:10 Brenton Horne 1541211 7 What you call "the standard upper confidence interval, lower confidence interval, mean, and data range-showing box plots" are not standard box plots at all. The standard box plot shows median, quartiles, minimum and maximum and often other details. –Nick Cox Jul 19 '13 at 19:13 1 @Nick Right: but what are such graphics actually called? (I'm not sure.) –whuber♦ Jul 19 '13 at 19:14 6 This kind of plot is standard (it's not a box plot, though) and can be produced by all major statistical packages: Stata, SAS, R, MATLAB. I guess you could do it with Excel as well. –COOLSerdash Jul 19 '13 at 19:15 1 @COOLSerdash great! Could you write up an answer for MATLAB since I already have MATLAB? –Brenton Horne Jul 19 '13 at 19:16 6 I'd call these confidence interval plots, but not every plot really needs a distinct name. Every plot deserves a text caption, however.... –Nick Cox Jul 19 '13 at 19:20 | show 2 more comments 7 Answers 7 active oldes
be down. Please try the request again. Your cache administrator is webmaster. Generated Thu, 20 Oct 2016 05:56:03 GMT by s_wx1196 (squid/3.5.20)