Calculator program yielding confidence limits for least squares straight

Nov 1, 1976 - Calculator program yielding confidence limits for least squares straight line regression analysis. W. J. Blaedel and D. G. Iverson. Anal...
2 downloads 8 Views 200KB Size
ACKNOWLEDGMENT The authors thank Corning Glass Company for the porous Vycor. JLH thanks Louis Meites for his helpful suggestions.

used to change the porosity of the slurry after the slurry has been loaded into the electrode body, thus providing a mechanism for controlling the leakage rate of the reference electrode. Table I demonstrates the reproducibility of this method of preparation. Two different preparations of the amalgam were loaded into separate electrode assemblies. One electrode used the porous Vycor liquid junction as described previously ( 4 ) . The other electrode was a simple cracked glass junction electrode prepared from 7-mm Pyrex caning. The reduction of vanadium was examined polarographically and compared to the literature value of -1.31 V vs. Cd(H,, (4,6). Both cadmium amalgam preparations gave half-wave potentials for vanadium within one standard deviation of the value reported in the literature, regardless of the liquid junction. The stability of the electrolytically prepared cadmium amalgam reference electrode is attested to by the last entry of Table I. After four months of continual use, the half-wavepotential of vanadium Was Still -1.31 v VS. Cd(H,).

LITERATURE CITED (1) C. K. Mann and K. K. Barnes, “Electrochemical Reactions in Nonaqueous Systems”, Marcel Dekker, New York, 1970, p 18. (2) P. W. Jennings, D. G. Pillsbury, J. L. Hall, and V. T. Brice, J. Org. Chem., 41, 719 (1976). (3) L. W. Marple, Anal. Chem., 39, 844 (1967). (4) C. W. Manning and W. C. Purdy, Anal. Chin?.Acta, 51, 124 (1970). (5) “Handbook Of Chemistry and Physics, 51st ed.,”Chemical Rubber Company, Cleveland, Ohio, 1970. (6) C. W. Manning and W. C. Purdy, Anal. Chim. Acta, 51,483 (1970).

RECEIVEDfor review May 27, 1976. Accepted July 6,1976. Both JLH and PWJ thank The Endowment and Research Foundation of Montana State University for financial assistance.

CaOcuBaior Program Yielding Confidence Limits for Least Squares Straight Line Regaession Analysis W.9. Biaedel” and D. Q. lverson Department of Chemistry, University of Wisconsin, Madison, Wis. 53706

There are many calculator programs that fit X,Y data tot a straight line ( Y = A B X ) by least squares regression analysis. These programs give numerical values for the slope

( B ) ,the intercept ( A ) ,and a measure of the scattering of the data points in the form of a standard deviation ( s y ) .Some programs give numerical estimates of standard deviations for

+

Table I. Equations for Calculating Regression Line Parameters and Variables ’ Parameter or variable B

Confidence limits for parameter or variable t sy

Value of parameter or variable ZXY - ( Z X ) ( Z Y ) / N

f-

A

-

G

S X X

P-BX

SY

(x2/df10.05

Y’

X’B

X

X’

+

(x2/df10.95

+A

B(Y’,” - H) C

Legend Symbol N

Definition Number of data points

to.90

Symbol = 1.645

X

Independent (error free) variable

to.go(N = 3)

= 6.31 ( N = 3)

x

ZXIN

=

Definition 1538 ( N - 2)3 ( N

1537 +-+-1257 +( N - 2)2 N -2

7 6329 1.2186 + -- 717.6911 /v - 2 ( N - 2)2 25 538.i.‘ --12.9039 ( N - 2)3 A ( N - 2)4 “.00264



4,

+Y

ACOOO

Dependent variable

-

Y

(x2/dj)o.os(N=

)

= 0.17&

+

5.3232 X

=-6); 0.117(N = 5 ) ;0.052(N = 4); 0.004(N = 3)

sxx SYY

C

ANALYTICAL CHEMISTRY, VOL. 48,

NO. 13,

NOVEMBER 1976

2027

Table 11. Application of the Least Squares Program to a Set of X,Y Data8 LEAST SQUARES ANALYSIS OF X,Y DATA WITH 90% CONFIDENCE LIMITS

TO FINb Y’ GIVEN X’ PRESS EXC TAN

ENTER X,Y

TO FIND X’ GIVEN Y’ (AV) FROM M DETERMINATIONS PRESS EXC COS

30. 4642.

TO RESET PRESS RESET START 1500. 3999.

N= 16.

ENTER X’ 1200. y’ = 4115.158807 CL, +/5.7 17004769

INTERCEPT A 4654.984596 CL, +/7.855047795

ENTER X‘ ENTER Y’ (AV) & M

SLOPE B -.4498548241 CL, +/8.9224109163 - 03

S:Y = 9.277617651 CL FROM 1.3487582853+ 01 TO 7.15244547

y’ =: 4500. M= 10.

X’ = 344.3610496 CL, +/16.73130802 a X , Y data ( 2 ) omitted to conserve space are: (100,4612), (200,4565), (300,4513), (400,4476), (500,4433), (600,4389), (700,4374), (800,4303), (900,4251), (1000,420l), (1100,4140), (1200,4100), (1300,4073), (1400,4024).

A and B , but these estimates alone cannot be properly interpreted unless the number of data points is very large. For small numbers of data points, the standard deviations alone may result in considerable underestimation of the random errors of the slope and intercept. More properly, confidence limits obtained from sy, the number of data points ( N ) ,tables of Student’s t, and tables of chi square (x2)give more accurate and useful estimates of the errors involved (1-3). Equations for the calculations are well known ( 2 ) .Within our knowledge, presently available least squares programs do not provide for the calculation of confidence limits, which are onerous when performed manually.

2028

Modern programmable desk calculators have sufficient memory to permit numerical estimations o f t and x2 values with simple equations designed from statistical tables (4). With t and x2 values available for any number of degrees of freedom, confidence limits may be calculated as a part of the least squares program and given directly along with the straight line parameters, without recourse to tables. A calculator program has been devised that fits a least squares straight line to an unlimited number of X,Y data points. The program gives numerical values of the slope, intercept, and standard deviation of data points from the line, along with the 90% confidence limits for each parameter. Values o f t and x2 are approximated within 1% by empirical polynomials, as functions of the number of data points. Also included in the program are subroutines which permit calculations of a Y-value (Y’) and its 90% confidence limits from a given X (X’), and of an X-value (X’)and its confidence limits from the average ( YaJ)of a number ( M ) of Y-values. The expressions for these confidence limits show that they become larger (that is, the errors become larger) the farther the observation (X’,Y’) is removed from the center of gravity (x,y)of the data set. The equations used for calculating the straight line parameters, the x’and Y’ values, and the 90% confidence limits for each are summarized in Table I. The notation is principally that used by Natrella (2).The program utilizes 997 instruction steps, 10K registers, and 3 R data registers in a Tektronix TEK-31 programmable calculator. Table I1 illustrates the capabilities of the program with the readout from a set of data points. The data are from an example by Natrella (2),in which confidence limits are calculated with the use of tables. Use of this least squares program by experimentalists should give more definitive estimates of the random error for any quantities calculated from X,Y data than will existing programs that simply give standard deviations. An outline of the program is available on request.

ACKNOWLEDGMENT Acknowledgment is made to Roger A. Jenkins who worked out the polynomial estimate o f t .

LITERATURE CITED (1) H. A. Laitinen and W. E. Harris, “Chemical Analysis”, 2nd ed., McGraw-Hill, New York, 1975. (2) M. G. Natrelia, “Experimental Statistics“, NBS Handbook 91, 1963. (3) W. J. Dixon and F. J. Massey, “Introduction to Statistical Analysis”, 3rd ed., McGraw-Hill, New York, 1969. (4) F. H. Dawson, Nature (London), 256, 148 (1975).

RECEIVEDfor review October 17, 1975. Accepted July 15, 1976. This work was supported in part by funds from the National Science Foundation (Grant No. CHE73-04991AU2).

ANALYTICAL CHEMISTRY, VOL. 48, NO. 13, NOVEMBER 1976