Question



Question 3: Consider the data of exercise 12-6 page 508. Drop column 4 (the data related to x4) and assume that y is function
7. bieli i uver Consumption TABLE 120-2 Cielu X3 X4 24 30 240 91 90 236 31 100 95 110 25 24 25 270 274 88 88 301 25 94 87 91
0 0
Add a comment Improve this question Transcribed image text
Answer #1

> data=read.csv(abc.csv")
> data
y x1 x2 x3 x4
1 240 30 24 91 100
2 236 31 25 90 95
3 270 45 24 88 110
4 274 60 25 87 88
5 301 65 25 91 94
6 316 72 26 94 105
7 300 80 25 87 97
8 296 84 25 86 100
9 267 75 24 88 110
10 276 60 25 95 105
11 288 50 25 90 100
12 261 38 23 89 98
> Lin=lm(y~x1+x2+x3,data=data)
> summary(Lin)

Call:
lm(formula = y ~ x1 + x2 + x3, data = data)

Residuals:
Min 1Q Median 3Q Max
-20.4714 -9.5878 -0.2082 11.7837 15.6250

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -59.1253 182.0786 -0.325 0.7537
x1 0.9649 0.3113 3.099 0.0147 *
x2 6.1437 7.7197 0.796 0.4491
x3 1.4407 1.9510 0.738 0.4813
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 15.27 on 8 degrees of freedom
Multiple R-squared: 0.7162, Adjusted R-squared: 0.6097
F-statistic: 6.728 on 3 and 8 DF, p-value: 0.01404




a)

> #71.62% of the variation is explained by the model



b)
> p=predict(Lin,data)
> p
1 2 3 4 5 6 7 8
248.3747 254.0426 258.5255 277.7015 288.2887 305.5086 296.9988 299.4175
9 10 11 12
287.4714 289.2272 272.3750 247.0685
> res=data$y-p
> par(mfrow=(c(2,2)))
> plot(res,p,xlab="Residual",ylab="Fit", main="Residual vs Fit")
> plot(res,data$x1,xlab="Residual",ylab="X1", main="Residual vs Predictor")
> plot(res,data$x2,xlab="Residual",ylab="X2", main="Residual vs Predictor")
> plot(res,data$x3,xlab="Residual",ylab="X3", main="Residual vs Predictor")


> #We observe that except for the Residual vs X2, each of the scatter plots does not follow any specific pattern. Hence, except for X2, other predictors as well as response values are homoskedastic.



c)
> library(olsrr)
> ols_plot_resid_stand(Lin)


> #There are no influential observation in the data



d)
> library(car)
> linearHypothesis(Lin, c("x1=0", "x3=0"))
Linear hypothesis test

Hypothesis:
x1 = 0
x3 = 0

Model 1: restricted model
Model 2: y ~ x1 + x2 + x3

Res.Df RSS Df Sum of Sq F Pr(>F)
1 10 4216.7
2 8 1865.6 2 2351 5.0407 0.03832 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> #Since, Pr(>F) is less than 0.05, the Null is rejected, and B1=B3=0 does not hold good.
>






I hope this answer will help you to a great extent. Thank You :)

