Is the grey line the mean or the median? - statistics

On this JMP plot
found here
Does the horizontal grey line represent the overall mean or median (or something else)?

The gray line shows the survival plot on your diagram.
When you select Show Points and Show Combined, the survival plot for the total or combined sample appears as a gray line. The points also appear at the plot steps of each group.
http://www.jmp.com/support/help/Survival_Platform_Options.shtml
See also: http://www.jmp.com/support/help/The_Survival_Plot.shtml

Related

plt.axvline labels exceeding limit of plot problem

full - clearest image, shows the labels extending out the right of my plot
"zoomed" - highlighting why this is a problem as the plot becomes unreadable when selecting and plotting subset of the x-axis range
I'm working on some data where I have plotted a spectrum and have added vertical lines to specific positions. I have labelled these lines but my problem is that if I want to "zoom in" by decreasing my x axis range, the full list of labels for the vertical lines are still plotted resulting in an unreadable plot.
I iterate through a list of x positions and labels for my vertical lines and plot as follows:
for x_pos, label in zip(list_x_pos, list_label):
plt.axvline(x=x_pos)
plt.text(x_pos, y, str(label), rotation=90)
plt.xlim(2, 5)
So, because my "x values" go > 5 the resulting plot is a tiny figure with a row of the labels extending out from it.
The only solution I can think of is to slice my list_x_pos but this will crate other problems for me so ideally looking to find a way to just show the labels within the range of the plot.
Hope I've made sense!
Thanks,
Olie
You can use plt.text(..., clip_on=True) to force texts outside of the box to not be displayed.
Resize the axes first and then plot the vertical line.

Shading Area Between Two Line Charts and Axes

I am on day #2 of searching the web and, while I have found plenty of hits that seem like they should work, none of them seem to apply to my particular situation.
I have an Excel chart with two series displayed. One is a sort of exponential decay curve, and one is a constant that intersects with the exponential curve, but does not continue past it (the final x-value of the orange line is estimated to make it look like it intersects the blue curve):
The raw data for the blue curve is as follows (leaving off data labels for confidentiality reasons, but x-values are on the left and y-values are on the right):
The orange line is simply set at 24 all the way across until it intersects with the blue curve.
So here's the problem I need to solve: I need to fill in all of the area below the blue curve with one color, and I need to fill in the area below the orange line with another color. Everything above the blue curve needs to be blank (transparent). Here's an illustration of what I want:
I know in order to get the coloring/shading I need to use an area chart. However, when I try to change the chart type to Area the scales of the axes change for each series and they no longer match up, and I am unable to edit the axes (can't set min, max, etc) to make them match up again. Additionally, only the area directly beneath the constant line fills in (as expected), but I am looking for a way to fill in the area between the orange line, the blue curve, and the axes:
How might one go about doing what I need to do?
If there's any other information I could provide that would be of help, please let me know and I'll be sure to add it in.
EDIT:
I can extend the orange line to follow the blue line off to the right, which may help fill in the lower area. However, when I switch to an area chart I still get the issue with mismatched axes with scale I can't edit:
Notice how the "567" point (the x-value where the orange line should intersect the blue curve) is spaced evenly between "500" and "600", rather than scaling slightly to the right of center as I would have expected.
How do I keep the spacing of one tick every 100 units on the x-axis but keep the datapoint for 567?
You could find the intersection point's coordinates (graphically or analitically), then split your data in two separate series within the same graph as follows :
Edit post comment section :
For some reason x-values are considered by default as text.
Righ click the x-axis > format > Select date on the axis
Then play with the principal and base in days/months to have the intervals you want.
Good parameters for this data :
main : 100 in days
base : in days
I would just have two identical charts : one does the blue and the other the orange then lay the orange chart on top of the blue and make it transparent ... worked a treat in the past...

Flip X and Y axis on Excel custom chart

I've made a chart with Excel 2010's "Combo" option for chart type so I can plot two data series for the same depth points. The image below shows the default, which is very close to what I want - except I would like to have the axes flipped so that the current X axis, which is depth, is displayed as the Y axis and both primary and secondary current Y axes plot as X axes. In other words, I'd like to rotate the chart area by 90 degrees clockwise. The "Switch Row/Column" doesn't do what I want (or expect) and I'm running out of both ideas and patience. Is there an easy fix? Or a hard fix?
Here's the plot as-is:
And here's a dummy plot of the end goal made by rotating the image around in Paint, in case the picture makes it clearer:
Finally, as was pointed out in the comments, the whole thing looks goofy and might be better plotted as a bar graph with two bars. I tried this as well and came away almost all set - but the gray bars plot from left to right and the blue bars plot from right to left. Seems like it should be as simple as changing the "Plot Series On" option to Primary Axis for both, but this destroys the graph.
I looked around and I think this link has instructions for what you're looking for: https://superuser.com/questions/188064/excel-chart-with-two-x-axes-horizontal-possible

Predicted vs observed plot with diagonal line and deviation

I am trying to plot predictions vs observations in a scatter plot showing the predicted values in x and the observed in y, so a perfect fit should be shown in the diagonal. Is there any way to plot that diagonal in excel as a line, so it is easier to see if the result is close to the ideal? Also, my model has a standard error that I would also like to show as upper and lower line. Something like this:
Any ideas how I could add the lines in excel? Thanks !!
[edit]
This happens if I add a new series to draw the diagonal line as a line plot:
Where 'line 1' gives me what is shown in the center image after I add a new series, and 'line 2' the one of the right if I add the cells to a existing axis. What I'm doing wrong? thanks
Create a new series for each line, with just two points for each series.
For the diagonal, the first point is at the intersection of the axes and the second is at the top right of the charted area. Format the series with a suitable line and no data points.
For the upper and lower lines, same technique but the first point is where the line intersects the y or x axis respectively.

Histogram plots in pymc, what do different aspects mean?

I have defined a stochastic random variable (and many more but for the sake of this question, one is enough)
tau = pm.DiscreteUniform("tau", lower = 0, upper = 74)
After sampling using MCMC, when I plot the trace of tau, I get the following figure
Now my question is What do this black line and the two dotted lines denote ?
In all earlier figures that I had seen, the black line used to divide the area under histogram under 2 halves (almost) and dotted lines would also cover almost same are around the black line, so I used to think the bold line as mean value and the 2 dotted lines as 95% confidence interval (quite obviously I am wrong).
I will also like to verify my understanding about the height of the histogram.
According to me, the height of the histogram at 45 denotes the number of times, the sampler picked up the value 45, please correct me if I am wrong
The lines are the median (solid line) and the interquartile range (dotted lines). The histograms just illustrate the frequencies of the sample values.

Resources