In: Advanced Math
For this question you must give all answers rounded correct to exactly 3 significant figures (instead of decimal places). Recall that leading zeros are not significant (for example 0.0011 has 4 decimal places, but only 2 significant figures). To obtain more decimal places in the numbers Matlab gives you, type "format short g" first.
The article "The Incorporation of Uranium and Silver by Hydrothermally Synthesized Galena'" (Econ. Geology, 1964: 1003-1024) reports on the determination of silver content of galena crystals grown in a closed hydrothermal system over a range of temperature. The temperature X in degrees C and the silver content Y in mol% for 60 determinations are shown below.
x=[391.52 588.45 366.17 540.96 596.58 514.95 475.69 474.88 351.61
436.63 456.86 488.38 374.74 443.82 351.54 565.11 590.69 522.42
381.72 518.06 352.58 536.14 517.94 489.33 421.54 441.43 519.61
481.52 395.17 575.51 499.37 498.19 389.48 458.26 475.10 447.75
494.49 501.62 543.59 371.33 533.00 469.43 408.83 381.22 404.12
351.36 539.92 355.98 428.00 365.14 568.20 577.03 551.79 421.29
486.85 380.51 572.39 526.76 444.83 510.46]
y=[0.24746 0.55195 0.12887 0.55539 0.66253 0.51603 0.26968 0.39588
0.17175 0.18485 0.47286 0.13409 0.45080 0.14408 0.17320 0.45023
0.59793 0.61566 0.47474 0.29009 0.17034 0.53198 0.60392 0.39073
0.06488 0.36118 0.45917 0.23497 0.32195 0.50951 0.51063 0.51979
0.53781 0.36905 0.53801 0.38265 0.27017 0.28500 0.52003 0.11500
0.38495 0.27878 0.44189 0.04065 0.18611 0.26634 0.44847 0.21019
0.19065 0.01236 0.62531 0.49826 0.29920 0.23947 0.31029 0.29353
0.38524 0.63588 0.25503 0.44352]
(a) Fit the linear regression of Y on X using Matlab. What is the estimated intercept term β^0?
(b) What is the estimated slope of the fitted line, β^1?
(c) What is the estimated residual variance s2e?
(d) What is the standard error for β^1?
(e) Give a 95% confidence interval for β^1.
Enter your confidence interval in the form (lower bound, upper bound).
( , )
(f) What is the predicted silver content of galena crystals grown at 500 degrees C?
(g) Construct a 95% prediction interval for silver content when crystals are grown at 500 degrees C.
Enter your prediction interval in the form (lower bound, upper bound).
( , )
SOLUTION
Given that,
x=[391.52 588.45 366.17 540.96 596.58 514.95 475.69 474.88 351.61 436.63 456.86 488.38
374.74 443.82 351.54 565.11 590.69 522.42 381.72 518.06 352.58 536.14 517.94 489.33 421.54
441.43 519.61 481.52 395.17 575.51 499.37 498.19 389.48 458.26 475.10 447.75 494.49 501.62
543.59 371.33 533.00 469.43 408.83 381.22 404.12 351.36 539.92 355.98 428.00 365.14 568.20
577.03 551.79 421.29 486.85 380.51 572.39 526.76 444.83 510.46]
y=[0.24746 0.55195 0.12887 0.55539 0.66253 0.51603 0.26968 0.39588
0.17175 0.18485 0.47286
0.13409 0.45080 0.14408 0.17320 0.45023 0.59793 0.61566 0.47474 0.29009 0.17034 0.53198
0.60392 0.39073 0.06488 0.36118 0.45917 0.23497 0.32195 0.50951 0.51063 0.51979 0.53781
0.36905 0.53801 0.38265 0.27017 0.28500 0.52003 0.11500 0.38495 0.27878 0.44189 0.04065
0.18611 0.26634 0.44847 0.21019 0.19065 0.01236 0.62531 0.49826 0.29920 0.23947 0.31029
0.29353 0.38524 0.63588 0.25503 0.44352]
df<-data.frame(x,y)
mod<-lm(y~x,data=df)
mod
summary(mod)
===========================================================================
A) Fit the linear regression of Y on X using Matlab. What is the estimated intercept term β^0?
Intercept = -0.205157
===========================================================================
B) What is the estimated slope of the fitted line, β^1?
Slope of Beta_1= 0.001190
===========================================================================
C) What is the estimated residual variance s2e?
Se^2=(0.1534)^2=0.02353156
===========================================================================
D) What is the standard error for β^1?
Std error= 0.000277
===========================================================================
E) Give a 95% confidence interval for β^1.
==> newx<- data.frame( x = c(500))
==> predict (mod, newdata = newx, interval = "confidence",level = 0.95)
fit lwr upr
1 0.3899983 0.3484743 0.4315223
Fit is the value at x= 500 and lwr and upr are 95% confidence interval.
95% confidence interval = ( 0.3485, 0.4315)
===========================================================================
F) x = 500
ŷ = -0.188 + 0.00117 (500)
ŷ = 0.397
===========================================================================
G) ŷ ± tn-2 se
= 0.397 ± (1.6715) (0.1241)
= 0.397 ± 0.2074
= (0.1896, 0.6044)
===========================================================================