# Regression: testing two predicted means on the same slope?

I'm surprised I haven't run into this question yet, but I was wondering if there is a sound way of testing the difference in predicted means between two points on the same slope.

For example: Let's say my predictor is the age of a car, and my predicted variable, its price. Let's assume that the downward slope is significant. What I would like to test is if a car 5 years old is significantly cheaper than one that is a year old.

Can I just use the two predicted means, and divide them by some error term as a t-test? And if so, which error term?

Thanks!

• Needs a bit more explanation. So you have a model Price = A + B* Age with A and B known with some known uncertainty and want to determine which car is cheaper, right? – Dave31415 Mar 14 '14 at 22:33
• I'd like to know if I randomly sampled a car from say, 2003 would it be cheaper than if I got a car from 2005. – Bryan Mar 14 '14 at 22:36
• Ok, so by cheaper you mean literally less money right, not just a better value? That's a different problem than I imagined. – Dave31415 Mar 14 '14 at 22:39
• Yup, that's correct. I guess, if the slope is significant, then the prediction itself is that the older car will be cheaper. But another way of what I'm asking is: if I took a car from December 2004 and another from January 2005, are these likely to be statistically significantly different in price? If so/not, how would I find this out? – Bryan Mar 14 '14 at 22:42

The question doesn't make sense. Significance is about hypotheses tests and hypotheses are about relationships in data, not about predicted values.

In the regression, you found that age of car was significant. That is, if, in the population (all cars on the road?) from which this sample (cars in your data set) was drawn there really was no effect of age on price, it would be unlikely to get a test statistic at least as extreme as the one you got in the sample.

Now you are saying you want to test a different hypothesis: e.g. that cars from 2005 are cheaper than 2010. To test that hypothesis you would need to do a different analysis, using cars only from those two years. A t-test might be right, or a different regression.

• Perhaps I can make my question clearer: Let's say I'd like to test the mean difference between the 25th and 75th percentile of my sample of cars from 2000 to 2010. One inefficient way I could do that would be to simply look at the cars from those two time points, excluding all others, as you suggest. I was wondering if there was a way to use the rest of the data to test that same hypothesis. – Bryan Mar 14 '14 at 22:31

The wording in the statement of the problem is problematic. If you just have ages and prices and want to assume a linear model, you can fit that model and you will almost certainly find a slope that is significant (assuming you have at least a few dozen cars over a few years).

That should be the end of the use of the word "significant".

Now, you appear to be asking whether you should expect a car in 2005 to be priced higher than a car from 2003. On average the answer is yes as you have already determined. However, there are other factors that affect price. A 2003 Ferarri will likely cost more than a 2005 Corolla. So now you can ask about the chance of a car in 2005 being more/less expensive than a car in 2003. This question is not answerable by the regression coefficients alone. It depends as much on the scatter or variance around the mean and it is possible that this scatter is not constant across age. If you assume the scatter is indeed constant and distribution is Normal, you can write down an equation for it which will involve error functions. Assuming other things will lead to different results.

• Yes, that is what I'm asking (the latter question), thanks! If the answer to that question is too lengthy, just pointing me to the terms I should be searching for would be helpful. – Bryan Mar 14 '14 at 23:09
• If you want to assume normally distributed data with a fixed variance from the model, then it is easy. The difference is also Normal with twice the variance but with a mean given by the expected shift (from the slope). The statistic you seek is then just the Error Function suitably shifted. Relaxing any of these assumptions will change the result but it is hard to describe this in general. – Dave31415 Mar 15 '14 at 4:47