subject
Mathematics, 11.03.2020 01:55 smartie80

For this exercise use the prostate dataset from the faraway package. Use ?prosate to learn about the dataset. The goal of this exercise is to fit a model with lpsa as the response and the remaining variables as predictors.

(a) Obtain the estimated regression coefficients without the use of lm() or any other built-in functions for regression. That is, you should use only matrix operations. Store the results in a vector beta_hat_no_lm. To ensure this is a vector, you may need to use as. vector(). Return this vector as well as the results of sum (beta_hat_no_lm).
(b) Obtain the estimated regression coefficients with the use of lm(). Store the results in a vector beta_hat_lm. To ensure this is a vector, you may need to use as. vector (). Return this vector as well as the results of sum (beta_hat_lm).
(c) Use the all. equal() function to verify that the results are the same. You may need to remove the names of one of the vectors. The as. vector() function will do this as a side effect, or you can directly use unname().
(d) Calculate se without the use of lm(). That is, continue with your results from (a) and perform additional matrix operations to obtain the result. Output this result. Also, verify that this result is the same as the result obtained from lm().
(e) Calculate R² without the use of lm(). That is, continue with your results from (a) and (d) and perform additional operations to obtain the result. Output this result. Also, verify that this result is the same as the result obtained from lm().

ansver
Answers: 1

Another question on Mathematics

question
Mathematics, 21.06.2019 15:00
With these: 18/36 = 1/? missing number change 1 5/8 to improper fraction. change 19/5 to a mixed number.
Answers: 1
question
Mathematics, 21.06.2019 19:30
Julian wrote the following numeric pattern on the board3,10,17,24,31,38.what numbers of julian's pattern are compound numbers.
Answers: 2
question
Mathematics, 22.06.2019 01:50
If f (x) = 2x2 +5/(x-2), complete the following statement: f(6) =
Answers: 3
question
Mathematics, 22.06.2019 01:50
One cell phone plan charges $20 per month plus $0.15 per minute used. a second cell phone plan charges $35 per month plus $0.10 per minute used. write and solve an equation to find the number of minutes you must talk to have the same cost for both calling plans.
Answers: 2
You know the right answer?
For this exercise use the prostate dataset from the faraway package. Use ?prosate to learn about the...
Questions
Questions on the website: 13722367