subject
Physics, 26.01.2021 01:40 gabrielduboy

Load the lars package and the New York Housing dataset (as in the attached file for download). Next, load the glmnet package that will be used to implement LASSO.
Save the MEDV as y and only use the first 12 variables (i. e., columns in New York Housing dataset) as x. While x is a set of independent variables, y is the dependent variable which is a quantitative measure of the median housing values. (Hints: can assign matrix format to the variable x).
Generate separate scatterplots with the line of best fit for all the predictors in x with y on the vertical axis.
Regress y on the predictors in x using OLS (Ordinary Least Square Regression). We will use this result as benchmark for comparison.
Use the glmnet function to plot the path of each of x's variable coefficients against the L1 norm of the beta vector. This graph indicates at which stage each coefficient shrinks to zero.
Use the cv. glmnet function to get the cross validation curve and the value of lambda that minimizes the mean cross validation error.
Using the minimum value of lambda from the previous exercise, get the estimated beta matrix.
To get a more parsimonious model we can use a higher value of lambda that is within one standard error of the minimum.
Use this value of lambda to get the beta coefficients. Note that more coefficients are now shrunk to zero.
Please refer to Example 6.1 and 6.2 of Chapter 6 in our textbook for details regarding how LASSO works so you know how to explain your results in this assignment.

ansver
Answers: 2

Another question on Physics

question
Physics, 21.06.2019 19:30
Is it possible to use the energy from two atoms colliding to create a clean burning lasting fuel source with a large amount of force? is it also possible to harness that energy from the two atoms colliding to create a clean energy source that will last for years from just two atoms colliding. is there a possibility to control and store that energy for years but slowly let the energy out enough to power cities cheaper and faster.
Answers: 3
question
Physics, 21.06.2019 21:50
What is the length x of the side of the triangle below? (hint: use the cosine function)
Answers: 1
question
Physics, 22.06.2019 01:00
When you turn on a battery-operated device, an electrical circuit is
Answers: 1
question
Physics, 22.06.2019 08:00
The arrival of in the early days of europa’s existence could have formed its ocean. it is likely that the water experienced similar to earth. it is also possible that this water is retained beneath europa’s surface and in its atmosphere due to europa’s . 1.) a. precipitation b. water vapor c. icy debris 2.) a. gravitational compression b. biochemical cycling c. radiogenic heating 3.) a, gravity b. magnetic field c. heat energy for plato
Answers: 3
You know the right answer?
Load the lars package and the New York Housing dataset (as in the attached file for download). Next...
Questions
question
Health, 07.10.2019 06:30
question
Mathematics, 07.10.2019 06:30
question
Social Studies, 07.10.2019 06:30
question
Mathematics, 07.10.2019 06:30
question
Business, 07.10.2019 06:30
Questions on the website: 13722363