{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# 420Hw12ans - STAT 420 Homework#12 ppm 0 0 0 50 50 50 75 75...

This preview shows pages 1–7. Sign up to view the full content.

STAT 420 Fall 2008 Homework #12 ppm mV 0 1.72 0 1.68 0 1.74 50 2.04 50 2.11 50 2.17 75 2.40 75 2.32 75 2.33 100 2.91 100 3.00 100 2.89 150 4.47 150 4.51 150 4.43 200 6.67 200 6.66 1. Chemists often use ion-sensitive electrodes (ISEs)to measure the ion concentration of aqueous solutions. These devices measure the migration of the charge of these ions and give a reading in millivolts ( mV ). A standard curve is produced by measuring known concentrations ( in ppm ) and fitting a line to the millivolt data. The table on the right gives the concentrations in ppm and the voltage in mV for calcium ISE. a) Plot the points mV ( y ) versus ppm ( x ). Does linear model seem to be appropriate here? b) Use the Box-Cox method to determine the best transformation on the response variable mV. c) In part (a), a linear model does not seem appropriate. Fit a quadratic model. Does it seem to provide a better fit? 200 6.57 > Hw12_1 = read.table("http://www.stat.uiuc.edu/~stepanov/420Hw12_1.dat", header=T) > Hw12_1 x y 1 0 1.72 2 0 1.68 3 0 1.74 4 50 2.04 5 50 2.11 6 50 2.17 7 75 2.40 8 75 2.32 9 75 2.33 10 100 2.91 11 100 3.00 12 100 2.89 13 150 4.47 14 150 4.51 15 150 4.43 16 200 6.67 17 200 6.66 18 200 6.57

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
> attach(Hw12_1) a) > plot(x,y) > abline(lm(y~x)\$coefficients,lty=2) Linear model does NOT seem to be appropriate here. b) > library(MASS) > boxcox(fit,plotit=T) > boxcox(lm(y~x),plotit=T,lambda=seq(-1.0,-0.4,by=0.01)) λ – 0.7 seems to give the best transformation of the response variable.
> fit1 = lm(y^(-0.7) ~ x) > plot(x,y^(-0.7)) > abline(fit1\$coefficients) > xx = seq(0,200,by=0.1) > yy = (fit1\$coefficients[1]+fit1\$coefficients[2]*xx)^(1/(-0.7)) > plot(x,y) > lines(xx,yy) > par(mfrow=c(2,2)) > plot(fit1)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
c) > fit2 = lm(y ~ x + I(x^2)) > plot(fit2) > yy2 = fit2\$coefficients[1] + fit2\$coefficients[2]*xx + fit2\$coefficients[3]*xx^2 > par(mfrow=c(1,1)) > plot(x,y) > lines(xx,yy2) > summary(fit2) Call: lm(formula = y ~ x + I(x^2)) Residuals: Min 1Q Median 3Q Max -0.085354 -0.047679 -0.004113 0.035984 0.143329 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.735e+00 3.442e-02 50.410 < 2e-16 *** x -3.772e-04 7.688e-04 -0.491 0.631 I(x^2) 1.242e-04 3.605e-06 34.452 1.07e-15 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.06341 on 15 degrees of freedom Multiple R-squared: 0.9988, Adjusted R-squared: 0.9987 F-statistic: 6500 on 2 and 15 DF, p-value: < 2.2e-16
The linear term ( x ) is not significant. > fit3 = lm(y ~ I(x^2)) > yy3 = fit3\$coefficients[1] + fit3\$coefficients[2]*xx^2 > plot(x,y) > lines(xx,yy3) > lines(xx,yy2) > par(mfrow=c(2,2)) > plot(fit3) > summary(fit3) Call: lm(formula = y ~ I(x^2)) Residuals: Min 1Q Median 3Q Max -0.090685 -0.046398 -0.004792 0.036580 0.142152 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.722e+00 2.028e-02 84.89 <2e-16 *** I(x^2) 1.225e-04 1.049e-06 116.82 <2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.06188 on 16 degrees of freedom Multiple R-squared: 0.9988, Adjusted R-squared: 0.9988 F-statistic: 1.365e+04 on 1 and 16 DF, p-value: < 2.2e-16

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}