I am trying to create a linear model to predict House Price ($y$). The predictors in the dataset are Area (continuous) & Location (factor: West, Midwest, South, Northeast). I am asked to assess the effect of Location on House Price after adjusting for Area.

Is it correct that the model I am interested in is $$y_i = \beta_0 + \beta_1 \times \text{Area} + \beta_2 \times \text{West} + \beta_3 \times \text{Midwest} + \beta_4 \times \text{South} + \beta_5 \times \text{Northeast}.$$

Then I need to determine the predicted mean House Price for each Location when holding Area fixed at its mean. What does this mean? Would the mean House Price for West just be $\beta_0 + \beta_2$?


2 Answers 2


For "predicted mean house price when holding area fixed at its mean" they're asking you to solve for Y-hat (predicted Y) when you plug in the mean value of area into the equation and add the value of the coefficient for "West".

𝑦𝑖=𝛽0+𝛽1×(PLUG IN MEAN VALUE OF AREA)+𝛽2×(1)+𝛽3×(0)+𝛽4×(0) [assuming you used Northeast as the base level and assuming "West" is coded 1 if West, 0 if not and the others are similarly coded].

Also, I would say that in order to use this model you would first want to fit a complete, second-order model with interactions of area and location if you have data to do so because the effect of area on price may be quadratic in area (diminishing returns, so to speak), and the effect of area may depend on the location (or effect of location may depend on area). You could then do a nested F-test on all of the interaction terms and retain them in the model if the test is significant. You could then do a t-test on the curvature (area-squared) term and retain if significant. There are other ways to approaching the actual retention of terms portion, though.

If this is a homework problem, and you have not covered interaction or squared terms in the models, then disregard those parts as they likely want you to fit a model like yours (but as another poster mentioned, with k-1 dummy variables for k locations).

Finally, the mean house price for West would be beta zero + beta 2 IF and only IF the area is equal to zero sq ft, which is nonsensical. So this tells you that a plausible (preferably in sample) value of area be chosen to plug in to get the mean value of price for West (they tell you to use average area).


Fitting a linear regression model on your training data will give a collection of values for each of the coefficients $\beta$ (notice that if your categorical variable has $N$ levels you only need $N-1$ predictors, the resulting coefficients representing the shifts with respect to the level you choose as base).

Once you have trained your model you are ready to make predictions by plugging in the set of unseen features. In your example:

  • $\beta_0$ is constant
  • $\beta_1$ must be multiplied by the average area from within your training data
  • $\beta_j$ = 1 only for the location of your choice
  • $\begingroup$ Okay I think I understand that much. Do you know how to interpret "predicted mean House Price when holding Area fixed at its mean"? $\endgroup$
    – antsatsui
    Feb 28, 2019 at 1:08
  • $\begingroup$ @gented, the comment isn't helpful, as the OP stated there was difficulty understanding the meaning of the question. $\endgroup$
    – LSC
    Mar 1, 2019 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.