Error Bars On Log Transformed Plots
Contents |
April 21st, 2008, 04:45 AM #1 gstuart Newbie Joined: Apr 2008 Posts: 3 Thanks: 0 Error bars on log-transformed plots? Hello - I am a genetics researcher. I have a series of data points with errors (standard errors), that I wish to plot as how to plot error bars in excel a column plot with error bars: GENE, AVG FOLD CHANGE, SE Gene1, 2193.10, 1200.74 Gene2, 96.28, how to plot error bars by hand 9.08 Gene3, 39.02, 22.51 Gene4, 5.88, 0.82 Gene5, -0.68, 0.33 Gene6, 1.14, 0.02 Gene7, -1.46, 0.16 Gene8, -1.56, 0.50 Gene9, -1.58, 0.10 Gene10, -1.88, 0.45 how to plot error bars in gnuplot Gene11, -2.04, 0.45 Gene12, -6828.82, 975.41 Positive values are up-regulated genes; negative values are down-regulated genes (re: gene expression levels). I wish to plot this as a column plot on a log scale (y-axis) with negative values below the zero baseline, positive
How To Plot Error Bars In R
values above, and with the errors indicated. Something like: 1000 100 10 * 1 * 0------------------- -1 * -10 * -100 -1000 but with bars instead of the asterisks - you get the idea. I can do this easily enough using MS Excel, by taking the log of the absolute value, multiplying the result by +1 or -1 (to restore the original "directionality" - i.e. up- or down-regulated). A couple of questions: (Q1) Is it "better" to use log (base 10) or ln (natural) how to plot error bars in origin log transformations? (Q2) How would I present the error bars - would I log (or ln) -transform the standard errors, for example, and plot these [or the absolute values of these, since the log of numbers <1 are negative; e.g. log(0.5) = -0.301)]? I tried finding the answer to these questions in Google, but I wasn't very successful. ... I would very much appreciate any comments regarding the log-transformation of data and plots of log-transformed data, particularly regarding error bars! Thank you! Sincerely, Greg :-) April 22nd, 2008, 01:06 PM #2 gstuart Newbie Joined: Apr 2008 Posts: 3 Thanks: 0 Hello - I think I have this right ... Referring to the sample data (below; this would be easier, if I could attach my Excel spreadsheet), I first log-transformed my data, x = log( |x| + 1) using the absolute values (to avoid taking the log of negative numbers) and adding 1 (to avoid taking the log of zero). Next, I multiplied these log-transformed values by +1 (to indicate up-regulated genes) or -1 (to indicate down-regulated genes). Last, I calculated the mean and standard error of these log-transformed data, and plotted the results. I think that this is correct - please comment, if I am mistaken. Thank you! Greg :-) =========== Test Data: ============ SE (= SD /(n^0.5) - i.e. SD / sqrt(number of data points) log ( | fold-change +1 | ) - i.e. log of (absolute value +1) "Correction:" Multiplier +1 (up-regulated)
von GoogleAnmeldenAusgeblendete FelderNach Gruppen oder Nachrichten suchen
Support Answers MathWorks Search MathWorks.com MathWorks Answers Support MATLAB Answers™ MATLAB Central Community Home MATLAB Answers File Exchange Cody Blogs Newsreader Link Exchange ThingSpeak Anniversary Home Ask Answer Browse More Contributors Recent https://www.mathworks.com/matlabcentral/answers/241261-how-do-i-get-working-y-axis-errorbars-using-a-log-scale Activity Flagged Content Flagged as Spam Help MATLAB Central Community Home MATLAB Answers File Exchange Cody Blogs Newsreader Link Exchange ThingSpeak Anniversary Home Ask Answer Browse More Contributors Recent Activity Flagged Content Flagged as Spam Help Trial software Adam Goldsmith (view profile) 3 questions 0 answers 0 accepted answers Reputation: 1 Vote1 How do I get working y-axis errorbars using a log scale? Asked by Adam Goldsmith error bars Adam Goldsmith (view profile) 3 questions 0 answers 0 accepted answers Reputation: 1 on 8 Sep 2015 Latest activity Answered by Mike Garrity Mike Garrity (view profile) 0 questions 370 answers 198 accepted answers Reputation: 1,170 on 8 Sep 2015 81 views (last 30 days) 81 views (last 30 days) I'm trying to plot data on a semilog plot (y-axis: log, x-axis: linear), but the errorbars are seriously how to plot screwed up.All I'm doing is loading my data and entering:figure errorbar(hp_v3,hp_D0,hp_D0_,'ok') set(gca,'YScale','log') where hp_D0_ is the vector of uncertainty values for vector hp_D0. This results in the plot attached as an image, which obviously isn't working.I've also tried errrobarlogy, which produces literally the same plot. Any ideas? 0 Comments Show all comments Tags semilogyploterrorbarerrorbarlogyfigures Products MATLAB Related Content 1 Answer Mike Garrity (view profile) 0 questions 370 answers 198 accepted answers Reputation: 1,170 Vote1 Link Direct link to this answer: https://www.mathworks.com/matlabcentral/answers/241261#answer_191705 Answer by Mike Garrity Mike Garrity (view profile) 0 questions 370 answers 198 accepted answers Reputation: 1,170 on 8 Sep 2015 That looks like what happens if the bottom of the errorbar is negative.What do you get if you do this:h = errorbar(hp_v3,hp_D0,hp_D0_,'ok'); h.YData - h.LData Are the resulting values negative?If so, what's happening is that the log transform of the negative value results in a complex value which it can't transform to a point on the screen.Here's an attempt to recreate your data:rng default hp_v3 = 986:1002 hp_D0 = 1e-4*rand(1,17); hp_D0_ = 1e-4*randn(1,17); h = errorbar(hp_v3,hp_D0,hp_D0_,'ok') set(gca,'YScale','log'); We can tweak the LData to stay positive like this:ylim manual h.LData = h.YData - max(eps,h.YData-h.LData); 0 Comments Show a
be down. Please try the request again. Your cache administrator is webmaster. Generated Mon, 10 Oct 2016 14:15:08 GMT by s_ac15 (squid/3.5.20)