12.07.2015 Views

Analytical Chem istry - DePauw University

Analytical Chem istry - DePauw University

Analytical Chem istry - DePauw University

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 5 Standardizing <strong>Analytical</strong> Methods195The last section of the regression summary provides the standard deviationabout the regression (residual standard error), the square of the correlationcoefficient (multiple R-squared), and the result of an F-test on themodel’s ability to explain the variation in the y values. For a discussion ofthe correlation coefficient and the F-test of a regression model, as well astheir limitations, refer to the section on using Excel’s data analysis tools.See Section 4F.2 and Section 4F.3 for areview of the F-test.Predicting t h e Un c e r t a i n t y in C A Gi v e n S s a m pUnlike Excel, R includes a command for predicting the uncertainty in ananalyte’s concentration, C A , given the signal for a sample, S samp . This commandis not part of R’s standard installation. To use the command you needto install the “chemCal” package by entering the following command (note:you will need an internet connection to download the package).> install.packages(“chemCal”)After installing the package, you will need to load the functions into Rusing the following command. (note: you will need to do this step each timeyou begin a new R session as the package does not automatically load when youstart R).> library(“chemCal”)The command for predicting the uncertainty in C A is inverse.predict,which takes the following form for an unweighted linear regressioninverse.predict(object, newdata, alpha = value)where object is the object containing the regression model’s results, newdatais an object containing values for S samp , and value is the numerical value forthe significance level. Let’s use this command to complete Example 5.11.First, we create an object containing the values of S samp> sample = c(29.32, 29.16, 29.51)and then we complete the computation using the following command> inverse.predict(model, sample, alpha = 0.05)producing the result shown in Figure 5.24. The analyte’s concentration, C A ,is given by the value $Prediction, and its standard deviation, s C , is shownAas $`Standard Error`. The value for $Confidence is the confidence interval,±ts C , for the analyte’s concentration, and $`Confidence Limits` providesAthe lower limit and upper limit for the confidence interval for C A .You need to install a package once, butyou need to load the package each timeyou plan to use it. There are ways to configureR so that it automatically loadscertain packages; see An Introduction to Rfor more information (click here to view aPDF version of this document).Us i n g R f o r a We i g h t e d Li n e a r Re g r e s s i o nR’s command for an unweighted linear regression also allows for a weightedlinear regression by including an additional argument, weights, whose valueis an object containing the weights.lm(y ~ x, weights = object)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!