From predictors to a checked regression prediction
A regression model is a specified rule for predicting a response from observed inputs. Building one requires choosing terms, interpreting their coding, and checking predictions on data kept separate from fitting. A fitted association describes the model's predictions; by itself, it does not establish a causal effect.
Specify the predictors
For a numeric predictor x and a two-level category, an additive rule can be y^=β0+β1x+β2I(B). The indicator I(B) equals 1 for group B and 0 for group A, the reference group. Thus β0+β1x predicts A, while β2 is the B-minus-A prediction at the same x.
With an intercept in this two-group model, adding indicators for both A and B creates exact redundancy because they sum to 1.
If the relationship with x may differ by group, an interaction xI(B) allows different slopes; then the group contrast depends on x. Choose such terms from the question and available evidence, rather than assuming that extra terms always improve future predictions.
Worked example
Suppose a hypothetical tutoring model predicts score as 41+5h+7I(remote), where h is tutoring hours and in-person is the reference category. For a remote student with two hours, the prediction is 41+5(2)+7=58 points.
For an in-person student with two hours, it is 41+5(2)=51 points. The seven-point contrast compares the groups at the same hours; it is a model prediction, not proof that remote tutoring causes a seven-point gain.
Check predictions
Evaluate prediction errors on held-out data that were not used to fit coefficients, preprocess inputs, or choose settings. If three held-out score errors are −1, 2, and 4 points, mean absolute error is (1+2+4)/3=7/3 points. Root mean squared error is (1+4+16)/3=7 points. Both retain response units, but squaring before averaging makes the larger miss count more in the latter measure.
A regression gives held-out prediction errors of 2, −3, and 1 dollars. What is its mean squared error in squared dollars?
A fitted model is predicted y = 30 + 4x + 6I(B) − 2xI(B). What is predicted y for group B at x = 3?