Add a comment
Know the answer?
Add Answer to:
Question 3: Consider the data of exercise 12-6 page 508. Drop column 4 (the data related...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 2: Suppose that we wish to fit a regression model for which the true regression...

    Question 2: Suppose that we wish to fit a regression model for which the true regression line passes through the origin (0,0). The appropriate model is Y = Bx + €. Assume that we have n pairs of data (x1.yı) ... (Xn,yn). a) From first principle, derive the least square estimate of B. (write the loss function then take first derivative W.r.t coefficient etc) b) Assume that e is normally distributed what is the distribution of Y? Explain your answer...

  • Question 1 Consider the following Multiple Regression Model yı BoB1B2 + El, y2 BIB2E2 y3 B2Es,...

    Question 1 Consider the following Multiple Regression Model yı BoB1B2 + El, y2 BIB2E2 y3 B2Es, and y4 Bo+BI4 Suppose that & 's are independent and identically distributed N(0, o2 ) a) Write down the model in the matrix form b) Show that 2 2 1 X'X2 3 2 1.67 -1.33 0.33 (X'X) 1.67 Note that -1.33 -0.67 1 2 3 0.33 -0.67 0.67 c) Find unbiased estimators for Bo, Bi, and B2 given that y 3, y2 1, y3-...

  • 1. Forecast demand for Year 4. a. Explain what technique you utilized to forecast your demand....

    1. Forecast demand for Year 4. a. Explain what technique you utilized to forecast your demand. b. Explain why you chose this technique over others. Year 3 Year 1 Year 2 Actual Actual Actual Forecast Forecast Forecast Demand Demand Demand Week 1 52 57 63 55 66 77 Week 2 49 58 68 69 75 65 Week 3 47 50 58 65 80 74 Week 4 60 53 58 55 78 67 57 Week 5 49 57 64 76 77...

  • Question #2 - Review 'Cars Database'. From this data set develop the following: a. One bivariate...

    Question #2 - Review 'Cars Database'. From this data set develop the following: a. One bivariate regression b. One multiple regression c. Provide an effective chart displaying each of the two regressions. Charts should be presentation ready with effective title and labels. d. Provide a brief description of each of the two regressions (please use a text box in your Excel spreadsheet for your descriptions). Also, be sure to correctly identify and describe your independent and dependent variables, linear equation...

  • Compute Regression Analysis for following relationship: The relationship between death rate X1 (USD) vs. population density...

    Compute Regression Analysis for following relationship: The relationship between death rate X1 (USD) vs. population density X5. Population as a Predictor, X, then death rate as a Response variable, Y. Get Regression Output, and Scatter plot between these variables and compute Coefficient of Determination, R2, and Interpret your findings. X1  X2  X3   X4     X5   The data (X1, X2, X3, X4, X5) are by city.       8   78   284   9.1   109   X1 = death rate per 1000 residents       9.3   68   433   8.7   144...

  • 6. Suppose r0-0x8000, and the memory layout is as follows: Address Data 0x8007 0x8006 0x8005 0x8004...

    6. Suppose r0-0x8000, and the memory layout is as follows: Address Data 0x8007 0x8006 0x8005 0x8004 0x8003 0x8002 0x8001 0x8000 0x79 0xCD 0xA3 0xFD 0xOD 0xEB 0x2C 0x1A Suppose the system is set as little endian. What are the values of rl and r0 if the instructions are executed separately? (a) LDR (b) LDR (c) LDR (d) LDR rl, r1, r1, r1, [re] [r0, #41 [r0], #4 [r0, #41 ! r1 - r1 - r0 - Appendix 1: ASCII Table...

  • Plot the Frequency vs Speed and Cumalative Frequency vs Speed of the vehicles No. Speed (mph)...

    Plot the Frequency vs Speed and Cumalative Frequency vs Speed of the vehicles No. Speed (mph) 1 33.2 2 38.3 3 67.1 4 45.2 5 41.1 6 35.1 7 44 8 66.3 9 44.3 10 36.3 11 38.3 12 44.6 13 45.2 14 41.1 15 55.1 16 50.2 17 54.3 18 65.2 19 55.2 20 45.7 21 54.1 22 54 23 46.1 24 54.2 25 52.3 26 57.3 27 46.8 28 57.8 29 36.8 30 55.8 31 43.3 32 55.3...

  • The data here (data204.dat) is the LOS in months and wages for 60 women who work in Indiana banks. Wages are yearly tota...

    The data here (data204.dat) is the LOS in months and wages for 60 women who work in Indiana banks. Wages are yearly total income divided by the number of weeks worked. We have multiplied wages by a constant for reasons of confidentiality. (a) Plot wages versus LOS. Consider the relationship and whether or not linear regression might be appropriate. (Do this on paper. Your instructor may ask you to turn in this graph.) (b) Find the least-squares line. Summarize the...

  • 33 On May 6, Jim Ryan borrowed $14,000 from Lane Bank at 7 % interest. Jim...

    33 On May 6, Jim Ryan borrowed $14,000 from Lane Bank at 7 % interest. Jim plans to repay the loan on March 11. Assume the loan is on ordinary interest. How much will Jim repay on March 11? (Use Days in a year table) (Round your answer to the nearest cent.) Jm repay etbook 7-1 TABLE Exact days-in-a-year calendar (excluding leap year)" Day of month 30 31 30 31 28 31 30 31 31 30 31 31 Dec Mar...

  • Use C++ (2D Array) Write a program which: 1. Assigns data given below into the 2D...

    Use C++ (2D Array) Write a program which: 1. Assigns data given below into the 2D array of integers which is 10x10. 2. Prints out the contents of the 2D array after assigning the data to make sure correct data was assigned. 3. Figures out and prints out the square root of the sum of ALL the elements in the 2D array. 4. Figures out and prints out the average of ALL THE ELEMENTS in the 2D array. 5. Figures...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT