:

QM 122

Lecture Notes by Stefan Waner
(fourth printing: 2003)

Department of Mathematics, Hofstra University

Topic 1 Simple Linear Regression (Based on §§ 11.1-11.4 in book) A linear function of one variable is a function of the form y = f(x) = ∫0 + ∫1x, where ∫0 and ∫ 1 are the parameters of the model. Its graph is a straight line with yintercept ∫0 and slope ∫1. We also call a linear model a first order model. In general, models specified by a mathematical equation are called deterministic models, since they hypothesize an exact relationship between x and y. Examples 1 (a) y = 4 + 3x; y = -22.345 - 4.01x (b) A linear demand equation has the form y = ∫0 + ∫1x where x is the unit price of an item, and y is a measure of the demand (e.g. monthly orders or sales). Two Data Points If we are given only two data points (x1, y1) and (x2, y2), then the equation of the line through them is given by y = ∫0 + ∫1x where y -y ∫1 = 2 1 , x2-x1 and ∫ 0 = y1 - ∫1x1. Worksheet 1 Find the equation of the line through (1, 3) and (3.2, 5). Solution y2-y1 = x2-x1 ∫ 0 = y1 - ∫1x1. = ∫1 = Therefore, the equation of the line is y = ∫0 + ∫1x y= Probabilistic Models In real life, we cannot expect an exact mathematical relationship between, say, price and demand, but we might hypothesize instead that the actual demand is given by, say y = ∫0 + ∫1x + œ, where œ is a random error component. Such a model is called a probabilistic model. Q Exactly what is the random error? =

1

A Actually, œ is a random variable, specified for each value of x, as follows. For a fixed value of x, the experiment consists of measuring y, and then subtracting the theoretical prediction ∫ 0 + ∫1x from the result. Q What do you mean by a “random variable specified for each value of x?” A This means, we actually have lots of random variables œx , one for each value of x. However, we shall be making the assumption that all of the œx s have the same normal distribution, so can drop the subscript and write œ instead. Probabilistic First Order Model y = ∫0 + ∫1x + œ y = dependent variable (also called the response variable) — that is what is being modeled. x = independent variable (also called the predictor variable) ∫ 0 = y-intercept ∫ 1 = slope; the increase of y per one unit increase in x. œ = random error: a random normal variable with mean 0 that does not depend on x.
y
3

y = 0.8 + 0.5x

2

random error
1

observed values

1

2

3

4

x

The deterministic part of the function, E(y) = ∫0 + ∫1x is referred to as the line of means, since the mean of y– = ∫0 + ∫1x + œ– = ∫0 + ∫1x. Best Fit Line: Least Squares In the simplest case we have two data points and we only need to find the equation of the line passing through them. However, it often happens that we have many data points that don't quite all lie on one line. The problem then is to find the line coming closest to passing through all of the points. Example 2 The following table list measured values of sales revenues for various advertising expenditures. Advertising Expenditure (x) (\$100) Sales Revenue (y) (\$1000) First, we plot the given data in a scattergram. 1 1 2 1 3 2 4 2 5 4

2

5 4 3 2 1 0 0 1 2 3 4 5 6

The regression line will be the one that minimizes the sum of the squares of the errors (SSE) (also known as the sum of the squares of the residuals), as shown. (The errors are given by observed value - predicted value): 5 4 3 2 1 0 0 -1 From the chart, we see that SSE = 2 and SE = 0 for the given line (although it is not the regression one.) To obtain the actual regression line, we would have to adjust the line above until we obtained the lowest SSE. Worksheet 2 You are conducting research for a cable TV company interested in expanding into China and we come across the following figures showing the growth of the cable market there. Year (x) (x= 0 represents 2000) Households with Cable (y) (Millions) -2 57 -1 60 0 68 1 72 2 80 3 83 1 2 3 4 5 6

Data are approximate, and the 2001–2003 figures are estimates. Sources: HSBC Securities, Bear Sterns/New York Times, March 23, 2001, p. C1.

3

90 80 70 60 50 40 30 -2 -1 0 1 2 3 4

Use Excel to compute SSE for the linear models y = 72 + 8x and y = 68 + 5x. Which model is the better fit? Model 1: y = 72 + 8x Residual Predicted Residual2 Year Observed ^ ^ = 72 + 8x y - y x y y (y - ^) 2 y -2 57 56 57-56 =1 12=1 -1 60 0 68 1 72 2 80 3 83 SSE = Model 2: y = 68 + 5x Residual Predicted Residual2 Observed ^ ^ = 68 + 5x y - y y y (y - ^) 2 y 57 60 68 72 80 83 SSE =

Year x -2 -1 0 1 2 3

Better model = Model with smaller SSE =

4

Least Squares (Regression) Line The least squares line associated with the points (xi, y1) is the line the minimizes the sum of-squares error, SSE, and has the form ^ =b +b x y 0 1 with SS Slope b1 = x y SSx x Intercept b0 = y– - b1 x– where x– and y– are te sample means of x and y, (£xi)(£yi) SSx y = £xiyi = £(xi-x–)(yi-y–) n (£xi)2 2 SSx x = £xi = £(xi-x–)2 n n = sample size Also, ^ SSE = sum of squares of errors = £(yi-yi )2 = SSy y - b1 SSx y Question Why minimize SSE and not, say, the absoute values of the errors? Answer There are two important reasons: (1) Mathematically, it generalizes the notion of the sample mean. For instance, look at the following points:
2.5 2 1.5 1 0.5 0 0 1 2 3 4 5

Any horizontal line will minimize the sum of the distances shown (the absolute values of the errors). However, only the line y = 1.5 (which happens to be the mean of the given yvalues) will minimize SSE. In general, the sample mean x– of a collection of values of X is the uniqu number that minimizes SSE, and not the absolute values of the errors. (2) Statistically, the regression line gives us unbiased estimators of the population parameters ∫0 and ∫1 . (Also see the discussion in Topic 2.)

5

Worksheet 3 A Tabular Approach for By-Hand Calculation or Excel Calculation Compute the regression line using the given data, and supply the missing information: x = Advertising expenditure in hundreds of dollars y = Sales revenue in thousands of dollars x 1 2 3 4 5 £ (Sum) Means Note that the values in the bottom rows are the sums of the entries in that column. Substituting these values in the formula gives (n = 5) SSx y = £xiyi SSx x = £xi2 (£xi)(£yi) n = = y 1 1 2 2 4 x2 xy y2

(£xi)2 n (£yi)2 n

=

-

=

SSy y = £yi2 Regression Coefficients: b1 = SSx y = SSx x

=

-

=

= =

b0 = y– - b1 x– = Thus, the least squares line is ^ ^ ^ =∫ +∫ x: ^ = y y 0 1

SSE = SSy y - b1 SSx y = = Interpreting the coefficients: For every 1-unit increase in x, y increases by b1 units For every ______________ increase in ___________________ , ___________________ increases by __________ . Estimating y: If I pay \$3500 (x = 3.5) for advetrtising, I can expect sales revenues of ^ = _________________________________________ y 6

Here is a graph of the regression line with the associated data:
4.5 4 3.5 3 2.5 2 1.5 1 0.5 0 -0.5 0 1 2 3 4 5 6

Using Excel Regression Output to obtain the regression line: Following is some of the Excel regression output for this data
Regression Multiple R R Square Adjusted R Square Standard Error Observations
ANOVA

Statistics 0.90369611 0.81666667 0.75555556
0.60553007 5

¨n
SS MS F 4.9 4.9 13.3636364 1.1 0.36666667
6

df
Regression Residual Total 1 3 4

SSE Æ SSyy Æ

Coefficients
Intercept X Variable 1

b0 Æ b1 Æ

-0.1

Standard t Stat P-value Error 0.6350853 -0.1574592 0.88488398

0.7 0.19148542 3.65563078 0.03535285

The values of the regression coefficients are shown in the indicated cells, and the sum of the squares error (SSE) is listed in the ANOVA (Analysis of Variance) part under SS. Execicses for this topic: p. 522: 11.3 (In part (b), do the computation two ways: (1) by hand (2) Using the Excel regression analysis.) p. 523 11.4 (As above) 7

8

Topic 2 Assumptions for Simple Linear Regression We list the assumptions we are making when we perform regression analysis: Assumptions for Simple Linear Regression (§11.4–11.6 in text) 1. Normalcy: We assume a relationship of the form y = ∫0 + ∫1x + œ, where œ is a normal random variable with mean 0 and variance ß2. In practice, we require that the residuals are more-orless normally distributed. 2. Homoscendacity: We assume that œ has the same standard deviation ß at every value of x. 3. Independence of errors The values of each measurement of y (and hence œ) are independent of each other: getting a certain value for one measurement does not effect the probability of the others. (Think, for example, of the DOW.) Question Why are these assumptions necessary? Answer: Although we can always construct a regresion line without these assumptions (just obtain the line that minimizes SSE), we cannot say that b0 and b1 are unbiased estimators of ∫0 and ∫ 1 without them. Nor can we make statitical inferences (see later) about ∫0 and ∫1 without these assumptions. Illustration of Violations of the Assumptions ^ We look at scatter plots of the residuals y - y versus x. Note We can have Excel plot them for us as an option when we do regression. Worksheet 1 Identify what, if any, violations are present in the given residual plots: A
15 10 5 0 -5 -10 1 0.5 0 -0.5 -1

B
0.3 0.2 0.1 0 -0.1

C

D

E

F

9

2 1.5 1 0.5 0

1.5 1 0.5 0 -0.5 -1 z

300 200 100 0 -100 -200 -300 z

There is a very precise way of detercting a certin kind of violation of Assumption 3 (Independence) called first order autocorrelation. This only makes sense in time-series data (that is, data where the x-axis measures time) such as the DOW or the price of gold, etc. If the scores in a time-seris plot are autocorrelated, it means that each residual depends positively (positive autocorreplation) or negatiely (negative autcorrelation) on the preceding score. We measure this phenomenon using a statstic called the Durbin-Watson statistic: Durbin-Watson Statistic 2 2 £(ei-ei-1) £(ei-ei-1) D= = 2 SSE £ei where ei is the residual at time i. Only makes sense for time-series data. We do a hypothesis test: H0 : There is no positive autocorrelation Ha: There is positive autocorrelation (That is, ei = mei-1 + k for some m>0 and k) Reject H0 if D is in the left-hand rejection region shown shaded Fail to reject H0 if D is in the right-hand portion of the rejection region shown. If D is in the “in-between” region, the test is inconclusive.

Testing for Negative autocorrelation: Replace dL by 4-dU and dU by 4 - dL and proceed as above. We can look up the lower and upper limits dU and dL in table E.10 in the textbook, using k = 1 (k is the number of independent variables we are using in regression). Question Where do the numbers in the table come from? Answer What Durbin & Watson did was to compute the sampling distribution of D. The rejection regions correspond to the tail-areas under the curve with an area of 0.05. It is not

10

built into Excel, so we need the table at hand. Here is a partial table for å = .05 (the whole one is in the back of the book): Critical Values for Durbin-Watson (å = 0.05) k=1 k=2 k=3 k=4 nr 15 16 17 18 19 20 dL 1.08 1.11 1.13 1.16 1.18 1.20 dU 1.36 1.37 1.38 1.39 1.40 1.41 dL 0.95 0.98 1.02 1.05 1.08 1.10 dU 1.54 1.54 1.54 1.54 1.54 1.54 dL 0.81 0.86 0.90 0.93 0.97 1.00 dU 1.75 1.73 1.71 1.70 1.69 1.68 dL 0.69 0.73 0.78 0.82 0.86 0.89 dU 1.98 1.94 1.90 1.87 1.85 1.83

k=5 dL 0.56 0.62 0.66 0.71 0.75 0.79 dU 2.22 2.16 2.10 2.06 2.02 1.99

Worksheet 2 Computing the Durbin-Watson Statsitic Here is some more data on the households with cable (y = millions of China households with cable, and x is the year since 2000. You can download this data at http://people.hofstra.edu/faculty/Stefan_Waner/qm122 under “China Cable Data”. Test for first order autocorrelation: Year x -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 Observed y 50 55 57 60 68 72 80 83 85 87 95 101 103 111 114 118 Residual e (Delta-R)2 2 ( ei - ei - 1)

Sum:

11

Step 1: Compute the regression line (Use an excel data analysis for a quick answer) Step 2: Have Excel show the residualsfor you.. Sum Step 3: Compute D = SSE = =

Step 4: Perform the hypothesis tests: H0 : ______________________________________ Ha: ______________________________________ dL = __________ Conclusion: _______________________________ H0 : ______________________________________ Ha: ______________________________________ dU = __________ Conclusion: _______________________________

Execicses for this topic p. 534: 11.22 and 11.23 (Use Excel to obtain the residuals and their plots by selecting the options in the Regression Abalysis dialog box.) p. 539 # 11.30 and 11.33 (Follow the above worksheet.)

12

Topic 3 The Coefficient of Determination and the Variability of the Random Term. (§11.3 and §11.7 in the text) Coefficient of Determination Question If my data points do not all lie on one straight line, how can I measure how closely they can be approximated by a straight line? Answer Think of SSE for a moment. It measures the sum of the squares of the deviations from the regression line, and therefore itself constitutes a measurement of goodness of fit. (For instance, if SSE = 0, then all the points lie on a straight line.) However, SSE depends on the units we use to measure y, and also on the number of data points (the more data points we use, the larger SSE tends to be). Thus, while we can (and do) use SSE to compare the goodness of fit of two lines to the same data, we cannot use it to compare the goodness of fit of one line to one set of data with that of another to a different set of data. To remove this dependency, statisticians have found a related quantity that can be used to compare the goodness of fit of lines to different sets data. This quantity, called the coefficient of determination, coefficient of correlation or correlation coefficient, and usually denoted r, is between -1 and 1. The closer r is to -1 or 1, the better the fit. For an exact fit, we would have r = -1 (for a line with negative slope) or r = 1 (for a line with positive slope). For a bad fit, we would have r close to 0.the figure shows several collections of data points with least squares lines and the corresponding values of r.
y y y y

x r=1 r = -1

x r = 0.5

x r = 0.2

x

In the Excel printout, r is found here:
SUMMARY OUTPUT

Regression Statistics Multiple R 0.90369611
R Square Adjusted R Square Standard Error Observations 0.81666667 0.75555556 0.60553007 5

¨r 2 ¨r

13

Question How do we compute and interpret r? Answer Actually, it's easier to compute and interpret r . First, recall what the quantities SSy y and SSE measure: SSyy is the sample variation in y (in fact, its expected value is the variance of y measures the deviation of y from the mean y– of all values of y. ^ SSE measures the deviation of y from the linear predicted y y y
2

y–y ^ y–y x x

SSyy SSE SSy y - SSE measures the part of the deviation of y from the mean that can be attributed to x. (For a perfect linear set of data SSE = 0, so all the deviation of y from the mean can be attributed to the value of x. On the other hand, if ∫1 was 0, then SSy y = SSE, so none of the deviation of y from the mean is attributable to the value of x.)

Thus, the proportion of the total sample variation that can be attributed to x is given by r2 = SSyy - SSE SSE =1SSy y SSy y

and this is just the square of the coefficient of determination. Coefficient of Determination r SSx y r = SSxx SSy y By Hand
2 2

or

r2 = 1 -

SSE SSy y Excel

It appears under “Multiple R” in the Excel regression analysis. Interpretation r2 is the proportion of the sample variation in y attributable to the value of x in a linear relationship. Quick Example If r2 = 0.85, then approximately 85% of the sample variation of the value of y is due to the value of x (assuming a linear relationship).

14

Worksheet 1 — Obtaining and Interpreting r from Excel Output Following is a partial Excel Output for a regression analysis of profit (\$ million) as a function of time (years since 1995). Use the given data to compute r, and interpret the result.
SUMMARY OUTPUT ANOVA

2

df
Regression Residual Total

SS

MS

F

1 2.9575 2.9575 2.87874574 5 5.13678571 1.02735714 6 8.09428571

Coefficients
Intercept X

Standard t Stat P-value Error -2.6714286 0.85663676 -3.118508 0.02629654 -0.325 0.1915498 -1.6966867 0.15051834

Solution We use r2 = 1 so SSE =1SSy y r ‡
2

=

r=

Thus, approximately _______% of the variation of profits is due to the value of time, if we assume a linear model. (The rest of the variation is due to “statistical noise.”) Worksheet 2 — Calculating Correlation by Hand Use the “By Hand” table above to compute r2 for the following data: x y x -2 0 2 4 6 £ (Sum) SSx y r = = SSxx SSy y
2 2

-2 -1 y -1 -2 -4 -3 -5

0 -2

2 -4 x2

4 -3

6 -5 xy y2

15

so

r=

r ‡

2

Variability of the Random Term First we record some consequences of the thre basic assumptions for lienar regression. Revall that our original probabilitic model is y = ∫0 + ∫1 x + œ where œ is normal with mean 0 an standard deviation ß. This quantity œ meqasures the variability of the random term, so the question is, how do we estimate it? Variability of the Random Term An unbiased estimator for ß2 is given by SSE SSE SYX 2 = = Degrees of freedom 1 n-2 where SSE can be calculated from the following formula: ^ SSE = sum of squares of errors = £(yi-yi )2 = SSy y - b1 SSx y SYX is called the estimated standard error of the regression model. (SYX2 is also called the mean square error.) In the Excel output, SYX appears in the “Regression Statistics” part of the table. See if you can also find the Mean square error in the table.

Interpretation of s We can use the Empirical rule here. It says that approximately 67% of all the observed values of y are within ±ß of y–, Using this for sample statitics, we deduce that around 67% of ^ all the observed values of y are within ±SYX of y . Similarly, approximately 95% of all the ^ observed values of y should lie within ±2S of y.
YX

Quick Example Look at the above Excel regression analysis. SSE = sum of squares of residuals = 1.1
1

There are n-2 degrees of freedom because we are estimating two parameters ∫0 and ∫2.

16

Thus, so

SYX2 = SYX

1.1 1.1 = ‡ 0.36666667, n-2 5-2 ‡ 0.605530.

Worksheet 3 — Calculating SY X by Hand Let us go back to the original data we were using before: x = Advertising expenditure in hundreds of dollars y = Sales revenue in thousands of dollars Compute SYX, and confirm this by looking up the value in the Excel output. x 1 2 3 4 5 £ (Sum) Means y 1 1 2 2 4 x2 xy y2

SSx y = £xiyi SSx x = SSy y = b1 = £xi2 £yi2

(£xi)(£yi) n

=

-

=

(£xi)2 n (£yi)2 n =

=

-

=

=

-

=

SSx y = SSx x

SSE = SSy y - b1 SSx y = SYX = SYX =
2

=

SSE = n-2 SY X ‡
2

Excel Regression Analysis: SYX ‡

17

Interpretation: In the residual plot, we can expect to find approximatley 95% (that is, almost all) the observed values between __________ and ___________ .

Exercises for this topic: p. 528, #11.14, 11.15 2 Use the by-hand method to compute r and SYX in the first, and Excel regression in the other.

18

Topic 4 Inferences about the Slope and Correlation Coefficient (Based on §11.7 in book) In this topic, we will be able to answer several questions. Here is the first one. Question 1 Does y really depend on x based on the given data? For example, if you did a regression of a person's blood pressure as a function of his or her age, you would expect the answer to be yes, but if you did a regression of a soccer player's scoring average per game as a function of the number of kibbles and bits my pet chia ate on that day, you would expect the answer to be “no.” How can we analyze this in less obvious situations? First Recall that we have made an assumption that y = ∫0 + ∫1x + œ. The quantities ∫ 0 and ∫ 1 are thus, in effect, hypothesized parameters of the population from which the data is sampled. When we computed, we were making estimates of these parameters. Q Why can't we just take the mean of a sample to estimate ∫0 and ∫1? It worked in QM1... A We have no way of sampling ∫0 and ∫1 separately: all we can sample is y. Q OK, so we used those strange formulas to compute b0 and b1 . Are they at least unbiased estimators of ∫0 and ∫1? A Yes: given our assumptions about the model (above), the sampling distribution of b1 is always normal with mean ∫1 (since it is an unbiased estimator) and standard deviation S ß ß∫1 = ‡ YX . SSx x SSx x We call this latter quantity Sb 1 . So, Sb 1 = SYX SSx x

Before going on, we really need to (1) know where all this stuff is in the Excel table, and (2) know how to get these numbers by hand. The following formulas include things we have'nt yet gotten to, but have patience...

19

The Excel Table Explained (So Far):
Regression Statistics
Multiple R R Square Adjusted R Square Standard Error Observations ANOVA

r r2 SYX n

df
Regression Residual Total

SS

MS

F

k n-k-1 n-1
Coefficients

SSR SSE SSyy
Standard Error

MSR MSE SSyy/(n-1)
t Stat
test statistic

MSR/MSE

P-value

Intercept X

b0 b1

Sb 1 Sb 2

p -value for 0ne-tailed: for H0: ∫0 = 0: two-tailed test divide this by 2 test statistic p -value for for H0: ∫1 = 0: two-tailed test

Calculating Everything By Hand All we need are the quantities SSxx, SSxy, SSyy, and x–, y– (£xi)2 (£xi)(£yi) 2 SSxx = £xi SSxy = £xiyi n n £x £y x– = i y– = i n n SSxy b1 = b0 = y– - b1 x– SSxx ^ SSE = SS - ∫ SS
yy
1

SSyy =

£yi2

(£yi)2 n

xy

SSE r2 = 1 SSyy Sb 1 = t= SYX SSx x

SYX2 =

SSE n-2 Sb 0 = SYX SSE t= b0 Sb 0 (for H0: ∫0 = 0)

b1 Sb 1

(for H0: ∫1 = 0)

Confidence Interval for ∫1: b1 ± tå/2 Sb 1

20

Worksheet 1 — Computing the Terms in the Excel Output by Hand x 1 2 3 4 5 15 3 y 1 1 2 2 4 10 2 x2 1 4 9 16 25 55 xy 1 2 6 8 20 37 y2 1 1 4 4 16 26

£ (Sum) Means

(£xi)(£yi) (15)(10) = 37 =7 n 5 (£xi)(£yi) (15)(10) SSx y = £xiyi = 37 =7 n 5 (£xi)2 152 SSx x = £xi2 = 55 = 10 n 5 102 (£yi)2 2 SSy y = £yi = 26 - 5 = 6 n SS 7 b1 = x y = = 0.7 10 SSx x 10 15 ^ b0 = y– - ∫1 x– = - 0.7 = -0.1 5 5 SSx y = £xiyi SSE = SSy y - b1 SSx y = SYX = SYX =
2

=

SSE = n-2 SY X ‡ SSE =1SSyy
2

r2 = 1 r= Sb 1 =
2

=

r ‡ SYX SSx x = ‡ = ‡

Sb 0 = SYX SSE = tb 1 = b1 Sb 1 =

21

tb 0 =

b0 Sb 0

=

Regression Statistics
Multiple R R Square Adjusted R Square Standard Error Observations ANOVA

df
Regression Residual Total

SS

MS

F

Coefficients
Intercept X

Standard Error

t Stat

OK back to the task at hand. Now, recall that when we measured a sample mean, we used the sample information to test a hypothesis about the population mean. Here, we will test a hypothesis about the parameter ∫ 1 to answer the following question: Question 1: Does y depend on x at all? Note that, if y did not depend on x, then ∫1 would be zero. Thus, let us test the following hypothesis: H0: ∫1 = 0 H1: ∫1 ≠ 0 or H1: ∫1 > 0 or H1: ∫1 < 0. To test these at a given significance level, we use the above information about the sampling distribution of b1 to obtain a test statistic, and use the t-distribution based on (n-2) degrees of freedom.

22

Testing Model Utility Test Statistic t= where Two-Tailed H0: ∫1 = 0 H1: ∫1 ≠ 0 b1 - Hypothesized value of ∫1 Sb 1 s SSx x = b1 s Sb 1 = t-stat on Excel

Sb 1 =

= Standard error on Excel Table One-Tailed; Upper H0: ∫1 = 0 H1: ∫1 > 0 One-Tailed; Lower H0: ∫1 = 0 H1: ∫1 < 0

Rejection Regions (tå and tå/2 are based on (n-2) degrees of freedom)

-tå/2

tå/2

-tå

Using the p-Statistic: Two-Tailed Tests Use it as is One-Tailed Tests: Divide it by 2

Worksheet 2 - Testing the Regression Coedfficient (t Test) The following data suggests a relationship between famy income and SAT scores. Parents' Income (\$1000) 5 15 25 35 45 55 65 Verbal SAT 350 377 402 416 429 437 446
Source: The College Board/The New York Times, March 5, 1995, p. E16.

Test, at the 95% level of significance, whether SAT scores go up as family income increases. Interpret the coefficient b1 and also the result of the hypothesis test.

23

Regression Statistics
Multiple R R Square Standard Error Observations ANOVA 0.97214532 0.94506653 8.86364968 7

df
Regression Residual Total 1 5 6

SS

MS

F

6758.03571 6758.03571 86.0191836 392.821429 78.5642857 7150.85714

Coefficients Standard Error
Intercept x 353.767857 1.55357143

t Stat

P-value

6.75243248 52.3911728 4.7898E-08 0.16750723 9.27465275 0.00024501

H0 : ______________ Ha: ______________ df = n - 2 = ______ Rejection region: critical t = _________

t-statistic: __________

In rejection region? ______

Conclusion: ___________________________________ Interpret ting result of hypothesis test:

Interpreting coefficient b1:

Note: If t did not fall in the rejection region, that would not have meant that we must accept H0: ∫1 = 0. All it means that we cannot conclude that ∫1 is positive.

24

Guess what: The corresponding p-value (which works as is for the two-tailed test) is right next to it! Thus, if we are testing at the 95% confidence level, å = 0.05 and the p-value is 0.03, we can safely reject H0 since the p-value is smaller than å. For the one-tailed test, we use half the given p-value to estimate å, and so p ‡ .000 24501/2 ‡ 0.000 1225 so we can certainly reject H0 with a signficance level of 1 - 0.000 1255 = 0.999 8745, or 99.99%. Excel Note: We can compute the 1-tailed or 2-tailed p-value from any t-statistic using the formula =TDIST(t-stat. ,df , Number of tails (1 or 2)) For instance, the p-value for the above test is =TDIST(52.3911728,5,1) We are ready for the next question. Question 2 I got a slope of b1 . What is the confidence interval for that answer? To answer this question, we use knowledge we already have: if a random variable X is normally distributed with population mean µ and standard deviation ß, then if we take a sample of X, the (1-å) confidence interval for µ is x– ± zå/2ß/ n . The reason this works is that the sampling distribution of x– is normal with mean µ and standard deviation ßX— = ß/ n. But here, we saw above that the sampling distribution of b1 is always normal with mean ∫ 1 and standard deviation Sb 1 . Thus, we get the following confidence interval test: How to find the (1-å) Confidence Interval for the Slope ∫1 We can be 100(1-å)% certain that ∫1 is in the interval b1 ± tå/2 Sb 1 where tå/2 is based on (n-k-1) degrees of freedom. (For simple regression, k = 1, so use n-2 degrees of freedom.) Excel The quantity Sb 1 is the standard error in the slope, and appears in the X Variable 1 row under “Standard Error.” To obtain t.025 without using a table, enter =TINV(.05, DF) Worksheet 3 – Confidence Interval for the Slope Use the Excel printout of the preceding worksheet to compute a 95% confidence interval for the slope. b1 = _________ df = _________

25

tå/2 = t___ = _________ Sb 1 = _________ CI = = =[ Interpretation: , ± ± ]

Question 3: What is the F-statistic and what does it tell us? The F-statistic is defined to by MSR SSR/k F= = MSE SSE/(n-k-1) If ∫1 = 0, then SSyy ‡ SSE Since the regression line should be close to horizontal Therefore SSR = SSyy - SSE should be close to 0, resulting in a small value of F. The probability distribution for F assuming that ∫1 = 0 is known, and depends on two degrees of freeedom: k = 1 in the numerator and n-k-1 = n-2 in the denominator. Some of its critical values are given by the following table (a more complete table appears at the end of this booklet):

26

df Denominator

Numerator 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 18.513 10.128 7.709 6.608 5.987 5.591 5.318 5.117 4.965 4.844 4.747 4.667 4.600 4.543 4.494 4.451 4.414 4.381 4.351

Critical Values of F (å = 0.05) Excel: =FINV(0.05,dfn,dfd)
Æ
2 19.000 9.552 6.944 5.786 5.143 4.737 4.459 4.256 4.103 3.982 3.885 3.806 3.739 3.682 3.634 3.592 3.555 3.522 3.493 3 19.164 9.277 6.591 5.409 4.757 4.347 4.066 3.863 3.708 3.587 3.490 3.411 3.344 3.287 3.239 3.197 3.160 3.127 3.098 4 19.247 9.117 6.388 5.192 4.534 4.120 3.838 3.633 3.478 3.357 3.259 3.179 3.112 3.056 3.007 2.965 2.928 2.895 2.866 5 19.296 9.013 6.256 5.050 4.387 3.972 3.688 3.482 3.326 3.204 3.106 3.025 2.958 2.901 2.852 2.810 2.773 2.740 2.711 6 19.329 8.941 6.163 4.950 4.284 3.866 3.581 3.374 3.217 3.095 2.996 2.915 2.848 2.790 2.741 2.699 2.661 2.628 2.599

1 161.446 199.499 215.707 224.583 230.160 233.988

Ø

Note: A slight disadvantage of the F-statistic is that it does not differentiate between positive and negative slopes. Therefore, we only use it with an alternate hypothesis of the form Ha: ∫1 ≠ 0 Worksheet 4 - Testing the Regression Coedfficient (F Test) Life expectancies at birth in the United States for people born in various years is given in the following table. You can download this data at http://people.hofstra.edu/faculty/Stefan_Waner/qm122 under “Life Expectancy Data”.

Year Since 1920 Life Expectancy

0 54.1

10 59.7

20 62.9

30 68.2

40 69.7

50 70.8

60 73.7

70 75.4

78 76.7

Source: Centers for Disease Control and Prevention, National Center for Health Statistics, National Vital Statistics Report, Feb. 7, 2001. http://www.cdc.gov/nchs/fastats/pdf/nvsr48_18tb12.pdf

Use an F-test to determine, at the 95% level of significance, whether the life-expectancy has been changing with time. Interpret the coefficient b1
Regression Statistics

27

Multiple R R Square Standard Error Observations ANOVA

0.97369201 0.94807614 1.85070591 9

df
Regression Residual Total 1 7 8

SS

MS

F

Significance F

437.773102 437.773102 127.812772 9.4773E-06 23.9757864 3.42511235 461.748889

Coefficients Standard Error
Intercept x 57.0236538 0.27370703

t Stat

P-value

Lower 95%

1.14367512 49.8600107 3.4175E-10 54.3192938 0.02421022 11.3054311 9.4773E-06 0.21645898

H0 : ______________ Ha: ______________ df (numerator) = k = ______ Fcritical = _______ Rejection region: df(denominator) = n - k - 1 = ________

F-statistic: __________

In rejection region? ______

Conclusion: ___________________________________ Interpret ting result of hypothesis test:

Interpreting coefficient b1:

Note: The “p-value” for F is listed above as Significance F, and gives the signficance with which we can reject Note that it is the same as the p-value for the t-statirci associated with ∫ 1 . (Why?)

28

Exercises for this topic: p. 546 #11.37: Do this two ways: First, compute all the terms in the Excel Sheet by hand Second, answer (a) and (b) in the textbook Repeat the above using 11.38

29

Topic 5 Using Regression to Predict y from x (Based on §11.8 in the book) Let us go back to the original scenario: x = monthly advertising expenditure in \$100, y = monthly sales revenue in \$1000. We can already predict y by using the formula for ^. What y we don't have is a confidence interval. Here are two questions we can ask: Question 1 What is a confidence interval for my average sales revenue if I pay \$3500 (x = 3.5) for advertising in a month? That is, find a conrfidence interval for y–, the population mean of y, given a specific value of x. This confidence interval is called a confidence interval (CI) for the mean of y. Question 2 What is a confidence interval for my sales revenue in a particular month if I pay \$3500 per month (x = 3.5) for advertising? That is, find a conrfidence interval for y, a particular value of y, given a specific value of x. This confidence interval is called a prediction interval (PI) for an individual response of y. Question What is the difference between these two confidence intervals? Answer We are less certain about a particular month's revenues than about the mean revenue. Therefore, the confidence interval for a particular value of y will be larger. All we need is a confidence interval for this prediction. Question Wait a minute! Since y = ∫ 0 + ∫ 1x + œ, and the standard deviation œ can be estimated by s, why not just use that s to give us a confidence interval for y? Answer If we knew the values of ∫0 and ∫ 1 exactly, that would be fine. But we don't know those values; we only have estimates b0 and b1 of those values. Thus, we can't use s to form our confidence interval. Note The tiniest error in b0 or b1 can have disastrous consequences for long-term prediction (illustration in class). Thus, the standard deviation and resulting confidence interval for our prediction of y from a given value of x should depend on how far that value of x is from the mean x–. Here are the underlying facts: ^ • If we use the regression value y to predict y– at a specified value xp of x, then the standard deviation of the error is given by 1 (xp-x–)2 + n SSx x where ß is the standard deviation of œ. ß(y-y–) = ß • ^ If we use the regression value y to predict y at a specified value xp of x, then the standard deviation of the error is given by ß
^ =ß (y-y )

1+

1 (xp-x–)2 + n SSx x 30

If we now recall that ß ‡ SYX, where SYX2 = intervals for y– and yp are given as follows: Predicting y– and y from a given x A (1-å) confidence interval for y– is given by ^ ±t S yp å/2 YX 1 (xp-x–)2 + n SSx x

SSE , we see that our (1-å) confidence n-2

CI for the Mean of y

A (1-å) confidence interval for yp is given by ^ ±t S yp å/2 YX 1+ 1 (xp-x–)2 + n SSx x PI for an Individual Response of y

In both cases, xp is the given value of x ^ is the resulting value of y (given by the regression equation) y
p

tå/2 is based on (n-k -1) = (n-2) degrees of freedom. Excel: To obtain t.025 without using a table, enter =TINV(.05, DF) To obtain SSxx from the Excel output we can use ÈS ˘ 2 Í ˙ SSxx = Í YX˙ Î Sb 1 ˚ Note: To get the above formula for SSxx, we use the formula Sb 1 = ÈS ˘ 2 Í ˙ SSxx = Í YX˙ . Î Sb 1 ˚ Worksheet 1 — Mean and Individual Predicted Values The following graph shows approximate annual sales of new in-ground swimming pools in the U.S.2 SYX2 SSxx

, giving

2

2001 figure is an estimate. Source: PK Data/New York Times, July 5, 2001, p. C1.

31

165 New Pools (Thousands) 160 155 150 145 140 135 130 125 120 1996 1997 1998 1999 2000 2001

Year

2001 figure is an estimate. Source: PK Data/New York Times, July 5, 2001, p. C1.

Here is the underlying data: 2 3 4 5 6 Year Since 1995 1 Number of Pools 125 135 140 150 155 160 Use regression to compute confidence intervals for both the predicted value of y and the mean value of y in 2003. Are both results meaningful in the contect of this problem? Step 1 Do the regression: Taking x = year since 1995 and y = number of pools, we obtain the following output from Excel:
Regression Statistics
Multiple R R Square Standard Error Observations ANOVA 0.99231497 0.984689 1.82574186 6

df
Regression Residual Total 1 4 5

SS
857.5 870.833333

MS
857.5

F
257.25

13.3333333 3.33333333

Coefficients Standard Error
Intercept X Variable 1 119.666667 7

t Stat

P-value

1.69967317 70.4056925 2.4386E-07 0.43643578 16.0390149 8.8363E-05

32

Step 2: Do the calculations for the PI first: Regression equation: ^ = y xp = _________ n = ________ ÈS ˘ Í ˙ SSxx = Í YX˙ Î Sb 1 ˚
2

^ = _________ yp x– = _________

È Í =Í Î

˘2 ˙ ˙ = ______________ ˚ SYX = __________ 1 + ______ - _______
2

tå/2 = ___________ 1 (x -x–)2 1+ + p =1+ n SSx x 1+

= _____________

1 (xp-x–)2 + = ___________________ n SSx x 1 (xp-x–)2 1+ + n SSx x ± ± , ]

