Skip to main content

Week 6 — instructor solutions

Multiple regression, dummies and model evaluation

Author

ETX1100 / ETX5900

The worked real-estate model uses Week 6 real-estate data, with Price in AUD thousands and predictors Beds, Baths, Cars, Area. The training example uses underwriting data. Other justified reduced specifications may be acceptable if compared honestly.

Download the Week 6 worked Excel workbook.

Partial slopes and ToolPak output

Watch me: simple versus multiple slopes / Now you try: interpret partial slopes

SolutionSolution 1

For Price on Area alone, the Area slope is 1.0928 AUD thousand per m², SE 0.0880. With Beds, Baths, Cars and Area, it is 0.8313, SE 0.0757. The latter compares properties differing by one square metre at the same values of the other included features. In the displayed slide equation, one additional bathroom corresponds to AUD 216,500 higher predicted price, and one additional m² to AUD 831 higher predicted price, holding the other three predictors constant. These are observational conditional associations, not causal effects.

Watch me: fit a real-estate model / Now you try: reconstruct the model

SolutionSolution 2

Select Price as Y and the contiguous Beds:Area block as X, with Labels and residual output. The fitted equation is

\[\widehat{Price}_{000}=86.841+47.426\,Beds+216.533\,Baths+14.544\,Cars+0.831267\,Area.\]

A bedroom adds about AUD 47,426 and a bathroom about AUD 216,533 to predicted mean price at fixed other predictors. The intercept describes a property with zero bedrooms, bathrooms, cars and area; it has no useful business interpretation. For the first observed property (3 beds, 2 baths, 2 cars, 331 m²), fitted price is approximately AUD 966,424; observed price is AUD 1,100,000, so residual is approximately AUD 133,576. Use full ToolPak coefficients to reproduce the exact residual.

Watch me: coefficient evidence / Now you try: decide what contributes

SolutionSolution 3
Predictor Coefficient (AUD 000s) SE Two-sided p-value
Beds 47.426 22.866 0.0389
Baths 216.533 21.408 <0.0001
Cars 14.544 22.774 0.5235
Area 0.8313 0.0757 <0.0001

At 5%, Beds, Baths and Area show evidence of a conditional contribution; Cars is a candidate for removal. Check each \(t=\hat\beta/SE\) and its confidence interval against zero. A large p-value does not establish a zero effect: collinearity, sample size and business purpose matter. Car spaces may still belong in a valuation model if they are a known property feature or help avoid omitted-variable bias.

Now you try: compare two models / Watch me: refit and compare / Now you try: model recommendation

SolutionSolution 4

A defensible reduction drops Cars, stated before reviewing the refit. The reduced equation is

\[\widehat{Price}_{000}=94.295+51.363\,Beds+217.760\,Baths+0.83593\,Area.\]

Criterion Full: Beds, Baths, Cars, Area Reduced: Beds, Baths, Area
Adjusted \(R^2\) 0.59936 0.60009
Residual SE (AUD 000s) 265.16 264.92
Area slope 0.8313 0.8359
Baths slope 216.53 217.76

The reduced model is slightly simpler with nearly unchanged key slopes and marginally better adjusted fit. It predicts AUD 960,596 for the first property, versus observed AUD 1,100,000; residual AUD 139,404. Residuals still include large errors (about −AUD 609,000 to +AUD 1.60 million in the full model), so inspect the plots and report uncertainty. The model is associational, may omit location and condition, and should be used cautiously outside the observed feature ranges.

Watch me: separate model and coefficient claims / Now you try: interpret the ANOVA block

SolutionSolution 5

The overall test is \(H_0:\beta_{Beds}=\beta_{Baths}=\beta_{Cars}=\beta_{Area}=0\) versus at least one non-zero slope. Full-model Significance F is about \(6.0\times10^{-64}\); reject at 5%. The predictor set has an overall linear relationship with price, but Cars’ individual p-value is 0.5235. The F test does not prove every slope differs from zero.

Categorical predictors

Watch me: create training-method dummies / Now you try: verify the coding

SolutionSolution 6

Use =IF(C2="classroom",1,0) and =IF(C2="online",1,0) if Method is in C; Excel text comparison is case insensitive. Courseware app rows are (0,0), classroom (1,0), online (0,1). There are 10 rows per method. Check two rows from each group. Do not include a third courseware dummy with an intercept: the three dummies would sum to one, causing exact collinearity. A new online trainee has (0,1).

Now you try: underwriting model

SolutionSolution 7

With courseware app as base, the fitted score equation is

\[\widehat{Score}=-63.981+1.12578\,Proficiency-22.289\,DClassroom+8.088\,DOnline.\]

Each one-point higher proficiency is associated with 1.126 higher predicted end-of-training score at fixed method. At equal proficiency, classroom is 22.29 points lower than courseware; online is 8.09 points higher. At proficiency 100, predictions are 48.60 (courseware), 26.31 (classroom), 56.68 (online). Proficiency and classroom coefficients have p-values <0.001; online has 0.0719, so its difference from courseware is not statistically clear at 5%. Adjusted \(R^2=\mathbf{0.7610}\); overall Significance F is about \(7.53\times10^{-9}\). These are conditional associations, not proof that changing training method causes a score change.

Diagnostics

Watch me: refit and compare / Now you try: model recommendation

SolutionSolution 8

The Cars removal above is one defensible full-to-reduced comparison. A short recommendation can use the reduced equation, explain the Baths and Area slopes, report the full-model F test and the reduced model’s adjusted \(R^2\) and residual SE, and predict the first property as above. It should acknowledge the large residuals and absent location/condition information. Compare residual-versus-fitted plots for pattern and spread before final use; numerical fit alone does not establish assumptions. If Cars is important to a particular valuation decision, retaining the full model is also defensible despite its large p-value.

Retrieval and closing checks

A simple-regression slope is the fitted mean response change per one-unit increase in its sole X. \(R^2\) is the share of sample Y variation explained by the fitted linear model. Residuals reveal misfit that aggregate metrics can hide. An omitted variable related to both X and Y can change the simple slope when included. For multiple regression, confirm the Y and contiguous X ranges, interpret slopes conditionally, distinguish coefficient tests from the overall F test, compare adjusted fit and residuals, and code every categorical base explicitly before predicting.