EXPERIMENT 5. STATISTICS IN SCIENTIFIC MEASUREMENTS AND THE USAGE OF A SPREADSHEET PROGRAM Part I. Basic Statistics and Graphing (mainly for CHEM 1421 Lab) Section A. Average, Error, Deviation, Accuracy, Precision Section B. Scientific Plotting with a Spreadsheet. (Part I is not included in this Lab, please refer to the Contents under CHEM 1421 Lab.) Part II. Intermediate Statistics (mainly for CHEM 1422 Lab) Section A. Propagation of Random Errors Section B. Least Squares Analysis Part II. INTERTMEDIATE STATISTICS and LEAST SQUARES METHOD ( CHEM 1422 ) OBJECTIVE To introduce several intermediate concepts in statistics for scientific measurements and data analysis, propagation of errors and the least squares method in particular, and to utilize spreadsheet software for the regression analysis. BACKGROUND Section A. Propagation of Random Errors in Calculations The following rules and formulae should be used when one handles random errors (uncertainties) associated with measured quantities in scientific calculations. I. With Addition & Subtraction: When measured quantities are added or subtracted, the uncertainty in the results of operations is equal to the square root of a sum of squares of each absolute uncertainty in the measured values. Namely, (A) + (B) – (C) = (A+B-C) (2 + 2 +2)1/2 where , , and are the uncertainties in the measured quantities of A, B and C, (A+B-C) is the result, and (2 + 2 +2)1/2 is the absolute uncertainty in the result. 1 Example #1: Suppose that a 50.00mL buret was used to dispense 20.00mL of a dilute acid into a flask. The initial volume reading was 1.50 mL and the final volume reading was 18.65 mL. Uncertainty of the volume measured with the buret is 0.04 mL. What are the volume of the acid delivered and the uncertainty associated with it? Vdelivered = Vfinal - Vinitial = (18.650.04) – (1.500.04) mL = (18.65-1.50) (0.042 + 0.042)1/2 mL = 17.150.00321/2 mL = 17.15 0.06 mL II. With Multiplication and Division: When measured quantities are multiplied or divided, the absolute uncertainty in the results of operations is equal to the square root of a sum of each relative absolute uncertainty squared times the quantity being calculated. Namely, [(A)(B)] / (C) = AB/C (AB/C) [(/A)2 + (/B)2 +(/C)2]1/2 where , , and are the absolute uncertainties in the measured quantities of A, B and C, and /A, /B, and /C are the relative uncertainties in A, B and C. AB/C is the result, [(/A)2 + (/B)2 +(/C)2]1/2 is the relative uncertainty in the results, and (AB/C) [(/A)2 + (/B)2 +(/C)2]1/2 is the absolute uncertainty in the result. Example #2: A metal piece weighs 57.32 g with a Triple-Beam (Centigram) Balance. As the name suggests error with a centigram balance is 0.01g. Volume of the metal is found to be 6.5 0.6 mL as determined from the Water Displacement Method. What are the density of the metal and its uncertainty? Density = Mass/Volume = (57.320.01)g / (6.50.6) mL = (57.32/6.5) (57.32/6.5)[(0.01/57.32)2 + (0.6/6.5)2]1/2 g/mL = 8.818 8.818 [0.0001742 +0.0923082]1/2 g/mL = 8.818 8.818 (0.092308) g/mL = 8.82 0.81 g/mL = 8.8 0.8 g/mL Example #3 : A sample of a gas occupies a volume of 3.2 mL at 4.5 oC and 736 mmHg of pressure. Uncertainties in measurements of V, P & T are 0.2 mL, 0.5mmHg & 0.2 oC (or 0.2 K) respectively in the experiment. Find the number of moles of the gas and the uncertainty associated with it. (a) Without considering uncertainty, n = PV/RT = (736/760atm)(3.2mL) / [(0.082058 L atm/mol K) (4.5+273.15)K] 2 = (736/760atm)(0.0032L) / [(0.082058 L atm/mol K) (277.65) K] = 1.3597 x 10-4 mol = 1.36 x 10-4 mol = 1.4 x 10-4 mol (b) Considering uncertainty, n = ((7360.5)/760atm)(3.20.2mL) / ((0.082058 L atm/mol K) (277.650.2K)) = 1.36 x 10-4 mol 1.36 x 10-4 [(0.5/736)2+(0.2/3.2)2+(0.2/277.65)2]1/2 mol = 1.36 x 10-4 mol 1.36 x 10-4 (0.062507) mol = 1.36 x 10-4 mol 8.499 x10-6 mol = (1.36 x 10-4 0.08499 x10-4) mol = (1.36 x 10-4 0.08 x10-4) mol or = (1.4 x 10-4 0.1 x10-4) mol Section B. Least Squares Analysis - How do you to draw a best-fitting straight line through a set of scattered data ? Finding a trend line through a set of scattered data points is a routine practice among experimental scientists and engineers. In statistics, this practice is called a regression analysis. The Least Squares Method of Gauss is one of the most popularly employed regression methods. For a linear relationship of y= mx + b, Gauss first derived the following formulae for a slope (m) and an intercept (b) for a straight line that best-fits a set of n data points with coordinates (x1,y1), (x2,y2), . . (xi,yi), . . ., (xn,yn). m = (nxiyi- xiyi)/{nxi2-(xi)2} where, n is the number of measurements b = (yi - mxi)/n r = (nxiyi - xiyi)/[{nxi2 - (xi)2}{nyi2 - (yi)2}]½ r=0, if no correlation. r=1, if a perfect correlation Example #4 : From spectrophotometric measurements for a colored compound, the following data are obtained for absorbance and the concentration for a set of five standard solutions: 0.122 at 0.0250 M, 0.274 at 0.050 M, 0.477 at 0.100M, 0.776 at 0.150 M and 0.943 at 0.200 M. (1) Plot the data manually on graph paper, then draw a best-fitting straight line (estimate) through the points assuming a linear relationship between x and y (i.e., y=mx+b). (2) Calculate the slope(m) and intercept (b) from any two points which are on the line for the algebraic equation. (3) A solution of the same compound yielded an absorbance value of 0.350. What is the concentration? (4) If you have a solution of 0.240 mM, what do you expect the absorbance value to be? (5) Repeat (1) – (4) using spreadsheet software with the least squares method. Namely, find the best-fitting straight line using the least squares method, and give the algebraic formula for it. (6) Compare your result from the graph paper with the result from the spreadsheet. 3 You may try out (1) and (2) on your own at home. Here, however, only the lesat squares method with spreadsheet software will be illustrated. Solution # x(Conc, M) y(Abs) x squared y squared xy 1 2 3 4 5 Sum 0.025 0.050 0.100 0.150 0.200 0.525 0.103 0.274 0.476 0.802 0.970 2.625 0.000625 0.002500 0.010000 0.022500 0.040000 0.075625 0.010609 0.075076 0.226576 0.643204 0.940900 1.896365 0.002575 0.013700 0.047600 0.120300 0.194000 0.378175 m= b= r= 5.002 -0.000 0.995 Slope Intercept Corr. coeff. m = (nxiyi- xiyi)/{nxi2-(xi)2} = (5x0.378175–0.525x2.625) / (5x0.075625–0.5252) = 5.002 b = (yi - mxi)/n = (2.625 –5.002 x 0.525)/n = 0.000 r = (nxiyi - xiyi)/[{nxi2 - (xi)2}{nyi2 - (yi)2}]½ = (5x0.378175–0.525x2.625)/[{5 x 0.075625–0.5252}{5x1.896365-2.6252}]1/2 = 0.9949 As seen above, obtaining the slope and intercept with the least squares method involves many tedious calculations. In practice, one rarely goes through all of the calculations above. This is because the formulae for the slope, intercept and the correlation coefficient are already programmed into scientific calculators and coded into spreadsheet software (such as Lotus, QuattroPro and Excel). All one has to do is provide a set of x vs. y data to the program, and then call for m, b and r accordingly. One should refer to the manuals for calculators and spreadsheet software. A spreadsheet and an output from a Least Squares Program package using the same data are given below. This is performed with the QuattroPo for Windows(QPW). The constant is the intercept, the X coefficient is the slope. The correlation coefficient squared (R2) is given as a regression output instead of the correlation coefficient (R) to make the value positive.. 4 Therefore, y = mx +b = 5.002 x + 0.000 So y = 5.002 x The line for this equation along with the data point is given in the following figure. Beer's Law Plot Cobalt(II) Solution A b s o rb a n c e 1.20 1.10 1.00 0.90 0.80 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 -0.10 0.00 EXPTL LST SQ 0.05 0.10 0.15 Co(II) Concentration (in M) 5 0.20 0.25 Namely, (Absorbance) = 5.002 x (Concentration) And (Concentration) = (Absorbance) / 5.002 Therefore, the concentration of a solution that exhibits an absorbance of 0.350 must be: Concentration = (0.350/5.002) M = 0.06997M = 0.070 M . A solution of 0.120 M will exhibit an absorbance value of 0.0240: Absorbance = 5.002 x (Concentration) = 5.002x0.120 = 0.024 LAB EXERCISE with the Least Squares Method using QuattroPro Open the QuattroPro notebook named “CHEM1422.WB2” from the local A Drive with your Diskette in it. This can be done with the following steps. Selections to be clicked on are underlined. (1) Click (Double) on My Computer from the Windows Desktop. (2) Click on the A Drive. (2’) This is an alternative in case your diskette is defective. Click on the network M Drive (the Notebook Drive). Select the folder path as follows: Science Mkim C142xDISK (3) Click on CHEM1422.WB2 a. The first page (sheet) states the problem to be solved (tab label; Problem). b. Go to the next page for Workout_Long_Hand by clicking the next tab. c. Fill out the blank cells in the columns properly; type the formulae for m, b and r into appropriate cells to find the values of all three. d. Compare your answers with those given on the next page labeled Key_Long_Hand. Make sure they are the same. e. Next, try to find the same answers without going through all the calculations. Utilize the built-in least squares program in the spreadsheet software. Click on the next tab labeled Workout Program. f. Choose the following: Tools (from Menu) Numeric Tools Regression. Fill the blank properly for the cell addresses for both independent variable (x) and dependent variable (y), and fill in an address for the output. Click OK. g. Compare the results with those from the long-hand method. They should be identical, of course. h. Go to the next pages for the Homework. You have a week to finish it and hand it in as a lab report. 6 Instructions and examples of the least squares analysis with QuattroPro for Windows (QPW) this course can be found elsewhere. They are also in the Distribution Diskette and on the Course Website, and also in the Course Folder in the network M (Notebook) Drive. QPRO1421 file illustrates the least squares analysis with an example of the Beer’s Law Experiment from CHEM 1421 Lab. QPRO1422 file illustrates the least squares analysis with an example of the Vapor Pressure of Water Experiment from CHEM 1422 Lab. (end) (A:/e01_ISta.doc, 4/27/1999, rev. 5/5/1999, M. H. Kim) 7