Collective Action
Collective Action

Reputation: 8009

How do I interpret the vertical line in a plot?

I am using the data here to run the following graphs:

plot(medicare$ageyrs, medicare$other, type = "l", xlab= "Age", ylab="Other", main = "Figure 2") 

enter image description here

I do not understand how to interpret the vertical lines. I am guessing that it has something to do with the range of other (in this case, the number of hospital entrants per 10,000) for each age group. But I do not want a range I simply want the number. What I find especially puzzling is the vertical line at age 65. Outside of that, am I correct in understanding that the quasi-horizontal lines indicate change in the Y axis from one age cohort to the next?

Upvotes: 1

Views: 195

Answers (1)

d0d0
d0d0

Reputation: 160

In your data, there are several "other" entries per "age" entry. Thus, there is a range of y-values for each "age". Since you're plotting as a line (type="l"), these are connected by a line, and thus appear as a vertical line. Your interpretation of the "quasi horizontal" lines is correct. However, notice that the y-value at which the quasi-horizontal line leaves one age-value and arrives at the next is determined by the order of "other" values in your dataset. For example, at age 65, the first "other" value in your data is the smallest (for age 65), and the last other-value is the largest. Thus, the horizontal line connecting to it starts at the very bottom, and leaves at the very top, which is why it Looks a bit different then the others. This also means that the slope of the horizontal lines is to some degree arbitrary.

If you want one number per "age", you should compute a summary value of the "other" range per "age" value, such as the mean().

Upvotes: 3

Related Questions