# Can you compare coefficient of determination $R^2$ fitted to two distinct sets of data?

I have a simple linear regression model, $$\textrm{Weight} = \beta_0 + \beta_1 \cdot \textrm{Height}$$. Can I pick only men, fit model 1, get an $$R_{\rm men}^2$$, and do the same for women with $$R_{\rm women}^2$$, and compare these two?

Or only the explanatory variables' change can be compared, i.e., use only men, and add $$\beta_2 \cdot \textrm{Age}$$ and compare $$R_{{\rm men},h}^2$$ and $$R_{\rm{men},h,a}^2$$?

I tried to simplify my problem, but here is the real problem. I have house prices, and their initial list price.

The odel is:

$$\textrm{Price}=\beta_0 + \beta_1 \textrm{List} + \epsilon \quad .$$

I then fit this model using the data from New York, and Los Angeles. Specifically three models:

• Only New York houses
• Only Los Angeles houses
• Both NY+LA

Is it reasonable to compare the $$R^2$$ fitted to these three models?

• What is the goal of your analysis? – Dave Oct 9 at 21:16
• You can compare the correlations but I think Dave's question is a crucial question to address before jumping in. – Glen_b -Reinstate Monica Oct 9 at 21:32
• Establishing a model to estimating the weight later. In my case, I'm actually estimating sales price of a home from the listing price, so I guess not to explain relationships, but to do predictive modeling. – user1696420 Oct 9 at 23:51
• In that case use a predictive measure instead to compare models. – user2974951 Oct 10 at 8:27
• You can also fit a single model with Height, Sex, and a Height x Sex interaction term. – mkt - Reinstate Monica Oct 10 at 10:54

"Can you compare the $$R^2$$?" Sure: if you get an $$R^2$$ of 0.8 for New York and an $$R^2$$ of 0.6 for LA, you can conclude that initial list price is a better predictor of sale price in NY than in LA. This is not an inferential test (i.e., you don't get a p-value or a measure of clarity), but it might be something you're interested in knowing.
$$\textrm{Price} = \beta_0 + \beta_1 \textrm{List} + \beta_2 \textrm{City} + \beta_3 \textrm{City} \cdot \textrm{List}$$ where $$\textrm{City}$$ is a dummy variable (e.g. =0 for NY, 1 for LA) then you can test whether list price has a significantly greater or lower effect on sale price in different cities (via a null hypothesis test of $$\beta_3=0$$). If you standardize the prices in each city before analyzing the data (i.e. subtract each city's list prices and sale prices by the mean and divide by the standard deviation for that particular city), then testing $$\beta_3$$ will essentially give you a test of the differences in predictive accuracy (with the caveat that you'd be assuming that the residual variance is the same in both cities).