In: Statistics and Probability
i want all part in R code
(1) The purity of oxygen produced by a fractionation process and the percentage of hydrocarbons in the main condensor of the processing unit, (2) The weight and systolic blood pressure of a group of males in the age group 25-30, (3) The number of pounds of steam used per month at a plant and the average monthly ambient temperature. Answer the following questions for each data sets. (i) Draw the scatter plot. (ii) Fit a simple linear regression model and draw the fitted regression line in the scatter plot. (iii) Report the fitted values and corresponding residuals. (iv) Calculate the coefficient of determination and comment. (v) Test whether intercept of the above model is zero. (vi) Test whether slope of the above model is zero. (vii) Construct analysis-of-variance table and comment. (viii) Find 95% confidence interval on the intercept. (ix) Find 95% confidence interval on the slope. (x) Find 95% confidence interval on the mean purity, symbolic blood pressure and steam usage when the hydrocarbon percentage, weight of a male in the age group 25-30 and average monthly ambient temperature are 1, 160 and 58 unit respectively. (xi) Find 95% prediction interval on the purity, symbolic blood pressure and steam usage when the hydrocarbon percentage, weight of a male in the age group 25-30 and average monthly ambient temperature are 1, 160 and 58 unit respectively. (xii) Compute and plot 95% confidence and prediction bands around the fitted line. (xiii) Which is the wider band and why?
p | H |
86.91 | 1.02 |
89.85 | 1.11 |
90.28 | 1.43 |
86.34 | 1.11 |
92.58 | 1.01 |
87.33 | 0.95 |
86.29 | 1.11 |
91.86 | 0.87 |
95.61 | 1.43 |
89.86 | 1.02 |
96.73 | 1.46 |
99.42 | 1.55 |
98.66 | 1.55 |
96.07 | 1.55 |
93.65 | 1.4 |
87.31 | 1.15 |
95 | 1.01 |
96.85 | 0.99 |
85.2 | 0.95 |
90.56 | 0.98 |