CI: = = =[

^ ±t S yp å/2 YX

33

Setting this up on the Excel Sheet:

If you use formulas for everything, then you can change the value of xp and automatically see the effect on the confidence interval. Interpretation:

Exercises for this topic: p. 551 #11.49. 11.50 Excel Assignment 1: Global Warming

Source: Climatic Research Unit, University of East Anglia http://www.cru.uea.ac.uk/

Go to http://people.hofstra.edu/faculty/Stefan_Waner/qm122 and download the Excel spreadsheet for Assignment 1 showing surface land temperatures from 1880–2001. A. Obtain residual plots and use then to judge the extent to which the regression assumptions are met. Comment on your conclusions. 34

B. Test for evidence of first order autocorrelation. C. Perform a linear regression on the data and give the regression model. Important: First rescale the year data so that x = 0 corresponds to 1950. (The regression computations are more accurate for small values of x.) D. Interpret the slope of the regression equation. E. Perform a hypothesis test at the 95% significance level to test whether temperature is increasing with time. F. Obtain a 95% PI for x = 70. Interpret the result. G. Repeat Steps A–F using the 1980–2001 data only . (Take x = 0 to represent 1980 here.) H. Compare slopes of the regression equations for 1880-2001 and 1980–2001. What does this comparison suggest about global warming?

35

Topic 6 Multiple Regression: The Model & Inferences about the ∫ Parameters (Based on §12.1 and §12.4 in book) A linear function of k variables is a function of the form y = ∫0 + ∫1x1 + ∫2x2 + ... + ∫k xk . a probabilistic linear function of k variables has the form y = ∫0 + ∫1x1 + ∫2x2 + ... + ∫k xk + œ, where œ is normally distributed and independent of the values of the xi. Worksheet 1 - Interpreting the coefficients: Here is an example of a linear function of two variables: Chrysler's percentage share of the US mini-van market in the period 1993–1994 could be approximated by the linear function c(x1, x2, x3) = 72.3 - 0.8x1 - 0.2x2 - 0.7x3, where x1 is the percentage of the market held by foreign manufacturers, x2 is General Motors' percentage share, and x3 is Ford's percentage share.3 Interpretation of ∫1 : For every 1-unit increase in x1 , y ___________ by _________ units. In other words, Chrysler's percentage share of the US mini-van market in the period 1993–1994 ______________________________________________________________ ________________________. Interpretation of ∫2 : For every 1-unit increase in x2 , y ___________ by _________ units. In other words, Chrysler's percentage share of the US mini-van market in the period 1993–1994 ______________________________________________________________ ________________________. Interpretation of ∫3 : For every 1-unit increase in x3 , y ___________ by _________ units. In other words, Chrysler's percentage share of the US mini-van market in the period 1993–1994 ______________________________________________________________ ________________________.

3

The model is your instructor's. Source for raw data: Ford Motor Company/The New York Times, November 9, 1994, p. D5.

36

Obtaining the best-fit coefficients for this kind of model is called multiple linear regression. The procedure to compute the regression coefficients b0 , b1 , ... by hand involves the use of matrix algebra, and is beyond the scope of this course. Therefore, we will use Excel output exclusively (sometimes aided by PHStat). Worksheet 2 — Basics of Multiple Regression Go to http://people.hofstra.edu/faculty/Stefan_Waner/qm122 and download the Excel spreadsheet for the Multiple Regression Example on Radio and TV (from Exercise 12.25 in the textbook, but with different data). Since the textbook does not bother to say exactly what the variables are, we are forced to invent them: Take y = Number of Psychic Crystal pendants sold per day x1 = Minutes per day in late-nite TV and radio advertising x2 = Number of half-page ads per day in the local newspapers (a) Write down the probabilistic model, the regression equation, and interpret the slopes. (b) Find a 95% CI for the population slope ∫1 . (c) Determine at the 95% level of significance whether sales go up as newspaper advertising goes up. (d) Interpret the p-values for the coefficients ∫1 and ∫ 2 . On this basis, which explanatory variables should be retained? y Sales 563 308 384 436 362 677 764 996 852 680 656 x1 Radio/TV 0 0 25 25 30 30 35 35 40 40 45 x2 Newspaper 40 40 25 25 30 30 35 35 25 25 45 y Sales 1295 1045 1076 1257 1359 1199 1520 1648 991 1439 1214 x1 Radio/TV 45 50 50 55 55 60 60 65 65 70 70 x2 Newspaper 45 0 0 25 25 30 30 35 35 40 40

Here is the resulting regression output:

37

Regression Statistics Multiple R 0.8311521 R Square 0.6908139 Adjusted R Square 0.6582679 Standard Error 233.86664 Observations 22 ANOVA df Regression Residual Total 2 19 21 SS MS F Significance F 2321834.06 1160917 21.22583 1.44E-05 1039178.53 54693.61 3361012.59

Coefficients Standard Error t Stat P-value Lower 95% 155.422 186.555473 0.833114 0.415131 -235.043 16.866047 2.58935264 6.513615 3.07E-06 11.44647 1.9378349 4.36134205 0.444321 0.66183 -7.19056

(a) Probabilistic model: y = ________________________________________________ Regression equation: ^=b +b x +b x y 0 1 1 2 2 ^ = ________________________________________________ y Interpretation of b1 :

Interpretation of b2 :

(b) Preparation for doing hypothesis CI for ∫1 at the 95% significance level: n = ________________ k = ________________ df = n-k-1 = ________________ Sb 1 = ______________ tå/2 = _______________

38

CI = b1 ± tå/2 Sb 1 = = =[ (c) , ± ± ]

H0 : ______________ Ha: ______________ df = n - k-1 = ______

Rejection region: critical t = __________

t-statistic: __________

In rejection region? ______

Conclusion: ___________________________________ Interpret ting result of hypothesis test:

(d) p-value for ∫1 = ____________ Interpretation:

p-value for ∫2 = ____________ Interpretation:

Conclusion:

39

Variability of the Random Term The standard deviation ß of œ has an unbiased estimator for ß2 given as follows. First, the number of degrees of freedom is given by dy = n - # ∫-terms = n - (k+1) = n-k-1 Then the unbiased estimator is SSE s2 = = MSE (Mean Square Error) n-k-1 where ^ SSE = sum of squares of errors = £(yi-yi )2 s is called the estimated standard error of the regression model and appears under "Regression Statistics" whereas its square, MSE appears in the ANOVA section. Interpretation of s Just as with simple regression, we can make the following inference: Around 95% of the ^ observations will lie within 2s of the predicted value y . Coefficients of Multiple Determination As we saw for simple regression, the proportion of the total sample variation that can be attributed to the independent variables is given by SSyy - SSE SSR = SST SSy y 2 2 The textbook calls this quantity rY,12 . As for simple regression, r gives the proportion of the sample variation in y attributable to the values of the independent variables in a linear 2 relationship. A disadvantage of r is that it cannot be used to compare models with different numbers of explanatory variables. The larger the number of variables, the smaller SSE tends to become. In fact, it is possible to construct models with n - 1 variables that result in an 2 2 exact fit of the regression models, and hence SSE = 0, so that r = 1. The adjusted r is 2 defined by the following formula [which scales the quantity 1-r by the ratio (n-1)/)n-k1)]: È 2 2 n-1 ˘ ˙ radj = 1 - Í (1-r ) Î n-k-1˚ r2 = Question: How do we interpret the adjusted r ? 2 Answer: Suppose, for instance, that radj = .89. We can say that “if we take model size into account, 89% of the variation in y is explained by the values of the independent variables.” Answer: Suppose, for instance, that radj = .89. We can say that “if we take model size into account, 89% of the variation in y is explained by the values of the independent variables.”
2 2

40

Exercises for this topic: p. 589, #12.4 a, b, c, g, h only p. 599 #12.23, 12.24

41

Topic 7 Using F-statistics: Evaluating the Whole model and Portions of the Model (§12.3 and a variation of 12.4 in the book) In Topic 4 we saw that a F statistic could also be used to evaluate a simple linear regression. If we look at its definition, F= (SSy y- SSE)/k SSR/k = SSE/[n-(k+1)] SSE/(n-k-1)

we see that it related to the fit of the entire model. To understand its meaning, recall that SSyy = £ (y - y–)
2

and

SSE = Sum of

^2 £(y - y)

Therefore, if ∫1 = ∫2 = ... = ∫k = 0, then SSyy ‡ SSE

^ (Since the regression equation should be close to a constant, so that y– ‡ y ‡ that constant). Therefore SSR = SSyy - SSE ‡ 0, and so F is close to zero. In fact, its sampling distribution (assuming ∫1 = ... = ∫ k = 0) is the known distribution tabulated at the end of this booklet . The F-Statistic for Multiple Regression: Testing the Usefulness of the Overall Model The F-statistic is used to test the following hypothesis: H0: ∫1 = ∫2 = ∫3 = ... = ∫k = 0 Ha : At least one of these coefficients is non-zero. Test statistic: (SSy y- SSE)/k SSR/k R2/k F= = = SSE/(n-k-1) SSE/(n-k-1) (1-R2)/(n-k-1) Mean Square(Model) Sum of Squares(Regression)/df(Regression) = = Mean Sqare(Regression) Sum of Sqaures(Error)/df(Error) Using F: Compare the F-statistic to the one in the table with k df in the numerator & [n-(k+1)] df in the denominator. If F > Få, then we reject H0. Note: Rejecting H0 does not mean that the model is the best one; another model might give an even better confidence level. Some terminology for the terms in the Excel table:
ANOVA

df

SS

MS

F

Significance F

42

Regression Residual Total

df (Regression) df (Error) dfM + dfE

SSR (Regression) SSE (Error) SST = SSM + SSE

MSR MSE

MSR/MSE

Workbook 1 _ Using the F-Test to Evaluate the Entire Model Fill in the missing values of the following Excel sheet, and compute the overall usefulness of the given regression model at the 95% confidence level.
SUMMARY OUTPUT

Regression Statistics
Multiple R R Square Adjusted R Square Standard Error Observations ANOVA 0.78881784 0.62223358 0.54128363 8.55161132 18

df
Regression Residual Total

SS
3 1686.37453 14 1023.82079 17 2710.19531

MS

F

Significance F

Coefficients
Intercept X1 X2 X3 -72.848775 -0.0662404 85.7340025 -0.0222909

Standard t Stat Error 43.6506747 -1.6689037 0.18831924 -0.351745 22.6308238 3.78837303 0.02994571 -0.7443784

P-value
0.1173366 0.73026749 0.00199612 0.46895881

Lower 95%
-166.47024 -0.4701453 37.1956697 -0.0865182

Missing values: SSR MSR = df(R) = SSE MSE = df(E) = MSR F = MSE = ‡ ‡ ‡

Significance F (p-value) =FDIST(F-stat, df1, df2 ) = Evaluating the Model Linear Model: y = ________________________________

43

H0 : ________________________________ Ha: _________________________________ df (numerator) = k = ______ Fcritical = ________ Rejection region: df(denominator) = n - k - 1 = ________

F-statistic: F = __________ In rejection region? ______ Conclusion: ___________________________________ Interpret ting result of hypothesis test:

Interpreting the F significance value:

Testing a Portion of a Model Suppose we want to test a bunch of terms at once (this was more reliable than testing them one-at-a-time, due to type 1 error accumulation). To do this, we compute an F-statistic showing the percentage of new errors caused by reducing the model as follows.

44

Testing a Portion of the Model Do two regression analyses: Reduced Model: y– = ∫0 + ∫1 x1 + ... + ∫g xg Complete (larger) Model: y– = ∫0 + ∫1 x1 + ... + ∫g xg + ... + ∫kxk H0: ∫g+1 = ... = ∫k = 0 Ha : at least one of them is not zero (SSRcomplete - SSRpartial)/[k-g] F = . SSEcomplete/[n-k+1] Rejection Region: F > Få, based on (k-g) numerator and n-(k+1) denominator df. n = # data points k-g = number of ∫'s tested Interpretation: The null hypothesis asserts that the additional explanatory variables xg+1, xg+2, ..., xk do not contribute significantly to the usefulness of the model. In other words, the reduced model is preferable. Rejecting it implies that the additional variables do contribute significantly to the usefulness of the model. Note: If the two models differ by a single term, then the F-test can be replaced by a t-test: Just do the regression analysis for the larger model, and test for the extra coefficient. Worksheet 2 — Testing a portion of a model Here is a model for the selling price of a home (y) as a function of the list price (x1), the number of bedrooms (x2), and the time on the market in weeks (x3). Use a comparison of models to determine whether x2 and x3 contribute significantly more than x1 alone. Reduced Model
Regression Statistics
Multiple R R Square Adjusted R Square Standard Error Observations ANOVA 0.99474985 0.98952725 0.98917816 36747.5119 32

Complete Model
Regression
Multiple R R Square Adjusted R Square Standard Error Observations ANOVA

Statistics
0.99515812 0.99033968 0.98930464 36532.137 32

df
Regression Residual Total 1 30 31

SS
3.8278E+12 Regression 4.0511E+10 Residual 3.8683E+12 Total

df
3 28 31

SS
3.8309E+12 3.7369E+10 3.8683E+12

Coefficients
Intercept -26306.993

Standard Error
10738.6428 Intercept

Coefficients
-7477.8395

Standard Error
20471.9887

45

X1

0.99674558

0.01872148 X1 X2 X3

0.99787257 -2663.1189 -534.62597

0.0189959 5370.9791 421.174382

Complete Model: y = ________________________________ Reduced Model: y = ________________________________ H0 : ________________________________ Ha: _________________________________ df (numerator) = k-g = ______ Fcritical = ________ Rejection region: df(denominator) = n - k - 1 = ________

F-statistic: F =

(SSRcomplete - SSRpartial)/[k-g] SSEcomplete/[n-k+1] [ / ‡ ]/

=

‡ In rejection region? ______

Conclusion: ___________________________________ Interpret ting result of hypothesis test:

What does the result suggest about housing prices?

46

FYI: Here is a Excel plot of price vs. number of bedrooms for the data used above.
7 6 5 4 3 2 1 0
\$0 \$500,000 \$1,000,000 \$1,500,000 \$2,000,000

Exercises for This Topic: p. 596, 12.16, 12.17 Go the download place at http://people.hofstra.edu/faculty/Stefan_Waner/qm122 and download the data under "Portion of a Model". Determine whether the Yen and Mark rates contribute significantly more information to the Ford stock price than the S&P index alone.

47

Topic 8 Quadratic and Interactive Terms Quadratic Terms (Based on 12.6 in the text) Here are some data and a graph showing monthly electricity use vs. size of home in square ft. Size (sq. ft) x 1290 1350 1470 1600 1710 1840 1980 2230 2400 2930 Usage (kw-hrs) y 1180 1170 1260 1490 1570 1710 1800 1840 1960 1950

The Excel scatter chart suggests a quadratic relation. y = ∫ 0 + ∫ 1x1 + ∫ 2x12, so we take x2 to be x 12, by adding an extra column on the spreadsheet, and then do a multiple linear regression. The curvature is accounted for by the x12 term, so: There is no curvature ¤ Coefficient of x = 0 ¤ ∫2 = 0 Therefore, to test whether there is evidence of curvature, all we need to do is a t-test to look 2 at the coefficient of x . Worksheet 1 — Testing for Curvature Use the above data in Excel, complete the given table, find the regression quadratic model, use it top predict electric usage for a 2500 square ft home, and test for curvature at the 95% significance level.
2

48

First, download the data from http://people.hofstra.edu/faculty/Stefan_Waner/qm122 by using the Curvature Data link. Then create an extra column in the Excel workbook using the squares of the values of x (Notice that we put the y-column first):

Now do a regression using both x and x as the explanatory variables. Now do the regression and check that the given values match the part of the sheet shown below, and fill in the remaining ones.
Regression Statistics
Multiple R R Square Adjusted R Square Standard Error Observations ANOVA 0.99091051 0.98190365 0.97673326 46.9099376 10

2

df
Regression Residual Total 2 7 9

SS

MS

F

Significance F
7.972E-07

835806.204 417903.102 189.909147 15403.7957 2200.54225 851210

Coefficients
Intercept x x^2

Standard Error

t Stat

P-value

Lower 95%
-1810.1778 1.83277975 -0.0005938

-1234.7 2.41543711 -0.0004538

243.36981 -5.0733492 0.00144169 0.24640607 9.80266875 2.4394E-05 5.9214E-05 -7.6636835 0.00011978

The regression equation is ^= y Predicted value of y for a 2500 sq ft home =

Now test for curvature: 49

H0 : ______________ Ha: ______________ df = n - k-1 = ______ Rejection region: critical t = __________

t-statistic: __________

In rejection region? ______

Conclusion: ___________________________________ Interpret ting result of hypothesis test:

p-value for ∫2 = ____________ Interpretation:

Does the cost accelerate or decelerate as the size of the home increases? Explain

Interactive Models (Based on nothing in this book, but a nice section in “Statistics for Business and Economics;” by McClave, Benson, Sincich; 8th Ed., Prentice Hall.) Here is some data showing the auction prices of 32 grandfather clocks together with the number of bidders and the age of the clock.

50

Age X1

#

Bidders X2

Auction Y

Price

Age X1

#

Bidders X2

Auction Y

Price

127 115 127 150 156 182 156 132 137 113 137 117 137 153 117 126

13 12 7 9 6 11 12 10 9 9 15 11 8 6 13 10

1200 1100 850 1500 1000 2000 1800 1300 1300 1000 1700 1000 1100 1100 1200 1300

170 182 162 184 143 159 108 175 108 179 111 187 111 115 194 168

14 8 11 10 6 9 14 8 6 9 15 8 7 7 5 7

2100 1600 1900 2000 800 1500 1100 1500 700 1800 1200 1600 800 700 1400 1300

If we suspect that the age of the clock (x1) and the number of bidders (x2) will interact (that is, different numbers of bidders may cause the price to vary differently as a function of the age), we try a model of the form y = ∫0 + ∫1x1 + ∫2x2 + ∫3x1x2 + œ. The effect on the graph is to twist the surface (see the following picture generated by the grapher that comes with every Macintosh computer):

51

If ∫3 = 0, then each value of x2 will result in a line of the same slope for y as a function of x1. Otherwise, if ∫3 ≠ 0, the slope will vary.
Price (y) x1 = 15 bidders x1 = 10 bidders x1 = 5 bidders Price (y) x1 = 15 bidders x1 = 10 bidders x1 = 5 bidders

Age of Clock (x1)

Age of Clock (x1)

No Interaction (∫3 = 0)

Interaction (∫3 ≠ 0)

We suspect that the number of bidders will have a positive impact on the variation of price with age, so we test the alternate hypothesis Ha ∫3 > 0. To do this on Excel, we introduce a third column for x1x2, and do a regression at the 99% significance level:
Regression Statistics
Multiple R R Square Adjusted R Square Standard Error Observations ANOVA 0.97309468 0.94691325 0.94122538 95.4955358 32

df
Regression Residual Total

SS

MS

F

Significance F
5.9656E-18

3 4554578.75 1518192.92 166.479523 28 255343.126 9119.39735 31 4809921.88

Coefficients
Intercept X1 X2 X1X2 61.6599935 2.62232358 -65.831044 1.11008423

Standard Error 316.98622 2.18256632 32.1040495 0.22804843

t Stat

P-value

Lower 95%

0.19451948 0.84717364 -587.65757 1.20148632 0.23962706 -1.8484659 -2.0505527 0.04977643 -131.59328 4.86775643 3.9815E-05 0.64294766

The t-statistic for ∫3 is 4.86. We look up tå = t0.001 for n-(k+1) = 28 degrees of freedom as usual, and get 3.408. Since t > tå, we reject H0 and conclude that there is a strong interaction here. Also note the large value of R2 (95%) and the tiny value for Significance F, showing that the model is a good one.

52

Exercises for this Section Quadratic: p. 614, 12.37 To determine whether the addition of the quadratic term significantly improved the model, you could do a comparison of models using an F-statistic like in the last section, but, since there is only one additional variable, you might as well just look at its p-value based on the t-statistic. (The book is very wrong not to emphasize this point in its curious focus on using the F-statistic in Section 12.5 where the t-statistics would suffice.) Interaction: The following problem comes from “Statistics for Business and Economics;” by McClave, Benson, Sincich; 8th Ed., Prentice Hall. Download the CEO Data sheet at http://people.hofstra.edu/faculty/Stefan_Waner/qm122 (a) What does it mean for the salary and percentage stock price to interact? (b) Find the interaction regression equation, and test the overall model at the 95% level of significance. (You will fail to reject H0 .) (c) Is there evidence at the 95% level of significance that CEO income and stock percentage interact? (c) Looking at the p-values, try to eliminate one of the variables in order to obtain a model with a satisfactory F-value. What is the resulting regression model? (d) Using the better regression model, predict the change in profit for every \$1000 increase in a CEO's income when the CEO owns 2% of the company stock. (e) If you were on a board of directors and wished to use the regression analysis above, would you be in favor giving a new CEO more stock and a lower salary? Explain.

53

Topic 9 Qualitative Variables (Based on §12-7 in the book, but we discuss two subtopics whereas the book only discusses one) If, for example, we are interested in the market activity in real estate, the time a home has to wait on the market may depend on whether it is a house or a condominium, and also on the asking price. Here, the asking price is a quantitative variable since it is a number, while the kind of home (house vs. condo) is a qualitative variable. In this topic, we see how to include qualitative variables (or "dummy variables" as they are called in the textbook.). Suppose we are interested in the sale price of a home as a function of whether it is (A) a house, (B) a condominium, or (C) a co-op. We can do so by defining two new variables (not three) Ï1 if the property is a condominium (Catgegory B); x1 = Ì0 if not Ó Ï1 if the property is a co-op (Category C); x2 = Ì0 if not Ó Then, in the model, we can plug in x1 = x2 = 0 for a house, x1 = 1 & x2 = 0 for a condo, etc. We say that x1 and x2 constitute a qualitative variable with 3 levels. Q How do we interpret the coefficients ∫i for the model? A If we use the example of housing sales, then, writing y– = ∫0 + ∫1x1 + ∫2x2, we find µA = mean sale price of a house (put x1 = x2 = 0) = f(0,0) = ∫0 µB = mean sale price of a condominium (put x1 = 1 & x2 = 0) = f(1,0) = ∫0 + ∫1 µC = mean sale price of a co-op (put x1 = 0 & x2 = 1) = f(0,1) = ∫0 + ∫2 Thus, ∫ 0 = µA ∫ 1 = µB-µA ∫ 2 = µC-µA. In other words, the coefficients measure the difference between the three categories. For instance, ∫1 measures the effect on the price of a home of switching from a house (the base level) to a condominium. Qualitative Variable With k Levels: Comparing k Means Model: E(y) = ∫0 + ∫1x1 + ∫2x2 + ... + ∫ k-1xk-1 Ï1 if y is observed at level i; xi = Ì0 if not Ó µA = ∫0 ∫ 0 = µA µB =∫0 + ∫1 ∫ 1 = µB-µA µC = ∫0 + ∫2 ∫ 2 = µC-µA

54

....

...

Worksheet 1 — Comparing 3 Means Go to http://people.hofstra.edu/faculty/Stefan_Waner/qm122 and download the Housing Prices Excel file. There you will find selling prices of various homes in 1995 (y) sold in (A) Manhattan, (B) Connecticut, and (C) Long Island. (a) Obtain the regression model and interpret the coefficients in the model. (b) Test at the 95% level of significance whether Connecticut homes are cheaper tan Manhattan homes, and whether Long Island homes are cheaper than Manhattan homes. (c) Test the overall model, and interpret the result. (d) According to the regression model, how much more expensive is a home in Connecticut than in Long Island? (a) The explanatory variables are: Ï1 if _____________________ Ô x1 = Ì Ô Ó0 if _____________________ Ï1 if _____________________ Ô x2 = Ì Ô Ó0 if _____________________ The model is y– = ∫0 + ∫1x1 + ∫2x2, where ∫ 0 = _____________________________________ ∫ 1 = _____________________________________ ∫ 2 = _____________________________________ Interpretation of coefficients: ∫0:

∫1:

55

∫2: (b) Comparing Connecticut and Manhattan: H0 : _____________ Ha: _____________ p-value for 2-tail test: _____________ p-value for 1-tail test: = 1 p-value for 1-tail test = ______________ 2 Conclusion & Interpretation:

Comparing Long Island and Manhattan: H0 : _____________ Ha: _____________ p-value for 2-tail test: _____________ p-value for 1-tail test: = 1 p-value for 1-tail test = ______________ 2 Conclusion & Interpretation:

(c) Testing overall model: H0 : _____________ Ha: _____________ F-significance: _____________ Conclusion & Interpretation:

(d) µ C - µB = (µC - µA ) - (µB - µA ) = ___________ - ___________ = __________ Interpretation:

NOTE H0 only tests whether µB = µA and µ C = µA. It does not test whether µC = µB. However—and this is why we use the term “level”—. If we were comparing the effectiveness of 5 different brands of detergents on a ketchup stain, we do not have levels, 56

and would like to know whether there is any difference at all among the 5 brands. Since there is no sense of “levels” here, we will use ANOVA (analysis of variance) later in this course address this. Using Qualitative Variables to Compare Two Slopes The effectiveness of an advertising medium can be measured by the number of items sold per \$1,000 spent on advertising. That is, the slope of the Sales vs. Expenditures line. Suppose we want to compare (A) newspaper, (B) television, and (C) radio advertising. Let y be the monthly sales , and let x be the advertising expenditure (all three categories). Note that x is a quantitative variable. Let
Ï1 x1 = Ì0 Ó Ï1 x2 = Ì0 Ó

if we were advertising on the radio; if not if we were advertising on television; if not

Then consider first the linear model y– = ∫0 + ∫1x + ∫2x1 + ∫3x2. Claim: This model gives the same sales vs. expenditure slope for all three categories. Indeed, the slope for newspaper sales is obtained by setting ∫2 = ∫3 = 0, and we get y– = ∫0 + ∫1x , yielding a slope of ∫1. Similarly, if we look at radio advertising, we get y– = ∫0 + ∫1x + ∫2, (1) again a slope of ∫1. To obtain different slopes, we need the following interactive model: y– = ∫0 + ∫1x + ∫2x1 + ∫3x2 + ∫4xx1 + ∫5xx2. (2) This gives a slope of ∫ 1 for newspaper, ∫ 1+∫4 for radio, and ∫ 1+∫5 for television. Thus, if we test the hypothesis H0: ∫4 = ∫5 = 0 we are in fact testing whether or not the slopes for the three media are the same by testing the model for interaction. To do this, we use the reduced model test, comparing the interactive model and linear model..

57

Worksheet 2 — Comparing 2 Slopes We want to compare the response to monetary bonuses for two types of worker: union and non-union. Here is the data, available under "Productivity" at http://people.hofstra.edu/faculty/Stefan_Waner/qm122
p r o d u c t i v i t y bonus u n i o n ? p r o d u c t i v i t y bonus u n i o n ? y x x1 y x x1

1435 1512 1491 1575 1512 1488 1583 1529 1610

0.2 0.2 0.2 0.2 0.2 0.2 0.3 0.3 0.3

1 1 1 0 0 0 1 1 1

1635 1589 1661 1610 1574 1636 1654 1616 1689

0.3 0.3 0.3 0.4 0.4 0.4 0.4 0.4 0.4

0 0 0 1 1 1 0 0 0

(a) Using a regression model, determine the coefficients that give the slope of (1) productivity vs. bonus for non-union workers and (2) productivity vs. bonus for union workers Do the data provide evidence that non-union workers are more responsive to bonuses than union workers? (b) If we disregard bonuses, do the data provide evidence that non-union workers produce less than union workers? Solution (a) We use two levels: (A) non-union and (B) union. The model that shows We compare the following models: y– = _________________________________ Linear y– = _________________________________ Interactive

Normally, we would do a regression for each of these models. But, since they differ only by a single term, we need only do the interaction model and look at the (single) interaction term using a t-test. Set up the interactive model to obtain the following output: Interactive Model
Regression Statistics
Multiple R R Square Adjusted R Square Standard Error Observations ANOVA 0.85002282 0.72253879 0.66308282 40.433563 18

df
Regression 3

SS
59603.3889

MS
19867.7963

F
12.1525012

58

Residual Total

14 17

22888.2222 82491.6111

1634.87302

Coefficients
Intercept x x1 x*x1 1410.11111 640 -47.777778 -3.3333333

Standard Error
51.3221403 165.06933 72.5804668 233.443285

t Stat
27.475688 3.87715877 -0.6582732 -0.014279

P-value
1.4008E-13 0.00167544 0.52104129 0.9888089

Model for non-union workers: x1 = ____ y– = ____________________________ Slope for non-union workers: Model for union workers: Slope for union workers: Hypothesis test to check whether union members are less responsive: H0 : __________ Ha: __________ p-value for 2-tail test: _____________ p-value for 1-tail test: ______________ Conclusion & Interpretation: x1 = _____ y– = ____________________________

(b) We are asked to compare two means for (A) non-union (B) union, regardless of bonuses, so we ignore x. The model we use is therefore a simple regression: y– = ∫0 + ∫1x1 Hypothesis test to check whether union members produce less: H0 : __________ Ha: __________ p-value for 2-tail test: _____________ p-value for 1-tail test: ______________

59

Conclusion & Interpretation:

Exercises for this topic: Comparing 4 means: Download the Sales Data (Seasonal) worksheet at http://people.hofstra.edu/faculty/Stefan_Waner/qm122 and use it to compare average sales for (A) first quarter (B) second quarter, (C) third quarter and (4) fourth quarter. (a) Construct the model and define each of the variables. (b) Perform the regression and interpret each of the slopes. (c) Is there a significant difference between sales in the different quarters? (d) According to the model, what is the difference between third and fourth quarter sales? (e) Are there any variables that do not contribute significantly to the model? If so, reduce the model appropriately and repeat parts (b) and (c). Comparing two slopes: p. 622, #12.40 For part (a), they mean an ordinary linear model. Omit (i), (j), (k), (l) since they do not tell us anything interesting. Part (m) refers to the linear model. Also, answer the following question: If we ignore shelf space (notice the nice distribution of shelf sizes anyway) do items placed in front sell better than object placed at the back? Excel Assignment 2 Go the web site at http://people.hofstra.edu/faculty/Stefan_Waner/qm122 and download the Assignment 2 Excel worksheet. Important: Use the 90% level of significance throughout. Part 1: Extract the Long Island home sales data only. Let y = Sales price in \$1000 x1 = Number of bedrooms x2 = Time on market in weeks x3 = Taxes & Maintenance Perform three regressions as follows. In each case, write down the regression model with coefficients rounded to 4 significant digits, and use the model to predict the selling price of a 3-bedroom home whose with \$25,000 taxes after 10 weeks on the market. (a) Multiple linear model: y = ∫0 + ∫1 x1 + ∫2 x2 + ∫3 x3 (b) Interactive Model: y = ∫0 + ∫1 x1 + ∫2 x2 + ∫3 x3 + ∫4 x1 x2 + ∫5 x1 x3 + ∫6 x2 x3 2 2 2 (c) Quadratic model: y = ∫0 + ∫1 x1 + ∫2 x2 + ∫3 x3 + ∫4 x1 + ∫5 x2 + ∫ 6 x3 (d) Full second order model: y = Quadratic model + interactive terms

60

(e) Compare the model in (d) with those in (b) and (c). Based on the outcomes, decide which of the three four models is best for predicting the cost of a home. [Hint: The comparison of (d) and (b) tells you whether the quadratic terms contribute significantly, and the comparison of (d) and (c) tells you whether any of the interactive terms contribute significantly.] Part 2: Using the same data sheet, compare housing prices in (A) Manhattan, (B) Westchester, (C) Connecticut, and (D) New Jersey: (a) Is there any significant difference between housing prices in the four areas? (b) What does your regression model predict for the difference between the cost of a home in New Jersey and Westchester?

61

Topic 10 Analysis of Variance (ANOVA): Single Factor Analysis (Based on 9.1 in the book) In the language of ANOVA, we are interested in the response (dependent variable, which we called y in regression) to one or more factors (independent variables which we called x1 , x2 , ... in regression). These factors may be qualitative or quantitative, and their values are called levels. This is where they differ from the qualitative variables as we used them in regression. For instance, a qualitative factor may have non-numerical levels, such as Soccer, Football, etc., while quantitative ones have numerical levels. Finally, the treatments in an experiment are the levels (in a single factor experiment) or pairs of levels (in a multiple factor experiment), and the units are the elements of the sample space n the experiment (e.g. students for SAT measurements). Design of Experiments To design an experiment for factor analysis, one needs to first select a random sample of experimental units (e.g. soccer players) and then assign them (possibly randomly) to individual treatments for a given factor (e.g. have them practice in different brands of cleats and measure the resulting wear and tear). In an observational experiment, you would not decide who wears what cleats, but simply observe the wear and tear on the brands of cleats they already use. In a completely randomized design, one assigns experimental units (soccer players) to treatments completely randomly and independently. The objective is usually to compare the sample means for the different levels: µ1, µ2, ..., µc and we will test the null hypothesis H0: µ1 = µ2 = ... = µc against Ha : at least two of the treatment means are different. Q How do we test this? A For two treatments, we need to compare two means, µ1 and µ2 .

62

Method 1: Comparison of Two Means Statistics For this, we have the following, based on the sampling distribution of x–2 -x–1 . Comparing two Means Large Samples: ß1 2 ß2 2 s1 2 s2 2 ß(x–2 -x–1 ) = + ‡ + n1 n2 n1 n2 Confidence Interval for (µ2 - µ1 ) (x–2 -x–1 ) ± zå/2 ß(x–2 -x–1 ) Hypothesis Test H0 : (µ2 -µ1 ) = D0 (D0 = 0 for our purposes here) Ha: (µ2 -µ1 ) ≠ D0 or (µ2 -µ1 ) > D0 or (µ2 -µ1 ) < D0 where D0 is some hypothesized difference between the two parameters. Test statistic: z = (x–2 -x–1 ) - D0 ß(x–2 -x–1 )

Assumptions The two samples are randomly and independently selected from the two samples, and the sample sizes are sufficiently large so that the sampling distributions are approximately normal. Small Samples When one or both of the sample sizes is small, we cannot use the above approximation of ß(x–2 -x–1 ), since it is not an unbiased estimator. An unbiased estimator is given by: s(x–2 -x–1 ) = where Ê1 1ˆ sp 2 Á + ˜ Ë n1 n2 ¯

(n1 -1)s1 2 + (n2 -1)s2 2 sp = . ("pooled sample variance") n1 +n2 -2 This estimate allows to proceed as usual for small samples, using the t-distribution instead of the normal one.
2

Assumptions The distributions of x1 and x2 are normal with the same population variance. (The latter assumption is needed in order to guarantee that we can still use the t-distribution (otherwise we would need to use a new distribution).

63

Method 2: Regression Comparing Two Means with Regression Construct the following model, but call the treatments A and B (rather than 1 and 2) Let Ï1 if the measurement is made with treatement B; x1 = Ì0 if not Ó and use E(y) = ∫0 + ∫1 x1 . Then, µA = ∫0 µB = ∫ 0 +∫1 or ∫ 1 = µB -µA , Confidence Interval for (µB - µA ) This is the confidence interval for ∫1 Hypothesis Testing H0 : ∫1 = 0 Ha: ∫1 ≠ 0, ∫1 > 0, or ∫1 < 0 (If we want to use D0 ≠ 0, then first subtract D0 from all the data for treatment B.) Assumptions Same as for Method 1. Note that the regression assumption about the "noise" amounts to saying once again that the population variances are the same: Why? Because: If treatment B is not applied, then y = ∫0 + œ, so the st. deviation of the noise œ is the st. deviation for treatment A. If B is applied, then y = ∫0 + ∫1 + œ, so that same st. deviation is the st. deviation for treatment B. Q What about more than two treatments? A We use various statistics: (1) SSA = Sum of Squares Among different treatments or groups, measuring the variability of the treatment means (weighted with the number of samples in each treatment) 2 2 2 SSA = n1(x–1-x–) + n2(x–2-x–) + ... + nc (x–c-x–) Related to that is MSA = the Mean Square Among different treatments, obtained by dividing SSA by ñ1= c-1, which is the number of degrees of freedom for the c treatments. SSA MSA = c-1 Note that, if n1 = .. = nc = n, then MSA is n times the usual sample variance of the means. (2) SSW = Sum of Squares Within, measuring the variability within each treatment 2 2 2 SSW = £ j(x1j- x–1) + £ j(x2j- x–2) + ... + £ j(xpj- x–pc)

64

where the sums are taken over all measurements within the corresponding treatment. MSW, obtained by dividing SSW by its degrees of freedom: ñ2 = n-c. SSW MSW = n-c We take the ration of the above statistics to obtain an F-statistic: MSA Variation of Means F = MSW = Variation Within If F is close to 1, then the variation among sample means is completely explained by variation within treatments, and we will tend to not reject H0. If it is much larger than 1, we will reject H0. Comparison of More than Two Means: Single Factor ANOVA H0: µ1 = µ2 = ... = µc Ha : at least two of the treatment means are different. MSA Variation of Means Test statistic: F = MSW = Variation Within Rejection region: F > Få, where Få is based on ñ1 = (c-1) numerator and ñ2 = (n-c) denominator degrees of freedom. Assumptions 1. Samples are selected independently and randomly 2. All c population distributions are normal with the same variance. We usually summarize all the ANOVA statistics in an “ANOVE table”:
Source of Variation Between Groups
Within Groups

SS

df

MS

F

P-value

F

crit

SSA c-1 SST

SSA MSA Observed MSA = c-1 F = MSW Significance Level SSW n-c MSW = n-c

Worksheet 1—Single Factor Analysis: Doing it all By Hand Your employment agency tracks 15 people after placing them in permanent jobs, obtaining the following results, after 1 year. Blue Collar Job (A) 9 12 10 8 11 White Collar Job (B) 11 11 11 13 9 Unemployed (C) 13 15 11 12 9

65

Use a Single Factor ANOVA to determine whether there is any significant difference among the three outcome means at the 95% significance level. (Give the ANOVA table, state the hypotheses, and obtain the conclusion.) Solution: H0 : ________________ Ha: _________________ n = ______ x–1 = ______ SSA
2

c = _______ x–2 = ______
2 2

x–3 = ______

x– = _________

= n1(x–1-x–) + n2(x–2-x–) + ... + nc (x–c-x–) Ê ˆ2 Ê = Ë ¯ + Ë Ê ˆ2 + Ë ¯ =

-

ˆ2 ¯

SSA MSA = c-1 =
2 2

=
2

SSW = £j(x1j- x–1) + £ j(x2j- x–2) + ... + £ j(xpj- x–pc) Ê ˆ2 Ê =Ë ¯ +Ë Ê ˆ2 Ê +Ë ¯ +Ë Ê ˆ2 Ê +Ë ¯ +Ë =

ˆ2 Ê ¯ +Ë ˆ2 Ê ¯ +Ë ˆ2 Ê ¯ +Ë

-

ˆ2 ¯ ˆ2 ¯ ˆ2 ¯

SSW MSW = n-c =

=

F= Få =

=

66

Source of Variation
Between Within Groups

SS

df

MS

F

P-value

F

crit

Groups

Rejection region:

F in rejection region? ______ Conclusion and Interpretation:

Worksheet 2—Single Factor Analysis with Excel We want to compare the distance 4 different brands of golf balls will travel when hit with a driver, using a robotic driver. Go to http://people.hofstra.edu/faculty/Stefan_Waner/qm122 and download the Golf ball file to see the data. Brand A Brand B
251 245 248 251 261 250 254 245 255 249 263 263 265 255 264 257 263 264 261 256

Brand C Brand D
270 263 278 267 271 266 271 273 276 267 252 249 249 242 247 251 262 249 247 246

Here is the resulting Excel ANOVA analysis (for å = 0.05)
Groups
Column 1

Count
10

Sum
2509

Average

Variance

250.9 23.4333333

67

Column 2 Column 3 Column 4 ANOVA

10 10 10

2611 2702 2494

261.1 13.6555556 270.2 21.5111111 249.4 27.3777778

Source of Variation Between Groups Within Groups
Total

SS
2827.8 773.8 3601.6

df
3

MS
942.6

F
43.853192

P-value
4.149E-12

F crit
2.86626545

36 21.4944444 39

Solution: H0 : ______________________ Ha: ______________________ Conclusion:

Q How do we decide which specific golf ball goes further than the others? A We can compare the four brands pairwise using any of the above procedures. To do this, we use a Tukey-Kramer procedure: Tukey-Kramer Procedure for Pairwise Comparison This is used when we reject the null hypothesis in the ANOVA test (so that there is a significant difference among the means) Procedure: (1) Compute the magnitudes of all the pairwise differences |x–i - x–j| (2) Compute the Critical Range Qij for this pair (if the numbers in each group are the same, then so are the Qij): MSWÊ 1 1 ˆ Á ˜ Qij = Q 2 Ë ni + nj ¯ where Q is the upper-tail critical value from a studentized range distribution with c df in the numerator and n-c in the denominator. (Table at the rear of the booklet.) However, if we have, say, a 95% confidence level for each hypothesis test, we cannot be 95% confident in the result of all of them.

68

Conclusion: If |x–i - x–j| exceeds Q ij, then there is a statistically significant difference between µi and µj. Otherwise, there is not. Worksheet 3—Using Tukey-Kramer Let us continue our analysis of the 4 brands of golf balls above: x–1 = ______ x–2 = ______ x–3 = ______ Enter these values in a spreadsheet as shown: A 1 2 x–1 3 x–2 4 x–3 5 x–4 Then copy across the rows and columns to instantaneously compute all the absolute values of the differences. Next, compute Qcritical (there is only one of them .. why?) MSW = Q= Qcritical = Q = ‡ Conclusion: ¥ c= (from table) MSWÊ 1 1 ˆ Á ˜ 2 Ë ni + nj ¯ 2 È 1 1 ˘ Í ˙ + Î ˚ ‡ n-c = B x–1 x–2 =ABS(B1-A2) C x–3 D x–4 E

69

Exercises for this topic: p. 434 # 9.8 (Choosing stocks with a dartboard!). Do this one "by hand" # 9.9 (Use Excel)

70

Topic 11 ANOVA—Two-Factor (Based on §9.3 in book) If we are looking at two factors (e.g. A: Type of club used to hit a ball, and B (2 of them, say): the brand of golf ball (4 of them, say)) then we might want to look at all possible combinations, or treatments: 8 of them. An experiment which includes all the possible treatments is called a complete factorial experiment. S'pose that Factor 1 has a levels and Factor 2 has b levels, so that there are ab treatments altogether. We are interested in two kinds of results: Main Effect of Factor A: H0:: No difference among the a levels in Factor A: (i.e., the brand of golf ball does not effect the distance traveled Ha : at least two of the factor A means differ.) MS(A) Test statistic: F = MSW Rejection region F>Få based on (a-1) numerator & (n-ab) denominator. Main Effect of Factor B: H0:: No difference among the b levels in Factor B: (i.e., the type of golf club does not effect the distance traveled Ha : at least two of the factor B means differ.) MS(B) Test statistic: F = MSW Rejection region F>Få based on (b-1) numerator & (n-ab) denominator. Interaction: H0: Factors A and B do not interact to effect the response mean (i.e., changing the golf ball has no effect on the ratios of the mean distances for the type of club used.) Ha : A and B do interact to effect the response mean.) MS(AB) Test statistic: F = MSW Rejection region F>Få based on (a-1)(b-1) numerator & (nab) denominator. Q Exactly what are all these things MS(A), MS(B) and MS(AB), etc? A They are obtained as follows. SS(A) = n1(x–1-x–)2 + n2(x–2-x–)2 + ... + na (x–a -x–)2, where the x–1 is the mean for all data from level 1 of Factor A, x–2 is the mean for level 2, etc. (just ignore which level of Factor B they belong to). x– is the overall mean. Then, to get MS(A), divide by the (number of treatments for Factor A) -1: SS(A) MS(A) = a-1 SST(B) and MS(B) are defined similarly. 71

For SS(AB), use the sum of all terms nij (x–ij - x–j - x–j + x–)

2

where x–ij is the mean of all data from treatment (i, j); that is, level i of factor A and level j of factor B, and nij is the number of these data points. SS(AB) So, MS(AB) = (a-1)(b-1) Question: What do we do when there is interaction? Answer: The interaction test should be done first because, it there is interaction, then the results for main effects are not informative (certain levels of Factor A might respond favorably with certain levels of Factor B) and the Main Effects statistics combine all the levels of one of the factors. When there is interaction, the only meaningful pairwise comparisons are among all the ab treatments. That is, regard the entire experiment as a single factor one with ab different levels, and do a pairwise comparison using TukeyKramer. Question: If there is no interaction? Answer Then do the entire analysis. If Factor A has an effect, then do a pairwise comparison among the a levels in Factor A using the following critical value for Q (due to Tukey —by himself, this time): MSW Qcritical = Q bn' where n' = number of data scores within each treatment, and where Q has the following degrees of freedom: numerator: a, denominator: ab(n'-1) Worksheet 1—Two Factor ANOVA with Excel We consider more golf club data where, this time the factors are: Factor A: type of club; a = 2 Factor B: brand of club; b = 4 The following data is at http://people.hofstra.edu/faculty/Stefan_Waner/qm122 under Golfball Two Factor. B: BRAND 1 2 3 4 227 238 241 220 Driver 232 232 247 229 234 227 240 233 A: TYPE 221 237 245 238 164 184 186 170 5 Iron 180 181 193 179 167 180 190 184 173 186 192 187

72

Here is the Excel Two Factor (with replication) output for this data (we replicate this in class). Note that the input data must include the headings: it is the block outlined above.
SUMMARY Brand 1 Driver Count Sum Average Variance Brand 2 Brand 3 Brand 4 Total 4 16 920 3741 230 233.8125 58 60.8291667

4 4 4 914 934 973 228.5 233.5 243.25 33.6666667 25.6666667 10.9166667

Count Sum Average Variance

4 4 4 4 16 684 731 761 720 2896 171 182.75 190.25 180 181 50 7.58333333 9.58333333 55.3333333 75.0666667

Total
Count Sum Average Variance 8 1598 199.75 980.5 8 8 8 1665 1734 1640 208.125 216.75 205 750.125 811.357143 762.857143

ANOVA

Source of Variation
Sample Columns Interaction Within Total

SS

df

MS

F

P-value

F crit

SS(A)
22313.2813

MS(A)
1 22313.2813 711.889332 2.3699E-19 4.25967528

SS(B)

MS(B)

1217.84375 68.34375

SS(AB) SSW
752.25

3 405.947917 12.9514789 3.1138E-05 3.00878611

MS(AB) MSW
31.34375

3 24 31

22.78125 0.72681954 0.54597736 3.00878611

24351.7188

Let us now test the following hypotheses, as shown in the box before the example: Factor A = type of club; a = 2 Factor B = brand of club; b = 4 n = number of data points = 32 Interaction: H0 : ___________________________ Ha: ___________________________ P-value: ______________ Conclusion: 73

Main Effect of Factor A:

H0 : _____________ Ha: _____________ P-value: ______________

Conclusion:

Main Effect of Factor B:

H0 : _____________ Ha: _____________ P-value: ______________

Conclusion:

Tukey for Factor A: x–1 = Average for all drivers = 233.8125 x–2 = Average for all 5-irons = Ô |x–2 - x–1 | = Ô Ô

(Get this from the above output) Ô Ô = Ô

-

n' = Number of data scores within each treatment = Degrees of freedom for Q: Numerator: a = Denominator: ab(n'-1) = MSW = bn'

Qcrit = Q

Conclusion:

74

Tukey for Factor B: x–1 = Average for all brand 1 golf balls = 199.75 (Get this from the above output) x–2 = Average for all brand 2 golf balls = x–3 = Average for all brand 3 golf balls = x–4 = Average for all brand 4 golf balls = Differences Table: |x–i - x–j| A 1 2 x–1 3 x–2 4 x–3 5 x–4 n' = Number of data scores within each treatment = Degrees of freedom for Q: Numerator: b = Denominator: ab(n'-1) = MSW = an'

B x–1 x–2

C x–3

D x–4

E

Qcrit = Q

Conclusion:

Exercises for this topic: p. 448, 9.21 (Note that the table is set up poorly. Put the right-half of the table under the left half to get something like we had above.) Factor A = Development time, Factor B = Developer strength. Also, p. 449, 9.23.

75

Topic 12 Quality Improvement: Types of Variation (Based on §15.6 & 15.5 in book) Basically, we are interested in monitoring the output of some (industrial) process to check for patterns that might indicate a production problem. We use time series plot together with a centerline drawn at the intended mean. Examples of Variation: Oscillation up & down relative to mean Uptrend/downtrend increasing variance cyclical behavior meandering (autocorrelation) outlier/shock level shift (jump to new level) The output distribution is characterized by its mean and variance. If neither of these quantities changes with time, then the process is in a state of statistical control. Otherwise, it's out of statistical control. Note that random behavior is not a sign of being out of control. However, variation of its mean and variance is. Testing for Statistical Control The First Test: The 3ß-Control Limit Let H0: Process is under control (normally distributed with st. deviation ß) Ha : Process is out of control If the process is under control, then 0.0027 (or 0.27%) of the data point should lie outside 3 standard deviations from the mean. So, every time the machine produces a widget, we can measure its size, and then test Ho. Let our rule for rejection be this: Rule for rejecting H0: If the reading is outside 3ß, then reject H0. The probability of a Type I error is then P(we reject H0 | H0 is valid) = P(reading is outside 3ß | data is normally distributed with st. deviation ß) = 0.0027. Question What do we use as the mean and standard deviation for the process? Answer The sample mean and st. deviation, if that's all we can find. Types of Charts: First, we look at charts to monitor the ranges of a process (R charts) and the sample means (x– charts). The first chart that should be examined for a specific process is the R chart, because if it is out of statistical control, then the information given on the x– chart may not be meaningful.

76

1. R chart R stands for Range, and this gives a useful estimate for monitoring the standard deviation of smallish samples. To measure R, we use small samples of output readings, compute the range of each, and then plot the data. In the graph, we use a centerline and upper and lower control limits (UCL, LCL). These are estimates of the following quantities: Centerline = estimate of µ (population mean of the ranges) UCL = estimate of µ + 3ß/ n (n = sample size, ß = standard deviation of the ranges) Unbiased estimators are given as follows: Estimator of R: R— Estimator for µ - 3ß/ n = D3R— Estimator for µ + 3ß/ n = D4R— ¨ Centerline ¨ LCL ¨ UCL

where D3 and D4 are obtained from the control chart table at the back.. (It is computed from intermediate statistics called d2 and d3 , also shown in that table). Given these limits, we graph the time series in question (R in this case) and use the following pattern recognition rules to determine whether the process is out of statistical control: Pattern Analysis Rules These are rules to spot rare events; that is, events that indicate a likelihood that a process is out of control. H0: Process is under control (normally distributed with a fixed standard deviation) Ha : Process is out of control We reject H0 if any one of the following conditions are found: Rule 1: One or more points beyond the UCL or LCL (Outlier or increasing variance) Rule 2: 8 points in a row on the same side of the centerline (Meandering, Uptrend/downtrend, or level shift) Rule 3: Six points in a row monotonically increasing or decreasing (Uptrend/downtrend) Rule 4: 14 points in a row oscillating up & down (Oscillation) Note: Detecting cyclical behavior is more tricky, and may require more sophisticated methods (such as Fourier transform methods). When a process is suspected of being out of control, the process should be analyzed to determine what, if any, changes should be made. Even when it is in statistical control, the

77

process might not be satisfactory — for instance, the mean value of R might be too large, reflecting an unacceptably large variation in the product being manufactured. Worksheet 1—R Chart The following data is at http://people.hofstra.edu/faculty/Stefan_Waner/qm122 under Soda Bottle Fills:
Soda Bottle (liters) Sample 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 # 1.006 0.997 0.996 0.999 0.995 1.009 0.989 0.995 1 1.006 1.009 0.996 0.992 0.986 1.005 0.988 0.997 0.993 1.014 0.991 1.008 0.988 1.013 0.988 0.997 0.996 1.008 1.002 0.988 1.013 1.013 1.002 0.997 0.993 0.992 0.992 1.007 0.998 0.997 0.987 0.988 0.994 0.995 1.001 1 1.009 1.008 1.001 1.006 1.001 1.008 0.988 1.009 0.988 0.995 1.013 1.014 1.005 1.013 1.01 1.015 1 0.986 0.986 0.994 0.999 0.997 0.989 1.008 0.998 0.999 0.99 1.012 0.99 0.999 0.993 1.011 0.986 1.001 0.993 1.012 0.99 1.014 1 1.008 1.01 0.996 1.006 0.993 1.006 0.987 1.006 0.99 1.003 1.012 1.013 0.987 0.993 1.008 0.994 1.003 0.988 1.013 1.008 1.002 0.99 1.007 0.987 0.986 1.01 0.989 0.987 0.989 0.99 1.013 0.996 0.991 0.991 0.996 1.005 1.006 1.013 1.012 0.986 1.003 1.002 1.001 0.996 1.006 1.002 0.992 0.992 0.997 1.004 1.008 1.01 1.006 1.002 1.009 1.007 0.999 0.996 0.993 1.007 1.011 0.989 0.989 0.993 1.014 1.013 Fills

Control limits for R-chart: 78

Centerline = R— = D3 = LCL = D3 R— = UCL = D4 R— = Now we graph the ranges with the control limits, and look at each of the pattern recognition rules: Rule 1: One or more points beyond the UCL or LCL (Outlier or increasing variance) Yes No Rule 2: 8 points in a row on the same side of the centerline (Meandering, Uptrend/downtrend, or level shift) Yes No Rule 3: Six points in a row monotonically increasing or decreasing (Uptrend/downtrend) Yes No Rule 4: 14 points in a row oscillating up & down (Oscillation) Yes No Conclusion: D4 =

2. Means Chart (x– Chart) Used to detect changes in the sample mean: Here we plot successive sample means vs. time. Centerline = estimate of µ (population mean of the x-values) UCL = estimate of µ + 3ß/ n (n = sample size, ß = standard deviation of the samples) Unbiased estimators are given as follows: Estimator of R: x–— Estimator for µ - 3ß/ n = x–— - A2 R— Estimator for µ + 3ß/ n = x–— + A2 R— ¨ Centerline ¨ LCL ¨ UCL

where A2 is obtained from the control chart table at the back.. (It is computed using the estimate

79

R— ^ ß = , (d2 is an estimator of R/ß and depends on n) d2 where R— is the mean of the sample ranges Worksheet 2—x– Chart We again use the soda data at http://people.hofstra.edu/faculty/Stefan_Waner/qm122 under Soda Bottle Fills. Control limits for R-chart: Centerline = x–— = A2 = LCL = x–— - A2 R— = UCL = x–— + A2 R— = Now we graph the means with the control limits, and look at each of the pattern recognition rules: Rule 1: One or more points beyond the UCL or LCL (Outlier or increasing variance) Yes No Rule 2: 8 points in a row on the same side of the centerline (Meandering, Uptrend/downtrend, or level shift) Yes No Rule 3: Six points in a row monotonically increasing or decreasing (Uptrend/downtrend) Yes No Rule 4: 14 points in a row oscillating up & down (Oscillation) Yes No Conclusion: R— =

3. Proportions Chart (p-Chart) This is used for monitoring qualitative processes: e.g., is the product defective or not? The statistic we monitor here is ^ = # defective items in the sample (we are monitoring this statistic) p # items in the sample

80

total # defective items p– = total # items monitored ßp– =

(an estimator of p) ¨ Centerline

p(1-p) (n = size of each sample) n Q Where does the standard deviation formula come from? A When n = 1, we are dealing with samples of size 1, and so ^ = Ï0 if the item is not defective Ì p . Ó1 if it is But this is precisely the binomial random variable x which we know from QM I has ^ standard deviation p(p-1) . For larger samples, p is just the mean x– of this binomial random variable, so we are in the sampling distribution of the mean of x. The Central Limit Theorem tells us that the sampling distribution of p– has standard deviation p(p-1) / Exercises for this topic: p. 770 #15.14 n.

81

Topic 12 2 Using the Chi-Square (≈ ) Distribution: Multinomial Distributions and Testing for Independence (The first topic is similar to §10.3 but interpreted differently — see notes— and the second is §10.4) Multinomial Distributions Recall that a Bernoulli trial has two outcomes: success/failure. What about three or more outcomes? For this, we talk of the Multinomial Probability Distribution. This is really a "vector-valued" binomial distribution: Suppose for example, there are n possible outcomes at every trial. Then let 1 if the outcome is #1 1 if the outcome is #2 Ì Ì x1 = Ï0 if not , x2 = Ï0 if not , ... , Ó Ó Ï1 if the outcome is #n xk = Ì0 if not . Ó Then, if pi = P(xi = 1), one has p1 + p2 + ... + pk = 1. For example, p1 is the probability of consumers who prefer Brand i. Here, we test the following hypothesis: H0: p1, p2, ... , pk have specified values P0, ... , Pk (for instance, in a no-preference situation, Pi = 1/k) Ha : At least one of the probabilities differs from the prescribed value. The experiment to test the hypothesis: In a sample of size n, let n1 = # of responses in which the outcome is outcome #1 n2 = # of responses in which the outcome is outcome #2 ... nk = # of responses in which the outcome is outcome #k and let n = n1 + ... + nk (total sample size). If H0 is valid, then each outcome has expected value E(xi) = nPi where n is the total sample size. We use the following test statistic: [n1 - E(x1)]2 [n - E(xk )]2 + ... + k E(x1) E(xk ) (Note: ni = observed value, E(xi) = predicted value) ≈2 = For sufficiently large4 sample size n, the (sampling) distribution of ≈ 2 (in a situation where H0 is true) is approximately the Chi-Square distribution with (k-1) degrees of freedom. Q What do we mean by that? A Take many samples of size n, and measure ≈ 2 for all of these. The resulting probability distribution is approximately Chi-Square with (k-1) degrees of freedom.
4

large enough, that is, so that E(ni ) exceeds 5.

82

Q Why k-1 degrees of freedom? A The loss of one is due to the equation p1 + p2 + ... + pk = 1. Q Why is the binomial formula for E(xi) still valid in a multinomial experiment? A To compute E(xi), lump all the other outcomes together as "failure" and you are in the binomial distribution. Multinomial Probability Distribution This is a sequence of n independent (identical) trials, where there are k possible outcomes in each trial. With
Ï1 if the outcome is #i xi = Ì0 if not Ó

and pi = P(xi = 1), one has p1 + p2 + ... + pk = 1. Hypotheses H0: p1 = P1, p2 = P2, ... , pk = Pk Ha : At least one of the pi ≠ Pi. Test Statistic With ni = # of responses in which the outcome is outcome #i Take [n1 - E(x1)]2 [nk - E(xk )]2 2 ≈ = + ... + , where E(xi) = nPi E(x1) E(xk ) 2 2 Critical value for ≈ = ≈å =CHIINV(ALPHA, DF) Uses df = k-1 Notes 1. This is a two-sided test; the test statistic does not differ between positive and negative values of ni-E(xi). 2. The test statistic can be rewritten as follows if we divide top & bottom by n: ^ ^ n1 [p1 - P1 ]2 nk[pk - Pk]2 2 ≈ = + ... + P1 Pk where ^ is the observed proportion corresponding to outcome i: p
i

^ = ni pi n Assumptions Same as for the binomial distribution: The probability of each outcome is fixed and independent of the history.

83

Worksheet 1—Multinomial Distribution Pay increases at Company X depend on evaluation scores, as follows: Scores > 80 Æ Merit pay increase Scores in [50,80] Æ Standard pay increase Scores < 50 Æ No pay increase The company designed the system with the expectation that 25% would get merit increases, 65% would get standard increases and 10% no increases. The actual results in a survey of the 600 instances (after several years of doing this) was: n1 = 193; n2 = 365; n3 = 42. (a) Test these data at the 95% level as to whether the actual pay increases differed significantly from the desired outcomes (indicating to management that they had better change the test...) (b) Construct a 95% confidence interval for the merit pay outcome. Solution (a) n= P1 = H0 : H a: E(x1) = nP1 = E(x2) = nP2 = E(x3) = nP3 = [n - E(x1)] ≈ = 1 E(x1) ˘2 ˙ ˚ +
2 2

k = Number of outcomes = P2 = P3 =

= = = [n2 - E(x2)]2 + + E(x2) È Í Î [n3 - E(x3)]2 E(x3) 2 ˘ È ˙ Í ˚ Î + +

=

È Í Î

-

˘2 ˙ ˚

= = Critical value: df = k-1 = ≈ å2 =

+

Rejection region:

84

Conclusion:

(b) Think of this as a test with two outcomes: Success = Merit pay outcome (outcome #1); Failure = any of the other two. Then we have a binomial distribution, which we approximate with a normal distribution. The confidence interval for x1 can now be computed using the binomial distribution confidence interval: ^ ±z p å/2 where ^ = Probability of success (observed) = p n= ß^ = p = ^ (1-p) p ^ n ¥ ‡ zå/2 = z____ = p(1-p) n

This gives the CI as CI = ‡ ‡[

± ± , ]

Note We can use the above procedure to compare two probability distributions as in the textbook: Think of one of them as the observed set of probabilities and the other as the hypothesized set of probabilities. As far as rejecting the null hypothesis is concerned, it does not mater which set is which. Testing for Independence In QM I we all saw tables like following: Example 1 A survey of 100 stocks shows the following performance after one year

85

Pharmaceutical Companies Electronic Companies Banking Company Totals

Increased ≥ 20% n11 = 10 n21 = 5 n31 = 15 30

Stayed Within ±20% n12 = 30 n22 = 0 n32 = 10 40

Decreased ≥ 20% n13 =10 n23 = 5 n33 = 15 30

Totals 50 10 40 n = 100

Associated the cells are probabilities given by n pij = ij (n = total sample size = 100 here) n These are called marginal probabilities. Let us designate these probabilities as follows: Increased ≥ 20% p11 p21 p31 PC1 Stayed Within ±20% p12 p22 p32 PC2 Decreased ≥ 20% p13 p23 p33 PC3 Totals PR1 PR2 PR3 1

Pharmaceutical Companies Electronic Companies Banking Company Totals

In QM I we were asked such questions as "are "Increased>20%" and "Banking Company" independent? In real life, they were practically always dependent, since the requirement for independence is that p1 1 = PR 1PC1 etc., and getting exact equality would be next-to impossible, given random errors. Instead, we ask the question in the form of a hypothesis: H0: The row events are independent of the column events. Ha : At least one of the row events is not independent of a column event. Mathematically, H0 means that pij = PRiPCj (recalling QM I) for every pair (i, j) For this example, it means: H0: The performance of a stock does not depend on the type of stock Ha : The performance of a stock does depend on the type of stock We use, as estimates of the marginal probabilities, the relative frequencies found in the table above, and compute a test statistic.

86

PRiPCj i,j i,j where E(xij) = n PRiPCj = Expected frequency. (Note that this is not the same as the observed frequency pij.) Q How many degrees of freedom are there? A If we are thinking of the Pri and Pcj as fixed, the last probability in each row and column is determined by the others, and so df = (r-1)(c-1). In this example, df = (3-1)(3-1) = 4. Worksheet 2 — Testing for Independence Test the above data for statistical independence. We use Excel as follows (careful with the totals!) Observed Freq
Pharmaceutical Electronic Banking Totals Incr 10 5 15 30 Same 30 0 10 40 Decr 10 5 15 30 Totals 50 15 40 100

≈ =

2

Â

[nij - E(xij)]2 E(xij)

or

≈ =

2

Â

n[pij - PRiPCj]2

Expected Freq
Incr Pharmaceutical Electronic Banking Totals Same Decr Totals

[ ni j - E(xi j) ]2 E(xi j)
Incr Pharmaceutical Electronic Banking Totals Same Decr Totals

≈2 = Critical value: df = (r-1)(c-1) = ≈ å2 = Rejection region:

87

Conclusion:

Here is a plot of the observed data:
35 30 25 20 15 10 5 0 Incr Same Decr Pharmaceutical Electronic Banking

Had they been statistically independent, the graphs would have been close to parallel Example 2 (Independent Events) Here is some adjusted data that gives no rejection of H0 (try it on your spreadsheet —if it is set up properly, you need do nothing except enter the given data in the unshaded cells:
Incr Pharmaceutical Electronic Banking Totals 10 5 15 30 Same 7 3 10 20 Decr 10 5 15 30 Totals 27 13 40 80

16 14 12 10 8 6 4 2 0 Incr Same Decr Pharmaceutical Electronic Banking

88

Exercises for this topic Multinomial Distributions: p. 499 # 10.39 Independence: p. 497 # 10.31 Include a plot of the observed data. Excel Assignment 3 Uncovering Tax Fraud using Benford's Law and Chi Square You are a tax fraud specialist working for the Internal Revenue Service (IRS), and have just been handed a portion of the tax return from Colossal Conglomerate. The agency suspects that the portion you were handed may be fraudulent, and would like your opinion. Is there any mathematical test, you wonder, that can point to a suspicious tax return based on nothing more than the numbers entered? You decide, on an impulse, to make a list of the first digits of all the numbers entered in the portion of the Colossal Conglomerate tax return (there are 625 of them). You first reason that, if the tax return is an honest one, the first digits of the numbers should be uniformly distributed. More precisely, if the experiment consists of selecting a number at random from the tax return, and the random variable X is defined to be the first digit of the selected number, then X should have the following probability distribution: y P(X=x) 1 1/9 2 1/9 3 1/9 4 1/9 5 1/9 6 1/9 7 1/9 8 1/9 9 1/9

You then do a quick calculation based on this probability distribution, and find an expected value of E(X) = 5. Next, you turn to the Colossal Conglomerate return data and calculate the relative frequency (experimental probability) of the actual numbers in the tax return. You find the following results. Colossal Conglomerate Return 3 4 5 6 0.13 0.11 0.07 0.07

y P(Y=y)

1 0.31

2 0.16

7 0.05

8 0.06

9 0.04

It certainly does look suspicious! For one thing, the smaller digits (especially 1) seem to occur a lot more often than any of the larger digits. Moreover, when you compute the expected value, you obtain E(Y) = 3.42, considerably lower than the value of 5 you predicted. Gotcha! You are about to file a report recommending a detailed audit of Colossal Conglomerate when you recall an article you once read about first digits in lists of numbers. The article dealt with a remarkable discovery in 1938 by Dr. Frank Benford, a physicist at the General Electric company. What Dr. Benford noticed was that the pages of logarithm tables that listed numbers starting with the digits 1 and 2 tended to be more soiled and dogeared than the pages whose listed numbers started with larger digits—say, 8. For some reason, numbers starting with low digits seemed more prevalent than numbers starting with high digits. He subsequently analyzed more than 20,000 sets of numbers, such as tables of 89

baseball statistics, listings of widths of rivers, half-lives of radioactive elements, street addresses, and numbers in magazine articles. The result was always the same: inexplicably, numbers starting with low digits tended to appear more frequently than the high ones, with numbers beginning with the digit 1 most prevalent of all.5 Moreover, the expected value of the first digit was not the expected 5, but 3.44. Since the first digits in Colossal Conglomerate's return have an expected value of 3.42; very close to Benford's value, it might appear that your suspicion was groundless after all. (Back to the drawing board...) Out of curiosity, you decide to investigate Benford's discovery more carefully. What you find is that Benford did more than simply observe a strange phenomenon in lists of numbers. He went further and derived the following formula for the probability distribution of first digits in lists of numbers. P(X=x) = log(1 + 1/x) (x = 1, 2, ..., 9)

You compute these probabilities, and find the following distribution. x P(X=x) 1 0.30 2 0.18 3 0.12 4 0.10 5 0.08 6 0.07 7 0.06 8 0.05 9 0.05

(a) Give a bar graph which compares the probabilities of the first digits predicted by Benford's law with those observed in the tax return. It should look something like the following (although the data are different).

(b) Apply a Chi-Square test to the hypothesis that p(X=1), p(X=2), ... ,p(X=9) have the values specified by Benford's law at the 95% significance level. Use the Excel setup shown below. (Note that n = 625 here and is entered into the cell that calculates ≈ 2 .) What do you conclude about Colossal Conglomerate's tax return?

5

The does not apply to all lists of numbers. For instance, a list of randomly chosen numbers between 1 and 999 will have first digits uniformly distributed between 1 and 9.

90

(c) Repeat parts (a) and (b) for the Honest Growth Funds Stockholder Report (n = 400) where the distribution of first digits is shown below. Honest Growth Funds Return 3 4 5 6 0.1 0.11 0.07 0.09

y P(Y=y)

1 0.28

2 0.16

7 0.05

8 0.07

9 0.07

91

Normal Distribution: P(Z ≤ z) Negative z
z 0.00 0.01 0.02 0.03 0.04

Excel: =NORMSDIST(z)
0.06 0.07 0.08 0.09

0.05

- 0 . 0 0.50000 0.49601 0.49202 0.48803 0.48405 0.48006 0.47608 0.47210 0.46812 0.46414 - 0 . 1 0.46017 0.45620 0.45224 0.44828 0.44433 0.44038 0.43644 0.43251 0.42858 0.42465 - 0 . 2 0.42074 0.41683 0.41294 0.40905 0.40517 0.40129 0.39743 0.39358 0.38974 0.38591 - 0 . 3 0.38209 0.37828 0.37448 0.37070 0.36693 0.36317 0.35942 0.35569 0.35197 0.34827 - 0 . 4 0.34458 0.34090 0.33724 0.33360 0.32997 0.32636 0.32276 0.31918 0.31561 0.31207 - 0 . 5 0.30854 0.30503 0.30153 0.29806 0.29460 0.29116 0.28774 0.28434 0.28096 0.27760 - 0 . 6 0.27425 0.27093 0.26763 0.26435 0.26109 0.25785 0.25463 0.25143 0.24825 0.24510 - 0 . 7 0.24196 0.23885 0.23576 0.23270 0.22965 0.22663 0.22363 0.22065 0.21770 0.21476 - 0 . 8 0.21186 0.20897 0.20611 0.20327 0.20045 0.19766 0.19489 0.19215 0.18943 0.18673 - 0 . 9 0.18406 0.18141 0.17879 0.17619 0.17361 0.17106 0.16853 0.16602 0.16354 0.16109 - 1 0.15866 0.15625 0.15386 0.15151 0.14917 0.14686 0.14457 0.14231 0.14007 0.13786 - 1 . 1 0.13567 0.13350 0.13136 0.12924 0.12714 0.12507 0.12302 0.12100 0.11900 0.11702 - 1 . 2 0.11507 0.11314 0.11123 0.10935 0.10749 0.10565 0.10383 0.10204 0.10027 0.09853 - 1 . 3 0.09680 0.09510 0.09342 0.09176 0.09012 0.08851 0.08692 0.08534 0.08379 0.08226 - 1 . 4 0.08076 0.07927 0.07780 0.07636 0.07493 0.07353 0.07215 0.07078 0.06944 0.06811 - 1 . 5 0.06681 0.06552 0.06426 0.06301 0.06178 0.06057 0.05938 0.05821 0.05705 0.05592 - 1 . 6 0.05480 0.05370 0.05262 0.05155 0.05050 0.04947 0.04846 0.04746 0.04648 0.04551 - 1 . 7 0.04457 0.04363 0.04272 0.04182 0.04093 0.04006 0.03920 0.03836 0.03754 0.03673 - 1 . 8 0.03593 0.03515 0.03438 0.03362 0.03288 0.03216 0.03144 0.03074 0.03005 0.02938 - 1 . 9 0.02872 0.02807 0.02743 0.02680 0.02619 0.02559 0.02500 0.02442 0.02385 0.02330 - 2 0.02275 0.02222 0.02169 0.02118 0.02068 0.02018 0.01970 0.01923 0.01876 0.01831 - 2 . 1 0.01786 0.01743 0.01700 0.01659 0.01618 0.01578 0.01539 0.01500 0.01463 0.01426 - 2 . 2 0.01390 0.01355 0.01321 0.01287 0.01255 0.01222 0.01191 0.01160 0.01130 0.01101 - 2 . 3 0.01072 0.01044 0.01017 0.00990 0.00964 0.00939 0.00914 0.00889 0.00866 0.00842 - 2 . 4 0.00820 0.00798 0.00776 0.00755 0.00734 0.00714 0.00695 0.00676 0.00657 0.00639 - 2 . 5 0.00621 0.00604 0.00587 0.00570 0.00554 0.00539 0.00523 0.00508 0.00494 0.00480 - 2 . 6 0.00466 0.00453 0.00440 0.00427 0.00415 0.00402 0.00391 0.00379 0.00368 0.00357 - 2 . 7 0.00347 0.00336 0.00326 0.00317 0.00307 0.00298 0.00289 0.00280 0.00272 0.00264 - 2 . 8 0.00256 0.00248 0.00240 0.00233 0.00226 0.00219 0.00212 0.00205 0.00199 0.00193 - 2 . 9 0.00187 0.00181 0.00175 0.00169 0.00164 0.00159 0.00154 0.00149 0.00144 0.00139 - 3 0.00135 0.00131 0.00126 0.00122 0.00118 0.00114 0.00111 0.00107 0.00104 0.00100 - 3 . 1 0.00097 0.00094 0.00090 0.00087 0.00084 0.00082 0.00079 0.00076 0.00074 0.00071 - 3 . 2 0.00069 0.00066 0.00064 0.00062 0.00060 0.00058 0.00056 0.00054 0.00052 0.00050 - 3 . 3 0.00048 0.00047 0.00045 0.00043 0.00042 0.00040 0.00039 0.00038 0.00036 0.00035 - 3 . 4 0.00034 0.00032 0.00031 0.00030 0.00029 0.00028 0.00027 0.00026 0.00025 0.00024 - 3 . 5 0.00023 0.00022 0.00022 0.00021 0.00020 0.00019 0.00019 0.00018 0.00017 0.00017 - 3 . 6 0.00016 0.00015 0.00015 0.00014 0.00014 0.00013 0.00013 0.00012 0.00012 0.00011 - 3 . 7 0.00011 0.00010 0.00010 0.00010 0.00009 0.00009 0.00008 0.00008 0.00008 0.00008 - 3 . 8 0.00007 0.00007 0.00007 0.00006 0.00006 0.00006 0.00006 0.00005 0.00005 0.00005 - 3 . 9 0.00005 0.00005 0.00004 0.00004 0.00004 0.00004 0.00004 0.00004 0.00003 0.00003

92

Positive z
z 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0 . 0 0.50000 0.50399 0.50798 0.51197 0.51595 0.51994 0.52392 0.52790 0.53188 0.53586 0 . 1 0.53983 0.54380 0.54776 0.55172 0.55567 0.55962 0.56356 0.56749 0.57142 0.57535 0 . 2 0.57926 0.58317 0.58706 0.59095 0.59483 0.59871 0.60257 0.60642 0.61026 0.61409 0 . 3 0.61791 0.62172 0.62552 0.62930 0.63307 0.63683 0.64058 0.64431 0.64803 0.65173 0 . 4 0.65542 0.65910 0.66276 0.66640 0.67003 0.67364 0.67724 0.68082 0.68439 0.68793 0 . 5 0.69146 0.69497 0.69847 0.70194 0.70540 0.70884 0.71226 0.71566 0.71904 0.72240 0 . 6 0.72575 0.72907 0.73237 0.73565 0.73891 0.74215 0.74537 0.74857 0.75175 0.75490 0 . 7 0.75804 0.76115 0.76424 0.76730 0.77035 0.77337 0.77637 0.77935 0.78230 0.78524 0 . 8 0.78814 0.79103 0.79389 0.79673 0.79955 0.80234 0.80511 0.80785 0.81057 0.81327 0 . 9 0.81594 0.81859 0.82121 0.82381 0.82639 0.82894 0.83147 0.83398 0.83646 0.83891 1 . 0 0.84134 0.84375 0.84614 0.84849 0.85083 0.85314 0.85543 0.85769 0.85993 0.86214 1 . 1 0.86433 0.86650 0.86864 0.87076 0.87286 0.87493 0.87698 0.87900 0.88100 0.88298 1 . 2 0.88493 0.88686 0.88877 0.89065 0.89251 0.89435 0.89617 0.89796 0.89973 0.90147 1 . 3 0.90320 0.90490 0.90658 0.90824 0.90988 0.91149 0.91308 0.91466 0.91621 0.91774 1 . 4 0.91924 0.92073 0.92220 0.92364 0.92507 0.92647 0.92785 0.92922 0.93056 0.93189 1 . 5 0.93319 0.93448 0.93574 0.93699 0.93822 0.93943 0.94062 0.94179 0.94295 0.94408 1 . 6 0.94520 0.94630 0.94738 0.94845 0.94950 0.95053 0.95154 0.95254 0.95352 0.95449 1 . 7 0.95543 0.95637 0.95728 0.95818 0.95907 0.95994 0.96080 0.96164 0.96246 0.96327 1 . 8 0.96407 0.96485 0.96562 0.96638 0.96712 0.96784 0.96856 0.96926 0.96995 0.97062 1 . 9 0.97128 0.97193 0.97257 0.97320 0.97381 0.97441 0.97500 0.97558 0.97615 0.97670 2 . 0 0.97725 0.97778 0.97831 0.97882 0.97932 0.97982 0.98030 0.98077 0.98124 0.98169 2 . 1 0.98214 0.98257 0.98300 0.98341 0.98382 0.98422 0.98461 0.98500 0.98537 0.98574 2 . 2 0.98610 0.98645 0.98679 0.98713 0.98745 0.98778 0.98809 0.98840 0.98870 0.98899 2 . 3 0.98928 0.98956 0.98983 0.99010 0.99036 0.99061 0.99086 0.99111 0.99134 0.99158 2 . 4 0.99180 0.99202 0.99224 0.99245 0.99266 0.99286 0.99305 0.99324 0.99343 0.99361 2 . 5 0.99379 0.99396 0.99413 0.99430 0.99446 0.99461 0.99477 0.99492 0.99506 0.99520 2 . 6 0.99534 0.99547 0.99560 0.99573 0.99585 0.99598 0.99609 0.99621 0.99632 0.99643 2 . 7 0.99653 0.99664 0.99674 0.99683 0.99693 0.99702 0.99711 0.99720 0.99728 0.99736 2 . 8 0.99744 0.99752 0.99760 0.99767 0.99774 0.99781 0.99788 0.99795 0.99801 0.99807 2 . 9 0.99813 0.99819 0.99825 0.99831 0.99836 0.99841 0.99846 0.99851 0.99856 0.99861 3 . 0 0.99865 0.99869 0.99874 0.99878 0.99882 0.99886 0.99889 0.99893 0.99896 0.99900 3 . 1 0.99903 0.99906 0.99910 0.99913 0.99916 0.99918 0.99921 0.99924 0.99926 0.99929 3 . 2 0.99931 0.99934 0.99936 0.99938 0.99940 0.99942 0.99944 0.99946 0.99948 0.99950 3 . 3 0.99952 0.99953 0.99955 0.99957 0.99958 0.99960 0.99961 0.99962 0.99964 0.99965 3 . 4 0.99966 0.99968 0.99969 0.99970 0.99971 0.99972 0.99973 0.99974 0.99975 0.99976 3 . 5 0.99977 0.99978 0.99978 0.99979 0.99980 0.99981 0.99981 0.99982 0.99983 0.99983 3 . 6 0.99984 0.99985 0.99985 0.99986 0.99986 0.99987 0.99987 0.99988 0.99988 0.99989 3 . 7 0.99989 0.99990 0.99990 0.99990 0.99991 0.99991 0.99992 0.99992 0.99992 0.99992 3 . 8 0.99993 0.99993 0.99993 0.99994 0.99994 0.99994 0.99994 0.99995 0.99995 0.99995 3 . 9 0.99995 0.99995 0.99996 0.99996 0.99996 0.99996 0.99996 0.99996 0.99997 0.99997

93

df 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 40 45 50 75 100 200 1000

0.1 3.078 1.886 1.638 1.533 1.476 1.440 1.415 1.397 1.383 1.372 1.363 1.356 1.350 1.345 1.341 1.337 1.333 1.330 1.328 1.325 1.323 1.321 1.319 1.318 1.316 1.315 1.314 1.313 1.311 1.310 1.309 1.309 1.308 1.307 1.306 1.303 1.301 1.299 1.293 1.290 1.286 1.282

t-Statistic 0.05 6.314 2.920 2.353 2.132 2.015 1.943 1.895 1.860 1.833 1.812 1.796 1.782 1.771 1.761 1.753 1.746 1.740 1.734 1.729 1.725 1.721 1.717 1.714 1.711 1.708 1.706 1.703 1.701 1.699 1.697 1.696 1.694 1.692 1.691 1.690 1.684 1.679 1.676 1.665 1.660 1.653 1.646

Excel: =TINV(2*a,df) 0.01 0.025 31.821 12.706 6.965 4.303 4.541 3.182 3.747 2.776 3.365 2.571 3.143 2.447 2.998 2.365 2.896 2.306 2.821 2.262 2.764 2.228 2.718 2.201 2.681 2.179 2.650 2.160 2.624 2.145 2.602 2.131 2.583 2.120 2.567 2.110 2.552 2.101 2.539 2.093 2.528 2.086 2.518 2.080 2.508 2.074 2.500 2.069 2.492 2.064 2.485 2.060 2.479 2.056 2.473 2.052 2.467 2.048 2.462 2.045 2.457 2.042 2.453 2.040 2.449 2.037 2.445 2.035 2.441 2.032 2.438 2.030 2.423 2.021 2.412 2.014 2.403 2.009 2.377 1.992 2.364 1.984 2.345 1.972 2.330 1.962

0.005 63.656 9.925 5.841 4.604 4.032 3.707 3.499 3.355 3.250 3.169 3.106 3.055 3.012 2.977 2.947 2.921 2.898 2.878 2.861 2.845 2.831 2.819 2.807 2.797 2.787 2.779 2.771 2.763 2.756 2.750 2.744 2.738 2.733 2.728 2.724 2.704 2.690 2.678 2.643 2.626 2.601 2.581

94

Critical Values for Durbin-Watson (å = 0.05) k=1 k=2 k=3 k=4 nr 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 45 50 55 60 65 70 75 80 85 90 95 100 dL 1.08 1.11 1.13 1.16 1.18 1.20 1.22 1.24 1.26 1.27 1.29 1.30 1.32 1.33 1.34 1.35 1.36 1.37 1.38 1.39 1.40 1.41 1.42 1.43 1.44 1.44 1.48 1.50 1.53 1.55 1.57 1.58 1.60 1.61 1.62 1.64 1.65 1.65 dU 1.36 1.37 1.38 1.39 1.40 1.41 1.42 1.43 1.44 1.45 1.45 1.46 1.47 1.48 1.48 1.49 1.50 1.50 1.51 1.51 1.52 1.52 1.53 1.54 1.54 1.54 1.57 1.59 1.60 1.62 1.63 1.64 1.65 1.66 1.67 1.68 1.69 1.69 dL 0.95 0.98 1.02 1.05 1.08 1.10 1.13 1.15 1.17 1.19 1.21 1.22 1.24 1.26 1.27 1.28 1.30 1.31 1.32 1.33 1.34 1.35 1.36 1.37 1.38 1.39 1.43 1.46 1.49 1.51 1.54 1.55 1.57 1.59 1.60 1.61 1.62 1.63 dU 1.54 1.54 1.54 1.54 1.54 1.54 1.54 1.54 1.54 1.55 1.55 1.55 1.56 1.56 1.56 1.57 1.57 1.57 1.58 1.58 1.58 1.59 1.59 1.59 1.60 1.60 1.62 1.63 1.64 1.65 1.66 1.67 1.68 1.69 1.70 1.70 1.71 1.72 dL 0.81 0.86 0.90 0.93 0.97 1.00 1.03 1.05 1.08 1.10 1.12 1.14 1.16 1.18 1.20 1.21 1.23 1.24 1.26 1.27 1.28 1.30 1.31 1.32 1.33 1.34 1.38 1.42 1.45 1.48 1.50 1.52 1.54 1.56 1.58 1.59 1.60 1.61 dU 1.75 1.73 1.71 1.70 1.69 1.68 1.67 1.66 1.66 1.66 1.65 1.65 1.65 1.65 1.65 1.65 1.65 1.65 1.65 1.65 1.65 1.65 1.66 1.66 1.66 1.66 1.67 1.67 1.68 1.69 1.70 1.70 1.71 1.72 1.72 1.73 1.73 1.74 dL 0.69 0.73 0.78 0.82 0.86 0.89 0.93 0.96 0.99 1.01 1.04 1.06 1.08 1.10 1.12 1.14 1.16 1.18 1.19 1.21 1.22 1.24 1.25 1.26 1.27 1.29 1.34 1.38 1.41 1.44 1.47 1.49 1.52 1.53 1.55 1.57 1.58 1.59 dU 1.98 1.94 1.90 1.87 1.85 1.83 1.81 1.80 1.79 1.78 1.77 1.76 1.75 1.75 1.74 1.74 1.74 1.73 1.73 1.73 1.73 1.73 1.72 1.72 1.72 1.72 1.72 1.72 1.72 1.73 1.73 1.74 1.74 1.74 1.75 1.75 1.76 1.76

k=5 dL 0.56 0.62 0.66 0.71 0.75 0.79 0.83 0.86 0.90 0.93 0.95 0.98 1.00 1.03 1.05 1.07 1.09 1.11 1.13 1.14 1.16 1.18 1.19 1.20 1.22 1.23 1.29 1.33 1.37 1.41 1.44 1.46 1.49 1.51 1.53 1.54 1.56 1.57 dU 2.22 2.16 2.10 2.06 2.02 1.99 1.96 1.94 1.92 1.90 1.89 1.87 1.86 1.85 1.84 1.83 1.83 1.82 1.81 1.81 1.80 1.80 1.80 1.79 1.79 1.79 1.78 1.77 1.77 1.77 1.77 1.77 1.77 1.77 1.77 1.78 1.78 1.78

95

Critical values of F (å = 0.05) Excel: =FINV(0.05,dfn,dfd)
df Denominator Numerator

Æ

Ø

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

1 161.446 18.513 10.128 7.709 6.608 5.987 5.591 5.318 5.117 4.965 4.844 4.747 4.667 4.600 4.543 4.494 4.451 4.414 4.381 4.351 4.325 4.301 4.279 4.260 4.242 4.225 4.210 4.196 4.183 4.171

2 199.499 19.000 9.552 6.944 5.786 5.143 4.737 4.459 4.256 4.103 3.982 3.885 3.806 3.739 3.682 3.634 3.592 3.555 3.522 3.493 3.467 3.443 3.422 3.403 3.385 3.369 3.354 3.340 3.328 3.316

3 215.707 19.164 9.277 6.591 5.409 4.757 4.347 4.066 3.863 3.708 3.587 3.490 3.411 3.344 3.287 3.239 3.197 3.160 3.127 3.098 3.072 3.049 3.028 3.009 2.991 2.975 2.960 2.947 2.934 2.922

4 224.583 19.247 9.117 6.388 5.192 4.534 4.120 3.838 3.633 3.478 3.357 3.259 3.179 3.112 3.056 3.007 2.965 2.928 2.895 2.866 2.840 2.817 2.796 2.776 2.759 2.743 2.728 2.714 2.701 2.690

5 230.160 19.296 9.013 6.256 5.050 4.387 3.972 3.688 3.482 3.326 3.204 3.106 3.025 2.958 2.901 2.852 2.810 2.773 2.740 2.711 2.685 2.661 2.640 2.621 2.603 2.587 2.572 2.558 2.545 2.534

6 233.988 19.329 8.941 6.163 4.950 4.284 3.866 3.581 3.374 3.217 3.095 2.996 2.915 2.848 2.790 2.741 2.699 2.661 2.628 2.599 2.573 2.549 2.528 2.508 2.490 2.474 2.459 2.445 2.432 2.421

96

df 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 24 30 40 60 120 Ï

2 18.0 6.09 4.50 3.93 3.64 3.46 3.34 3.26 3.20 3.15 3.11 3.08 3.06 3.03 3.01 3.00 2.98 2.97 2.96 2.95 2.92 2.89 2.56 2.83 2.80 2.77

3 27.0 8.33 5.91 5.04 4.60 4.34 4.17 4.04 3.95 3.88 3.82 3.77 3.74 3.70 3.67 3.65 3.63 3.61 3.59 3.58 3.53 3.49 3.44 3.40 3.36 3.31

4 32.8 9.80 6.83 5.76 5.22 4.90 4.68 4.53 4.42 4.33 4.26 4.20 4.15 4.11 4.08 4.05 4.02 4.00 3.98 3.96 3.90 3.85 3.79 3.74 3.69 3.63

Studentized Q Distribution (å = 0.05) 5 6 7 8 9 10 11 37.1 40.4 43.1 45.4 47.4 49.1 50.6 10.9 11.7 12.4 13.0 13.5 14.0 14.4 7.50 8.04 8.48 8.85 9.18 9.46 9.72 6.29 6.71 7.05 7.35 7.60 7.83 8.03 5.67 6.03 6.33 6.58 6.80 7.00 7.17 5.31 5.63 5.90 6.12 6.32 6.49 6.65 5.06 5.36 5.61 5.82 6.00 6.16 6.30 4.89 5.17 5.40 5.60 5.77 5.92 6.05 4.76 5.02 5.24 5.43 5.60 5.74 5.87 4.65 4.91 5.12 5.31 5.46 5.60 5.72 4.57 4.82 5.03 5.20 5.35 5.49 5.61 4.51 4.75 4.95 5.12 5.27 5.40 5.51 4.45 4.69 4.89 5.05 5.19 5.32 5.43 4.41 4.64 4.83 4.99 5.13 5.25 5.36 4.37 4.60 4.78 4.94 5.08 5.20 5.31 4.33 4.56 4.74 4.90 5.03 5.15 5.26 4.30 4.52 4.71 4.86 4.99 5.11 5.21 4.28 4.50 4.67 4.82 4.96 5.07 5.17 4.25 4.47 4.65 4.79 4.92 5.04 5.14 4.23 4.45 4.62 4.77 4.90 5.01 5.11 4.17 4.37 4.54 4.68 4.81 4.92 5.01 4.10 4.30 4.46 4.60 4.72 4.82 4.92 4.04 4.23 4.39 4.52 4.64 4.74 4.82 3.98 4.16 4.31 4.44 4.55 4.65 4.73 3.92 4.10 4.24 4.36 4.47 4.56 4.64 3.86 4.03 4.17 4.29 4.39 4.47 4.55

12 52.0 14.8 9.95 8.21 7.32 6.79 6.43 6.18 5.98 5.83 5.71 5.62 5.53 5.46 5.40 5.35 5.31 5.27 5.23 5.20 5.10 5.00 4.90 4.81 4.71 4.62

13 53.2 15.1 10.2 8.37 7.47 6.92 6.55 6.29 6.09 5.94 5.81 5.71 5.63 5.55 5.49 5.44 5.39 5.35 5.32 5.28 5.18 5.08 4.98 4.88 4.78 4.69

14 54.3 15.4 10.4 8.53 7.60 7.03 6.66 6.39 6.19 6.03 5.90 5.80 5.71 5.64 5.57 5.52 5.47 5.43 5.39 5.36 5.25 5.15 5.04 4.94 4.84 4.74

15 55.4 15.7 10.5 8.66 7.72 7.14 6.76 6.48 6.28 6.11 5.98 5.88 5.79 5.71 5.65 5.59 5.54 5.50 5.46 5.43 5.32 5.21 5.11 5.00 4.90 4.80

97

Statistical Control Chart Factors n 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 A 2.121 1.732 1.500 1.342 1.225 1.134 1.061 1.000 0.949 0.905 0.866 0.832 0.802 0.775 0.750 0.728 0.707 0.688 0.671 0.655 0.640 0.626 0.612 0.600 A2 1.880 1.023 0.729 0.577 0.483 0.419 0.373 0.337 0.308 0.285 0.266 0.249 0.235 0.223 0.212 0.203 0.194 0.187 0.180 0.173 0.167 0.162 0.157 0.153 A3 2.659 1.954 1.628 1.427 1.287 1.182 1.099 1.032 0.975 0.927 0.886 0.850 0.817 0.789 0.763 0.739 0.718 0.698 0.680 0.663 0.647 0.633 0.619 0.606 d2 1.128 1.693 2.059 2.326 2.534 2.704 2.847 2.970 3.078 3.173 3.258 3.336 3.407 3.472 3.532 3.588 3.640 3.689 3.735 3.778 3.819 3.858 3.895 3.931 d3 0.853 0.888 0.880 0.864 0.848 0.833 0.820 0.808 0.797 0.787 0.778 0.770 0.763 0.756 0.750 0.744 0.739 0.733 0.729 0.724 0.720 0.716 0.712 0.708 D1 0.000 0.000 0.000 0.000 0.000 0.205 0.388 0.547 0.686 0.811 0.923 1.025 1.118 1.203 1.282 1.356 1.424 1.489 1.549 1.606 1.660 1.711 1.759 1.805 D2 3.686 4.358 4.698 4.918 5.079 5.204 5.307 5.394 5.469 5.535 5.594 5.647 5.696 5.740 5.782 5.820 5.856 5.889 5.921 5.951 5.979 6.006 6.032 6.056 D3 0.000 0.000 0.000 0.000 0.000 0.076 0.136 0.184 0.223 0.256 0.283 0.307 0.328 0.347 0.363 0.378 0.391 0.404 0.415 0.425 0.435 0.443 0.452 0.459 D4 3.267 2.575 2.282 2.114 2.004 1.924 1.864 1.816 1.777 1.744 1.717 1.693 1.672 1.653 1.637 1.622 1.609 1.596 1.585 1.575 1.565 1.557 1.548 1.541

98

DF 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 60 120

≈2

Chi-Square ≈ 2 0.05 0.1
3.8415 5.9915 7.8147 9.4877 11.0705 12.5916 14.0671 15.5073 16.9190 18.3070 19.6752 21.0261 22.3620 23.6848 24.9958 26.2962 27.5871 28.8693 30.1435 31.4104 32.6706 33.9245 35.1725 36.4150 37.6525 38.8851 40.1133 41.3372 42.5569 43.7730 79.0820 146.5673

≈ 2 0.01
6.6349 9.2104 11.3449 13.2767 15.0863 16.8119 18.4753 20.0902 21.6660 23.2093 24.7250 26.2170 27.6882 29.1412 30.5780 31.9999 33.4087 34.8052 36.1908 37.5663 38.9322 40.2894 41.6383 42.9798 44.3140 45.6416 46.9628 48.2782 49.5878 50.8922 88.3794 158.9500

2.7055 4.6052 6.2514 7.7794 9.2363 10.6446 12.0170 13.3616 14.6837 15.9872 17.2750 18.5493 19.8119 21.0641 22.3071 23.5418 24.7690 25.9894 27.2036 28.4120 29.6151 30.8133 32.0069 33.1962 34.3816 35.5632 36.7412 37.9159 39.0875 40.2560 74.3970 140.2326

1000 1057.7240 1074.6794 1106.9690

99