Home Page > > Details

**Question 3: Stata exercise**

Use the dataset housing.dta to perform. the following exercises on Stata. Description of the data can be found in the file “About housing dataset.pdf”. We are interested in predicting the median house prices (MEDV ) using all the 13 independent variables as given in the data set.

(i) Estimate a linear regression model that relates the median house prices (MEDV ) to the 13 independent variables given in the dataset, using all sample values. (Note: for this part, let the coefficient standard errors be computed as default by Stata). Report and interpret the coefficient estimate of the variable CHAS. Is CHAS significant in predicting MEDV at the 1% level ?

(ii) Plot the residuals against the fitted values, to check for the presence of heteroskedasticity. Also perform. White’s heteroskedasticity test and interpret the result you obtain, considering a significance level of 5%.

(iii) If the errors are heteroskedastic, what issue is this likely to cause for the OLS output obtained in part (i)? Report the least squares output again after correcting for that issue. Is CHAS now significant in predicting MEDV at the 1% level ? We now want to compare different model fitting procedures for predicting median house prices using a linear model (you may ignore heteroskedasticity for the questions below).

Sample splitting:

(iv) Split the data set into a training set and a validation set, in a 70-30% ratio. You can use approximate ratios to round off the number of observations in each set to integer values. Use the random-number seed as 12345 in creating the random split. State how many observations are there in the training and the validation sets.

(v) Fit a linear model using least squares on the training set. Report and interpret the R2 obtained. (Remember to store the ols results for later analysis)

Ridge regression:

(vi) Fit a ridge regression model on the training set, with λ chosen by 10-fold cross-validation (use the random-number seed as 12345). Report the chosen λ value obtained. (Remember to store the ridge results for later analysis)

(vii) Report the ridge coefficients (unstandardised) obtained at the selected value of λ. Compare with least squares estimates obtained in part (v).

(viii) Plot the ridge coefficients (unstandardised) against λ. Comment on the nature of the ridge coefficient paths you observe as the tuning parameter λ increases

The lasso:

(ix) Fit a lasso model on the training set, with λ chosen by 10-fold cross-validation (use the random-number seed as 12345). Report the chosen λ value obtained. (Remember to store the lasso results for later analysis)

(x) Report the number of predictors selected by the lasso at the chosen λ.

(xi) Plot the lasso coefficients (unstandardised) against λ. Comment on the nature of the lasso coefficient paths you observe as the tuning parameter λ increases.

Comparison:

(xii) Using the coefficient paths obtained for ridge and the lasso in parts (viii) and (xi) respectively, compare the nature of ridge and lasso coefficients when λ lies in the range of 0.01 to 10: which method between ridge and lasso performs variable selection? Which one causes shrinkage of coefficients?

(xiii) Compare the mean square error (MSE) and R2 for the least squares, ridge regression and the lasso fitting procedures, for both the training versus the validation sets. Comment on your results.

Contact Us(Ghostwriter Service)

- QQ：99515681
- WeChat：codinghelp
- Email：99515681@qq.com
- Work Time：8:00-23:00

- Ghostwriter Assign Q5debug R Programmi... 2024-06-19
- Ghostwriter Cs 231, Spring 2024 Assign... 2024-06-19
- Ghostwriter Mat 181 Programming For Sc... 2024-06-19
- Ghostwriter Ictten622 Produce Ict Netw... 2024-06-19
- Ghostwriter Cnit 17600 - Intro Compute... 2024-06-19
- Ghostwriter Eco3420 Financial Economic... 2024-06-19
- Ghostwriter Assessment 3: Projecthelp ... 2024-06-19
- Ghostwriter Ec 2 Principles Of Macroec... 2024-06-19
- Help With Cnit 17600 - Intro Computer ... 2024-06-19
- Help With Chemistry 30 Unit D Module 7... 2024-06-19
- Help With Avia 3410: Assignment 1Debug... 2024-06-19
- Ghostwriter Lineare Algebra Ii 2024Hel... 2024-06-19
- Ghostwriter Homework #1 - Mpcs 52072 -... 2024-06-19
- Ghostwriter Ma 134 Calculus I Spring 2... 2024-06-19
- Help With Fin3020s Introduction To Mac... 2024-06-19
- Help With 11175 Introduction To Econom... 2024-06-19
- Ghostwriter Fins5568 Capstone - Portfo... 2024-06-19
- Help With Mpcs 52072 - Gpu Programming... 2024-06-19
- Help With Chem 233 Assignment 4Help Wi... 2024-06-19
- Ghostwriter Efim20036: Limited Depende... 2024-06-19

Contact Us - Email：99515681@qq.com WeChat：codinghelp

© 2021 www.asgnhelp.com

Programming Assignment Help！