These data, taken from a chemical plant, relate a dependent variable, y (amount
ID: 3281820 • Letter: T
Question
These data, taken from a chemical plant, relate a dependent variable, y (amount of suspended solids in a coal cleansing system, mg/L) to two independent variables, x, pH level of the cleansing tank, and an indicator or dummy variable, the polymer type use in the experiment y 292 329 352 378 392 410 198 227 277 297 364 375 167 225 247 268 288 342 x 6.5 6.9 7.8 8.4 8.8 9.2 6.7 6.9 7.5 7.9 8.7 9.2 6.5 7.0 7.2 7.6 8.7 9.2 a) Attach a graph plotting y vs x, but with a different symbol for each polymer b) For the simple linear regression model (ignoring polymers) find R2 L-S line intercept: , slope: c) Fit the model with common slope, but different intercepts for each polymer Intercepts: polymer 1: polymer 2: ; polymer 3 common slope d). Now add fit the (full) model allowing for different slopes as well as different intercepts. Give the intercept and slope for each polymer type Intercepts: polymer 1: slopes:polymer 1: .; polymer 2: polymer 2 -, polymer 3: polymer 3 Also find: R2 = e) Consider the three models: (G) simple,(ii) same slope/different intercepts, and (ii) different slopes/different intercepts. Write a few lines on which model you would use and why f) Consider the three models: Model I - Simple linear regression model, Model II - One common slope and separate intercepts, Model III - Separate slopes and separate nterepts,Give F-statistics, degrees of freedom, and P-values for testing the following null hypotheses i) Model I is not improved by the addition of separate intercepts (Ho: B2-B 0) 0) i) Model II is not improved by the addition of separate slopes (Ho: B4 Bs F-df;P- value-Explanation / Answer
> y1=c(292,329,352,378,392,410)
> y2=c(198,227,277,297,364,375)
> y3=c(167,225,247,268,288,342)
> y=c(y1,y2,y3)
> y
[1] 292 329 352 378 392 410 198 227 277 297 364 375 167 225 247 268 288 342
> x1=c(6.5,6.9,7.8,8.4,8.8,9.2)
> x2=c(6.7,6.9,7.5,7.9,8.7,9.2)
> x3=c(6.5,7,7.2,7.6,8.7,9.2)
> x=c(x1,x2,x3)
> x
[1] 6.5 6.9 7.8 8.4 8.8 9.2 6.7 6.9 7.5 7.9 8.7 9.2 6.5 7.0 7.2 7.6 8.7 9.2
> type=c(rep(1,6),rep(2,6),rep(3,6))
> type=as.factor(type)
> type
[1] 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3
Levels: 1 2 3
a)
> plot(x1,y1,pch=16,xlab="pH level",ylab="Amount of suspended solids",ylim=c(167,410),xlim=c(6,9.5))
> points(x2,y2,pch=16,col=2)
> points(x3,y3,pch=16,col=3)
> legend(8,225,c("Polymer 1","Polymer 2","Polymer 3"),col=c(1,2,3),lty=1)
b)> df=data.frame(y,x,type)
> df
y x type
1 292 6.5 1
2 329 6.9 1
3 352 7.8 1
4 378 8.4 1
5 392 8.8 1
6 410 9.2 1
7 198 6.7 2
8 227 6.9 2
9 277 7.5 2
10 297 7.9 2
11 364 8.7 2
12 375 9.2 2
13 167 6.5 3
14 225 7.0 3
15 247 7.2 3
16 268 7.6 3
17 288 8.7 3
18 342 9.2 3
> model1=lm(y~x,data=df)
> summary(model1)
Call:
lm(formula = y ~ x, data = df)
Residuals:
Min 1Q Median 3Q Max
-64.949 -27.086 -8.222 31.914 80.778
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -153.23 85.27 -1.797 0.0912 .
x 58.18 10.83 5.373 6.22e-05 *** -> SLOPE
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 43.59 on 16 degrees of freedom
Multiple R-squared: 0.6434, Adjusted R-squared: 0.6211
F-statistic: 28.87 on 1 and 16 DF, p-value: 6.221e-05
c)> model2=lm(y~x+type,data=df)
> summary(model2)
Call:
lm(formula = y ~ x + type, data = df)
Residuals:
Min 1Q Median 3Q Max
-31.038 -13.640 3.601 10.798 26.374
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -71.899 38.519 -1.867 0.083 . -> INTERCEPT FOR POLYMER 1
x 54.294 4.755 11.417 1.77e-08 *** -> SLOPE
type2 -62.832 11.010 -5.707 5.42e-05 *** -> INTERCEPT FOR POLYMER 2 = -71.889-62.832 = -134.721
type3 -89.998 11.052 -8.143 1.11e-06 ***-> INTERCEPT FOR POLYMER 2 = -71.889-89.998 = -161.887
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 19.05 on 14 degrees of freedom
Multiple R-squared: 0.9404, Adjusted R-squared: 0.9277
F-statistic: 73.68 on 3 and 14 DF, p-value: 8.14e-09
d)> model11=lm(y1~x1)
> summary(model11)
Call:
lm(formula = y1 ~ x1)
Residuals:
1 2 3 4 5 6
-9.1237 11.7713 -1.4650 0.3775 -1.7275 0.1674
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 39.417 25.197 1.564 0.192787
x1 40.263 3.152 12.772 0.000217 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 7.535 on 4 degrees of freedom
Multiple R-squared: 0.9761, Adjusted R-squared: 0.9701
F-statistic: 163.1 on 1 and 4 DF, p-value: 0.0002166
> model22=lm(y2~x2)
> summary(model22)
Call:
lm(formula = y2 ~ x2)
Residuals:
1 2 3 4 5 6
-12.141 2.616 9.885 1.399 11.425 -13.184
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -267.014 42.044 -6.351 0.003150 **
x2 71.217 5.343 13.328 0.000183 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 11.81 on 4 degrees of freedom
Multiple R-squared: 0.978, Adjusted R-squared: 0.9725
F-statistic: 177.6 on 1 and 4 DF, p-value: 0.0001832
> model33=lm(y3~x3)
> summary(model33)
Call:
lm(formula = y3 ~ x3)
Residuals:
1 2 3 4 5 6
-24.578 6.510 17.745 17.216 -21.990 5.098
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -158.275 69.922 -2.264 0.08634 .
x3 53.824 9.012 5.972 0.00395 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 21.02 on 4 degrees of freedom
Multiple R-squared: 0.8992, Adjusted R-squared: 0.874
F-statistic: 35.67 on 1 and 4 DF, p-value: 0.003949
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.