STAT 135: Anova. Joan Bruna. April 10, Department of Statistics UC, Berkeley

Size: px
Start display at page:

Download "STAT 135: Anova. Joan Bruna. April 10, Department of Statistics UC, Berkeley"

Transcription

1 Department of Statistics UC, Berkeley April 10, 2015

2 Motivation Say you want to buy a pair of shoes. You go to a store and observe a large sample of shoes with varying price. Where does the variance in the price come from?

3 Motivation Say you want to buy a pair of shoes. You go to a store and observe a large sample of shoes with varying price. Where does the variance in the price come from? The color? The size? The brand? The material?

4 Motivation Say you want to buy a pair of shoes. You go to a store and observe a large sample of shoes with varying price. Where does the variance in the price come from? The color? The size? The brand? The material? Relevant groups should help me explain the variance.

5 Motivation We want to compare the effect of several treatments or several groups. Also, analyze other factors simultaneously. Examples: Movie Recommendations. Testing Several Drugs. Include other factors, such as Age, Sex, etc.

6 Motivation We want to compare the effect of several treatments or several groups. Also, analyze other factors simultaneously. Examples: Movie Recommendations. Testing Several Drugs. Include other factors, such as Age, Sex, etc. We will introduce the statistical framework for such problems.

7 Different Settings One-way Layout: Independent Measurements under several Treatments. This generalizes the methods from previous Chapter. Two-way Layout: Analyze two factors simultaneously (ex: several Treatments + several age ranges).

8 Different Settings One-way Layout: Independent Measurements under several Treatments. This generalizes the methods from previous Chapter. Two-way Layout: Analyze two factors simultaneously (ex: several Treatments + several age ranges). For each setting, two different approaches: Parametric: Methods based on the Normal distribution. Non-parametric: Mostly based on rank statistics.

9 One-Way Layout Suppose we have I groups G 1,..., G I, with measurements G 1 G 2 G I Y 1,1 Y 2,1 Y I,1 Y 1,2 Y 2,2 Y I, Y 1,J Y 2,J Y I,J We assume for now the same # of measurements in each group. Question: Are the means of each group the same?

10 One-Way Layout Model Model observations as Y i,j = µ + α i + ɛ i,j, where µ: global mean across all groups. α i : differential effect of i-th group. ɛ i,j : random error of each observation.

11 One-Way Layout Model Model observations as Y i,j = µ + α i + ɛ i,j, where µ: global mean across all groups. α i : differential effect of i-th group. ɛ i,j : random error of each observation. Main assumption: Errors ɛ i,j are iid N (0, σ 2 ). I We define µ such that α i = 0. i=1 Testing equality of means: Null hypothesis is H 0 : i, α i = 0.

12 Testing equality of means Given data Y i,j, i = 1,..., I, j = 1,..., J, define Y = 1 IJ Y i,j, Y i = 1 Y i,j. J i,j j Fact We have I i=1 j=1 J (Y i,j Y ) 2 = } {{ } total variability I i=1 j=1 J (Y i,j Y i ) 2 + J } {{ } var. within groups I (Y i Y ) 2. i=1 }{{} var. between groups

13 Testing equality of means We write SS w = I i=1 j=1 J (Y i,j Y i ) 2 and SS b = J Theorem Under the previous assumptions, we have E (SS w ) = I (J 1)σ 2 and E (SS b ) = J I (Y i Y ) 2. i=1 I αi 2 + (I 1)σ 2. i=1

14 A useful lemma Lemma Let X 1,..., X n be independent rv s with E (X i ) = µ i and var (X i ) = σ 2. Write µ = 1 µ i. Then n Proof (sketch): i E ( (X i X ) 2) = (µ i µ) 2 + n 1 n σ2. 1 E ( Z 2) = E (Z) 2 + var (Z). 2 var (X Y ) = var (X ) + var (Y ) 2cov (X, Y ).

15 Proof of the Theorem I J 1 E (SS w ) = E ( (Y i,j Y i ) 2). i=1 j=1 2 Apply the lemma to Y i,j, knowing that E (Y i,j ) = µ + α i. I 3 E (SS b ) = J E ( (Y i Y ) 2). i=1 4 Apply again the lemma to Y i, knowing E ( ) Y i = µ + αi and var ( ) Y i = σ 2 /J.

16 Designing a test statistic Theorem Under the previous assumptions, SS w /σ 2 follows a χ 2 distribution with I (J 1) df. Under the null hypothesis, SS b /σ 2 follows a χ 2 distribution with I 1 df and is independent of SS w. Proof: Recall definition of χ 2. For independence part, recall that X i X n and X n are independent if X i are independent Gaussians.

17 Designing a test statistic We consider the statistic F = SS b/(i 1) SS w /(I (J 1)). If H 0 true, F 1. If H 0 false, F 1. Theorem The null distribution of F is the F -distribution with I 1 and I (J 1) degrees of freedom. Proof: Recall the definition of F -distribution.

18 Remarks Easy to generalize when each group has different # of measurements. The F -test is approximately valid even if ɛ i,j are not Gaussian, provided J is large enough. The test is also robust to the assumption of constant variance. Under the normality assumption, It is a generalized likelihood ratio test.

19 Example: Netflix dataset Are these movies all equally good?

20 Netflix dataset Average over groups of 20 users to gaussianize measurements. With J = 50 measurements, we obtain F = SS b/(3 1) SS w /(3 49) = 195. P H0 (F 195) 0 = Null is rejected!.

21 Limitations of the Method The test is quite weak: it does not inform us where are the differences. If we have I groups, why not compare all possible pairs (= I (I 1)/2)?

22 Limitations of the Method The test is quite weak: it does not inform us where are the differences. If we have I groups, why not compare all possible pairs (= I (I 1)/2)? That is OK, but we need to control joint Type-I error, ie, P( at least a pair rejects H 0 true ).

23 Tukey s Method Suppose sample sizes are equal. Then We estimate σ 2 by s 2 p = Y i µ i N (0, σ 2 /J). 1 I (J 1) We consider the random variable Z = (Y i,j Y i ) 2. i (Y i1 µ i1 ) (Y i2 µ i2 ) max i 1,i 2 {1,...,I } s p / J (this is called the studentized range distribution).. j.

24 Tukey s Method Denote by q(α) the 1 α quantile of Z. Then P( (Y i1 µ i1 ) (Y i2 µ i2 ) q(α) s p J, i 1, i 2 ) = P(max (Y i1 µ i1 ) (Y i2 µ i2 ) q(α) s p ) = 1 α. i 1,i 2 J We then have confidence intervals for each difference µ i1 µ i2 : Y i1 Y i2 ± q(α) s p J. Now, by duality c.i. and hypothesis tests, if an interval does not contain 0, i.e., if Y i1 Y i2 > q(α) s p J we reject the hypothesis that µ i1 = µ i2 at joint level α.

25 Bonferroni Method Basic idea: P(at least a pair rejects H 0 true) = P( i1 i 2 pair (i 1, i 2 ) rejects H 0 true) i 1 i 2 P( pair (i 1, i 2 ) rejects H 0 true ), 2α so if we design individual tests at significance, the joint I (I 1) test will have significance α. Recall that the pairwise test rejects at level α if Y i1 Y i2 > t I (J 1) (α/2)s p 2/J.

26 Revisit Example I = 3, J = 50. Set α = Tukey Method: We compute δ = q(α) s p J We measure Y 1 Y 2 Y 1 Y 3 Y 2 Y Bonferroni: the threshold becomes δ = t 147 (α/6)s p 1/ Same conclusions!

27 Non-parametric Method Similarly as in the two sample case, we can design a non-parametric test using ranks. Let It results that 1 I R i,j = rank of Y i,j in the combined sample, and i R i = 1 J J R i,j. j=1 R i = IJ + 1. We define the statistic 2 SS r = I i=1 (R i IJ ) 2. The null distribution of SS r can be computed by enumeration. For large enough J, K = distributed with I 1 df. 12 IJ(IJ + 1) SS r is approximately χ 2

28 Revisit Example In our Netflix example, we compute K = SS r 4900, If Z χ 2 2, P(Z > K) 0. We reject the null hypothesis as well!

29 A last Method Theorem If the number of groups is I = 14, J = 2015 and σ 2 = , then a test statistic of the null hypothesis µ i = µ i i i, is given by Λ = (SS b π) SS w log 4 Y e sinh 3(SSw SS. b/(ij) The null distribution of Λ is Γ(4, 2.105).

30 Two-Way Layout Experiment Now we are interested in experiments involving two factors, each with several classes. Examples: Assess different drugs across several age ranges. Analyze house prices in terms of surface and zip code. etc.

31 An Example Suppose we record the number of daily tweets per capita in terms of different locations and different tags: city cat dog coffee nyc sf paris Goal: describe the variability in terms of the different factors.

32 An Example Denoting Y i,j the entry in row i and column j, we start with the average: Y = 1 Y i,j = i,j We can also compute the average of each row Y r,i and each column Y c,j : Y r,1 = 1.9, Y r,2 = 1.97, Y r,3 = 1.5, Y c,1 = 2.13, Y c,2 = 1.23, Y c,3 = 2. Which effect is more important?

33 A Useful Graphic We can plot the two factors simultaneously:

34 An Example Compute the differences between global average and row/column averages: ˆα 1 = Y r,1 Y = 0.11, ˆα 2 = 0.178, ˆα 3 = 0.29, ˆβ 1 = Y c,1 Y = 0.34, ˆβ2 = 0.56, ˆβ3 = 0.21.

35 An Example Compute the differences between global average and row/column averages: ˆα 1 = Y r,1 Y = 0.11, ˆα 2 = 0.178, ˆα 3 = 0.29, ˆβ 1 = Y c,1 Y = 0.34, ˆβ2 = 0.56, ˆβ3 = The effect of the tag is more determinant than location.

36 The Additive Model This is a simple example of an additive model: Ŷ i,j = ˆµ + ˆα i + ˆβ j.

37 The Additive Model This is a simple example of an additive model: Ŷ i,j = ˆµ + ˆα i + ˆβ j. We have less parameters (I + J 1 than input dimensions IJ). It is a good model provided the factors do not interact. Question: How to spot visually if factors interact?

38 Good additive fit vs poor additive fit?

39 The Additive Model Interactions can be incorporated to make the model exact: δ i,j = Y i,j Ŷi,j = Y i,j ˆµ ˆα i ˆβ j = Y i,j Y r,i Y c,j + Y. We have δ i,j = i j δ i,j = 0.

40 Normal Theory for the Additive Model We assume K > 1 observations per cell, and two-way layout (balanced design). Y i,j,k : Observation k in cell (i, j) is modeled as Y i,j,k N (µ + α i + β j + δ i,j, σ 2 ), independent of the other observations. The parameters of the model satisfy α i = 0, β j = 0, δ i,j = i j i j δ i,j = 0.

41 Normal Theory Given observations Y i,j,k, we estimate the parameters of the model (ˆµ, ˆα i, ˆβj, δi,j ˆ ).

42 Normal Theory Given observations Y i,j,k, we estimate the parameters of the model (ˆµ, ˆα i, ˆβj, δi,j ˆ ). Maximum likelihood estimation under linear constraints: ˆµ = Y, ˆα i = Y r,i Y, ˆβ j = Y c,j Y, ˆ δ i,j = Y i,j + Y Y r,i Y c,j.

43 Two-way Anova Diagram We decompose the data variability:

44 Two-way Anova Diagram We decompose the data variability:

45 Sum of Squares decompositions With SS tot = i (Y i,j,k Y ) 2, SS E = j i k (Y i,j,k Y i,j ) 2, j k SS A = JK i (Y r,i Y ) 2, SS B = IK j (Y c,j Y ) 2, and we have SS AB = K j (Y i,j Y c,j Y r,i + Y ) 2, i SS tot = SS E + SS A + SS B + SS AB.

46 Distributions under Normal Model Theorem Under the normal model with uniform variance σ 2, we have E (SS E ) = IJ(K 1)σ 2, E (SS A ) = (I 1)σ 2 + JK i α 2 i, E (SS B ) = (J 1)σ 2 + IK j E (SS AB ) = (I 1)(J 1)σ 2 + K i βj 2, δi,j 2. j

47 Distributions under Normal Model Theorem Under the normal model with uniform variance σ 2, we have 1 SS E /σ 2 follows a chi-squared distribution with IJ(K 1) df. 2 Under the null hypothesis H A : α i = 0 i, SS A /σ 2 follows a chi-squared distribution with I 1 df. 3 Under the null hypothesis H B : β j = 0 j, SS B /σ 2 follows a chi-squared distribution with J 1 df. 4 Under the null hypothesis H AB : δ i,j = 0 i, j, SS AB /σ 2 follows a chi-squared distribution with (I 1)(J 1) df. 5 The different SS variables are independent of each other.

48 F -tests for the two-way layout Similarly as in the one-way layout case, we can test the null hypothesis with an F test. Example: Test whether factor A has an effect.

49 F -tests for the two-way layout Similarly as in the one-way layout case, we can test the null hypothesis with an F test. Example: Test whether factor A has an effect. Under H A, SS A σ 2 χ2 I 1, and SS E σ 2 χ2 IJ(K 1). Also, we know that E (SS E ) /(IJ(K 1)) = σ 2. The null distribution of SS A /(I 1) SS E /(IJ(K 1)) is the F -distribution with I 1 and IJ(K 1) degrees of freedom.

50 Example: Tweeter Data of tags vs cities Recall we measured daily tweets as a function of topic and city. city cat dog coffee nyc sf paris Each cell is the average of K = 8 daily measures Y i,j,k with σ approximately We want to test several hypothesis:

51 Example: Tweeter Data of tags vs cities Recall we measured daily tweets as a function of topic and city. city cat dog coffee nyc sf paris Each cell is the average of K = 8 daily measures Y i,j,k with σ approximately We want to test several hypothesis: Influence of topic?

52 Example: Tweeter Data of tags vs cities Recall we measured daily tweets as a function of topic and city. city cat dog coffee nyc sf paris Each cell is the average of K = 8 daily measures Y i,j,k with σ approximately We want to test several hypothesis: Influence of topic? Influce of city?

53 Example: Tweeter Data of tags vs cities Recall we measured daily tweets as a function of topic and city. city cat dog coffee nyc sf paris Each cell is the average of K = 8 daily measures Y i,j,k with σ approximately We want to test several hypothesis: Influence of topic? Influce of city? Do these factors interact?

54 The Famous ANOVA table Source df SS SS/df F p-value Topic City Interaction Error Total

55 The Famous ANOVA table Source df SS SS/df F p-value Topic City Interaction Error Total So, Enough evidence to say that Topic matters, Not enough evidence to say that City matters......but we are pretty sure that these factors interact.

56 Example Question: What do you expect to happen if we add more measurements (i.e we increase K)?

57 Example Question: What do you expect to happen if we add more measurements (i.e we increase K)? Results with K = 40: Source df SS SS/df F p-value Topic City Interaction Error Total

58 Example Question: What do you expect to happen if we add more measurements (i.e we increase K)? Results with K = 40: Source df SS SS/df F p-value Topic City Interaction Error Total As more data becomes available, our tests become more powerful.

59 One-Way layout vs Two-Way layout We can see a two-way layout as a special case of One-Way layout, with I J cells.

60 One-Way layout vs Two-Way layout We can see a two-way layout as a special case of One-Way layout, with I J cells. Hypothesis that there is no mean difference is equivalent to α i = 0, β j = 0, δ i,j = 0, i, j. Two-way layouts allow us to test more diverse hypothesis (eg presence or absence of interactions). They are more efficient, since they recycle observations to test different factors.

61 Randomized Block Designs Suppose we want to evaluate the appeal of I different logos worldwide. We pick J countries, and within each country we split randomly between I populations.

62 Randomized Block Designs Suppose we want to evaluate the appeal of I different logos worldwide. We pick J countries, and within each country we split randomly between I populations. Why?

63 Randomized Block Designs Suppose we want to evaluate the appeal of I different logos worldwide. We pick J countries, and within each country we split randomly between I populations. Why? By comparing the effect within each county, we control the variability across different countries. It is widely used in industry and in agricultural experiments It is the generalization of the matched pairs design from last chapter.

64 Randomized Block Designs We model the responses as Y i,j = µ + α i + β j + ɛ i,j, with independent zero-mean errors ɛ i,j and no interactions. We want to perform inference on the α i. With no interactions, we have E (SS A /(I 1)) = σ 2 + J αi 2, E (SS B /(J 1)) = σ 2 + I I 1 J 1 i E (SS AB /((I 1)(J 1))) = σ 2. j β 2 j

65 Randomized Block Designs To test H A : α i = 0, i = 1,... I we consider F = SS A /(I 1) SS AB /((I 1)(J 1)).

66 Randomized Block Designs To test H A : α i = 0, i = 1,... I we consider F = SS A /(I 1) SS AB /((I 1)(J 1)). Under H A, F F I 1,(I 1)(J 1). If there are interactions, we have E (SS AB /((I 1)(J 1))) = σ 2 + so the test is conservative. 1 (I 1)(J 1) δi,j 2, i,j

67 Example Suppose we want to choose the right color for our logo. We evaluate I different options across J different countries. Pantone 201 Pantone 202 Pantone 203 USA France UK China

68 Example We compute the statistic F = SS A /(I 1) SS AB /(I 1)(J 1) 6.2, which has a p-value of approximately The test is statistically significant.

69 Example We compute the statistic F = SS A /(I 1) SS AB /(I 1)(J 1) 6.2, which has a p-value of approximately The test is statistically significant. Question: What if we did a classic one-way ANOVA?

70 The advantage of randomized designs We compute the within variability across columns SS w = SS AB + SS B, and we consider the one-way F -statistic: F = SS A/(I 1) SS w /(I (J 1)) = 0.051, with a p-value of approximately The test cannot reject!

71 The advantage of randomized designs We compute the within variability across columns SS w = SS AB + SS B, and we consider the one-way F -statistic: F = SS A/(I 1) SS w /(I (J 1)) = 0.051, with a p-value of approximately The test cannot reject! Morality: If data comes paired/grouped, we should always exploit this information.

72 Friedman s Test Can we think of a non-parametric test for the Randomized block design?

73 Friedman s Test Can we think of a non-parametric test for the Randomized block design? Hint: Recall the case of paired samples

74 Friedman s Test Can we think of a non-parametric test for the Randomized block design? Hint: Recall the case of paired samples Idea: Use Ranks! Within each of the J blocks, we rank the observations: R i,j : rank of sample of treatment i within block j,

75 Friedman s Test Can we think of a non-parametric test for the Randomized block design? Hint: Recall the case of paired samples Idea: Use Ranks! Within each of the J blocks, we rank the observations: R i,j : rank of sample of treatment i within block j, then consider the average rank of each treatment: R i = 1 R i,j. J j

76 Friedman s Test To test the hypothesis that there is no effect of treatments, we consider SS r = J i (R i R) 2. For large enough sample sizes, the null distribution of Q = 12SS r I (J + 1) is approximately χ 2 with I 1 degrees of freedom.

77 Summary of Comparison Tests Test Layout Paired? Param? t-test X n Ȳm > t n+m 2(1 α/2)s p 1/n + 1/m 2 samples unp par Mann-Whitney 2 samples unp npar t-test D > t n 1 (1 α/2)s p 1/n 2 samples pair par Wilcoxon Signed-Rank 2 samples pair npar SS F -test b /(I 1) SSw /(I (J 1)) > F I 1,I (J 1)(1 α) One-Way unp par Bonferroni Y i Y i > t 2n 2 (1 α/(i (I 1)))s p 2/n One-Way (MT) unp par Kruskall-Wallis K = 12SS R IJ(IJ+1) > q I 1(1 α) One-Way unp npar SS F -test A /(I 1) SS E /(IJ(K 1)) > F I 1,IJ(K 1) (1 α) Two-Way unp par SS F -test B /(J 1) SS E /(IJ(K 1)) > F J 1,IJ(K 1) (1 α) Two-Way unp par F -test SS AB /(J 1)(I 1) > F SS E /(IJ(K 1)) (J 1)(I 1),IJ(K 1) (1 α) Two-Way unp par SS F -test A /(I 1) SS AB /((I 1)(J 1)) > F I 1,(I 1)(J 1) (1 α) Two-Way pair par Friedman test Q = 12SSr I (J+1) Two-Way pair npar

78 Tests for Categorical Data In many contexts, data consists of counts of many sorts. Examples: Number of tweets Number of votes etc. We will discuss tests specific for that sort of data.

79 Fisher s Exact Test Let us consider the example from p We consider an experiment where supervisors are handed a personnel file and have to decide whether to promote the employee or to hold the file and interview other candidates. Using randomization, 24 supervisors are given applications labeled as male employee, 24 supervisors receive applications labeled as female (the files were identical except for the label).

80 Fisher s Exact Test The results are: Question: Is there a gender bias? Male Female Promote Hold 3 10

81 Fisher s Exact Test Idea: Measure the likelihood of the imbalance as a result of the randomization.

82 Fisher s Exact Test Idea: Measure the likelihood of the imbalance as a result of the randomization. Null hypothesis H 0 : There is no sex bias. Denote the observed counts as Male Female total Promote N 1,1 = 21 N 1,2 = 14 n r,1 = 35 Hold N 2.1 = 3 N 2,2 = 10 n r,2 = 13 total n c,1 = 24 n c,2 = 24 n = 48 The margins n are fixed under the null hypothesis. In this example, there is only 1 degree of freedom for the N s.

83 Fisher s Exact Test Pick for example N 1,1. We have P H0 (N 1,1 = k) = ( nr,1 ) ( k nr,2 ) n c,1 k ( n ). n c,1 The p-value for N 1,1 = 21 is < Strong evidence of gender bias in this experiment.

84 Simpson s Paradox Another experiment about gender bias. UC Berkeley Graduate School Admissions (1973): Question: Is there Gender bias? Male Female Admitted Not admitted % Admitted 44 35

85 Fisher Exact Test for UC Berkeley data Male Female Total Admitted N 1,1 = n r,1 = 5226 Not admitted n r,2 = 7537 Total n c,1 = 8442 n c,2 = We have that This suggests gender bias... P H0 (N )

86 Simpson s Paradox...but let s examine what happens if we look at each particular department:

87 Simpson s Paradox...but let s examine what happens if we look at each particular department: Dept Men Women p-value Applicants Admitted Applicants Admitted A % % B % 25 68% 0.4 C % % 0.22 D % % 0.32 E % % 0.20 F 272 6% 341 7% 0.34

88 Simpson s Paradox...but let s examine what happens if we look at each particular department: Dept Men Women p-value Applicants Admitted Applicants Admitted A % % B % 25 68% 0.4 C % % 0.22 D % % 0.32 E % % 0.20 F 272 6% 341 7% 0.34 In most Departments, women had higher acceptance rates than men! Differences towards men are never statistically significant, Dept A biased towards women. Explanation: Men tended to apply to easier programs than women.

89 χ 2 test for Homogeneity Suppose now we have independent observations from J multinomial distributions, each with I cells. Example: Weather in SF vs weather in Berkeley (quantized as sunny/ fog / overcast / rainy). Literary style to detect plagiats. etc. We want to asses whether the distributions are equal based on some collected data.

90 Homogeneity test set-up Denote the probability of cell i of the j-th multinomial as π i,j. The null hypothesis is H 0 : i, π i,1 = π i,2 =... π i,j.

91 Homogeneity test set-up Denote the probability of cell i of the j-th multinomial as π i,j. The null hypothesis is H 0 : i, π i,1 = π i,2 =... π i,j. Testing this hypothesis amounts to a goodness-of-fit test. We can thus consider the Pearson s χ 2 statistic. Data are independent samples from each multinomial distribution: n i,j = counts in cell i for the j-th multinomial.

92 Homogeneity test Theorem Under H 0, the mle s of parameters π 1,... π I are j ˆπ i = n i,j i,j n. i,j

93 Homogeneity test Theorem Under H 0, the mle s of parameters π 1,... π I are j ˆπ i = n i,j i,j n. i,j Goodness-of-fit test: I J X 2 (O i,j E i,j ) 2 = i=1 j=1 E i,j, where E i,j = ( I i =1 n i,j) ˆπ i = ( i n i,j)( j n i,j ) i,j n i,j. For large sample sizes, X 2 is approximately χ 2, with J(I 1) (I 1) = (J 1)(I 1) df.

94 Example of Homgeneity test Weather in Berkeley vs San Francisco. (data from weather underground). Weather type Berkeley San Francisco Sunny and hot(> 70F ) Sunny and cold(< 70F ) Fog Rain 72 66

95 Example of Homogeneity test We compute X 2 = I J (O i,j E i,j ) 2 = 3.79, E i,j i=1 j=1 which has associated p-value of The test is not conclusive. It is consistent with a homogeneous weather model...

96 χ 2 test for Independence One final test. Suppose we have the following data: grade stepped into UC seal did not step into UC seal D C B A Question: Does stepping into the seals bring bad luck?

97 χ 2 test for Independence Statistical Model: Counts n i,j are samples from a multinomial distribution, with cell probabilities π i,j, i = 1,..., I, j = 1,..., J. Denote α i = π i,j, β j = π i,j j i as the marginal probabilities.

98 χ 2 test for Independence Statistical Model: Counts n i,j are samples from a multinomial distribution, with cell probabilities π i,j, i = 1,..., I, j = 1,..., J. Denote α i = π i,j, β j = π i,j j i as the marginal probabilities. Null hypothesis H 0 : Grades and Stepping into Seals are independent. In other words, Under H 0, π i,j = α i β j.

99 χ 2 test for Independence Under H 0, the MLE of π i,j is ˆπ i,j = ˆα i ˆβ j = j n i,j n i n i,j n Alternative hypothesis H 1 : cell probabilities are free: ˆπ H 1 i,j. = n i,j n.

100 χ 2 test for Independence Under H 0, the MLE of π i,j is ˆπ i,j = ˆα i ˆβ j = j n i,j n i n i,j n. Alternative hypothesis H 1 : cell probabilities are free: ˆπ H 1 i,j = n i,j n. Likelihood ratio test, or equivalently Pearson s chi-square statistic: X 2 = i j (O i,j E i,j ) 2 E i,j, with E i,j = nˆπ i,j = ( j n i,j )( i n i,j), O i,j = n i,j n and IJ 1 (I 1) (J 1) = (I 1)(J 1) degrees of freedom.

101 Back to Our Example We compute X 2 = 5.13, with a p-value of Evidence is not statistically significant.

102 Remarks The test statistics for homogeneity and independence are identical: X 2 = n(n i,j n r,i n c,j /n) 2 n r,i n c,j i,j with (I 1)(J 1) degrees of freedom. Coincidence?

103 Remarks The test statistics for homogeneity and independence are identical: X 2 = n(n i,j n r,i n c,j /n) 2 n r,i n c,j i,j with (I 1)(J 1) degrees of freedom. Coincidence? p(x, y) = p 1 (x)p 2 (y) implies that and vice-versa. p(x y = y 1 ) = p(x y = y 2 ) =... p(x y = y J ) We could approach homogeneity and independence with a Fisher exact test, but Pearson s χ 2 statistic has a nicer null distribution.

104 Test of Tests What is the appropriate test for the following experiments?

105 The Ballmer Peak

106 The Ballmer Peak A recent study at the University of Illinois tested the creative problem solving ability of a group of men who were given vodka cranberry and snacks and asked to solve brain teasers. The results were starkly different for the tipsy group, which had a blood alcohol concentration level of 0.075, versus the control group: Astonishingly, those in the drinking group averaged nine correct questions to the six answers correct by the non-drinking group. It also took drunk men 11.5 seconds to answer a question, whereas non-drunk men needed 15.2 seconds to think. Both groups had comparable results on a similar exam before the alcohol consumption began.

107 The Ballmer Peak A recent study at the University of Illinois tested the creative problem solving ability of a group of men who were given vodka cranberry and snacks and asked to solve brain teasers. The results were starkly different for the tipsy group, which had a blood alcohol concentration level of 0.075, versus the control group: Astonishingly, those in the drinking group averaged nine correct questions to the six answers correct by the non-drinking group. It also took drunk men 11.5 seconds to answer a question, whereas non-drunk men needed 15.2 seconds to think. Both groups had comparable results on a similar exam before the alcohol consumption began. A: Non-parametric Mann-Whitney (if sample size small), t-test (if sample size large enough).

108 HIV tests From Yesterday s news.bbc.co.uk site: HIV: new approach against virus holds promise The first human trial of a new type of HIV therapy suggests it could be a promising weapon in the fight against the virus. Reports in the journal Nature show infusions of so-called broadly neutralising antibodies could suppress the amount of HIV in a patient s blood (...) Patients given the highest concentrations were able to fight the virus for some time, dampening the replication of HIV in their blood. (...)

109 HIV tests From Yesterday s news.bbc.co.uk site: HIV: new approach against virus holds promise The first human trial of a new type of HIV therapy suggests it could be a promising weapon in the fight against the virus. Reports in the journal Nature show infusions of so-called broadly neutralising antibodies could suppress the amount of HIV in a patient s blood (...) Patients given the highest concentrations were able to fight the virus for some time, dampening the replication of HIV in their blood. (...) A: Randomized Block Design.

110 Company Lifespan From sciencedaily.com : How long do firms live? Finding patterns of company mortality in market data It s a simple enough question: how long does a typical business have to live? Economists have been thinking about that one for decades without a particularly clear answer, but new research by scientists at the Santa Fe Institute in New Mexico reveals a surprising insight: publicly-traded firms die off at the same rate regardless of their age or economic sector.

111 Company Lifespan From sciencedaily.com : How long do firms live? Finding patterns of company mortality in market data It s a simple enough question: how long does a typical business have to live? Economists have been thinking about that one for decades without a particularly clear answer, but new research by scientists at the Santa Fe Institute in New Mexico reveals a surprising insight: publicly-traded firms die off at the same rate regardless of their age or economic sector. A: Two-way ANOVA.

Chapter 12. Analysis of variance

Chapter 12. Analysis of variance Serik Sagitov, Chalmers and GU, January 9, 016 Chapter 1. Analysis of variance Chapter 11: I = samples independent samples paired samples Chapter 1: I 3 samples of equal size J one-way layout two-way layout

More information

STAT 135 Lab 9 Multiple Testing, One-Way ANOVA and Kruskal-Wallis

STAT 135 Lab 9 Multiple Testing, One-Way ANOVA and Kruskal-Wallis STAT 135 Lab 9 Multiple Testing, One-Way ANOVA and Kruskal-Wallis Rebecca Barter April 6, 2015 Multiple Testing Multiple Testing Recall that when we were doing two sample t-tests, we were testing the equality

More information

STAT 135 Lab 10 Two-Way ANOVA, Randomized Block Design and Friedman s Test

STAT 135 Lab 10 Two-Way ANOVA, Randomized Block Design and Friedman s Test STAT 135 Lab 10 Two-Way ANOVA, Randomized Block Design and Friedman s Test Rebecca Barter April 13, 2015 Let s now imagine a dataset for which our response variable, Y, may be influenced by two factors,

More information

MATH Notebook 3 Spring 2018

MATH Notebook 3 Spring 2018 MATH448001 Notebook 3 Spring 2018 prepared by Professor Jenny Baglivo c Copyright 2010 2018 by Jenny A. Baglivo. All Rights Reserved. 3 MATH448001 Notebook 3 3 3.1 One Way Layout........................................

More information

STAT 525 Fall Final exam. Tuesday December 14, 2010

STAT 525 Fall Final exam. Tuesday December 14, 2010 STAT 525 Fall 2010 Final exam Tuesday December 14, 2010 Time: 2 hours Name (please print): Show all your work and calculations. Partial credit will be given for work that is partially correct. Points will

More information

STAT 135 Lab 11 Tests for Categorical Data (Fisher s Exact test, χ 2 tests for Homogeneity and Independence) and Linear Regression

STAT 135 Lab 11 Tests for Categorical Data (Fisher s Exact test, χ 2 tests for Homogeneity and Independence) and Linear Regression STAT 135 Lab 11 Tests for Categorical Data (Fisher s Exact test, χ 2 tests for Homogeneity and Independence) and Linear Regression Rebecca Barter April 20, 2015 Fisher s Exact Test Fisher s Exact Test

More information

An Analysis of College Algebra Exam Scores December 14, James D Jones Math Section 01

An Analysis of College Algebra Exam Scores December 14, James D Jones Math Section 01 An Analysis of College Algebra Exam s December, 000 James D Jones Math - Section 0 An Analysis of College Algebra Exam s Introduction Students often complain about a test being too difficult. Are there

More information

Analysis of Variance

Analysis of Variance Analysis of Variance Blood coagulation time T avg A 62 60 63 59 61 B 63 67 71 64 65 66 66 C 68 66 71 67 68 68 68 D 56 62 60 61 63 64 63 59 61 64 Blood coagulation time A B C D Combined 56 57 58 59 60 61

More information

STAT 263/363: Experimental Design Winter 2016/17. Lecture 1 January 9. Why perform Design of Experiments (DOE)? There are at least two reasons:

STAT 263/363: Experimental Design Winter 2016/17. Lecture 1 January 9. Why perform Design of Experiments (DOE)? There are at least two reasons: STAT 263/363: Experimental Design Winter 206/7 Lecture January 9 Lecturer: Minyong Lee Scribe: Zachary del Rosario. Design of Experiments Why perform Design of Experiments (DOE)? There are at least two

More information

Central Limit Theorem ( 5.3)

Central Limit Theorem ( 5.3) Central Limit Theorem ( 5.3) Let X 1, X 2,... be a sequence of independent random variables, each having n mean µ and variance σ 2. Then the distribution of the partial sum S n = X i i=1 becomes approximately

More information

CHAPTER 17 CHI-SQUARE AND OTHER NONPARAMETRIC TESTS FROM: PAGANO, R. R. (2007)

CHAPTER 17 CHI-SQUARE AND OTHER NONPARAMETRIC TESTS FROM: PAGANO, R. R. (2007) FROM: PAGANO, R. R. (007) I. INTRODUCTION: DISTINCTION BETWEEN PARAMETRIC AND NON-PARAMETRIC TESTS Statistical inference tests are often classified as to whether they are parametric or nonparametric Parameter

More information

Unit 14: Nonparametric Statistical Methods

Unit 14: Nonparametric Statistical Methods Unit 14: Nonparametric Statistical Methods Statistics 571: Statistical Methods Ramón V. León 8/8/2003 Unit 14 - Stat 571 - Ramón V. León 1 Introductory Remarks Most methods studied so far have been based

More information

Lecture 7: Hypothesis Testing and ANOVA

Lecture 7: Hypothesis Testing and ANOVA Lecture 7: Hypothesis Testing and ANOVA Goals Overview of key elements of hypothesis testing Review of common one and two sample tests Introduction to ANOVA Hypothesis Testing The intent of hypothesis

More information

Statistics 135 Fall 2008 Final Exam

Statistics 135 Fall 2008 Final Exam Name: SID: Statistics 135 Fall 2008 Final Exam Show your work. The number of points each question is worth is shown at the beginning of the question. There are 10 problems. 1. [2] The normal equations

More information

Department of Economics. Business Statistics. Chapter 12 Chi-square test of independence & Analysis of Variance ECON 509. Dr.

Department of Economics. Business Statistics. Chapter 12 Chi-square test of independence & Analysis of Variance ECON 509. Dr. Department of Economics Business Statistics Chapter 1 Chi-square test of independence & Analysis of Variance ECON 509 Dr. Mohammad Zainal Chapter Goals After completing this chapter, you should be able

More information

Section 4.6 Simple Linear Regression

Section 4.6 Simple Linear Regression Section 4.6 Simple Linear Regression Objectives ˆ Basic philosophy of SLR and the regression assumptions ˆ Point & interval estimation of the model parameters, and how to make predictions ˆ Point and interval

More information

[y i α βx i ] 2 (2) Q = i=1

[y i α βx i ] 2 (2) Q = i=1 Least squares fits This section has no probability in it. There are no random variables. We are given n points (x i, y i ) and want to find the equation of the line that best fits them. We take the equation

More information

Log-linear Models for Contingency Tables

Log-linear Models for Contingency Tables Log-linear Models for Contingency Tables Statistics 149 Spring 2006 Copyright 2006 by Mark E. Irwin Log-linear Models for Two-way Contingency Tables Example: Business Administration Majors and Gender A

More information

Statistics 3858 : Contingency Tables

Statistics 3858 : Contingency Tables Statistics 3858 : Contingency Tables 1 Introduction Before proceeding with this topic the student should review generalized likelihood ratios ΛX) for multinomial distributions, its relation to Pearson

More information

Written Exam (2 hours)

Written Exam (2 hours) M. Müller Applied Analysis of Variance and Experimental Design Summer 2015 Written Exam (2 hours) General remarks: Open book exam. Switch off your mobile phone! Do not stay too long on a part where you

More information

Parametric versus Nonparametric Statistics-when to use them and which is more powerful? Dr Mahmoud Alhussami

Parametric versus Nonparametric Statistics-when to use them and which is more powerful? Dr Mahmoud Alhussami Parametric versus Nonparametric Statistics-when to use them and which is more powerful? Dr Mahmoud Alhussami Parametric Assumptions The observations must be independent. Dependent variable should be continuous

More information

iron retention (log) high Fe2+ medium Fe2+ high Fe3+ medium Fe3+ low Fe2+ low Fe3+ 2 Two-way ANOVA

iron retention (log) high Fe2+ medium Fe2+ high Fe3+ medium Fe3+ low Fe2+ low Fe3+ 2 Two-way ANOVA iron retention (log) 0 1 2 3 high Fe2+ high Fe3+ low Fe2+ low Fe3+ medium Fe2+ medium Fe3+ 2 Two-way ANOVA In the one-way design there is only one factor. What if there are several factors? Often, we are

More information

Chapter 8 Student Lecture Notes 8-1. Department of Economics. Business Statistics. Chapter 12 Chi-square test of independence & Analysis of Variance

Chapter 8 Student Lecture Notes 8-1. Department of Economics. Business Statistics. Chapter 12 Chi-square test of independence & Analysis of Variance Chapter 8 Student Lecture Notes 8-1 Department of Economics Business Statistics Chapter 1 Chi-square test of independence & Analysis of Variance ECON 509 Dr. Mohammad Zainal Chapter Goals After completing

More information

Nonparametric Statistics. Leah Wright, Tyler Ross, Taylor Brown

Nonparametric Statistics. Leah Wright, Tyler Ross, Taylor Brown Nonparametric Statistics Leah Wright, Tyler Ross, Taylor Brown Before we get to nonparametric statistics, what are parametric statistics? These statistics estimate and test population means, while holding

More information

SEVERAL μs AND MEDIANS: MORE ISSUES. Business Statistics

SEVERAL μs AND MEDIANS: MORE ISSUES. Business Statistics SEVERAL μs AND MEDIANS: MORE ISSUES Business Statistics CONTENTS Post-hoc analysis ANOVA for 2 groups The equal variances assumption The Kruskal-Wallis test Old exam question Further study POST-HOC ANALYSIS

More information

Linear Regression. In this lecture we will study a particular type of regression model: the linear regression model

Linear Regression. In this lecture we will study a particular type of regression model: the linear regression model 1 Linear Regression 2 Linear Regression In this lecture we will study a particular type of regression model: the linear regression model We will first consider the case of the model with one predictor

More information

I i=1 1 I(J 1) j=1 (Y ij Ȳi ) 2. j=1 (Y j Ȳ )2 ] = 2n( is the two-sample t-test statistic.

I i=1 1 I(J 1) j=1 (Y ij Ȳi ) 2. j=1 (Y j Ȳ )2 ] = 2n( is the two-sample t-test statistic. Serik Sagitov, Chalmers and GU, February, 08 Solutions chapter Matlab commands: x = data matrix boxplot(x) anova(x) anova(x) Problem.3 Consider one-way ANOVA test statistic For I = and = n, put F = MS

More information

13.1 Categorical Data and the Multinomial Experiment

13.1 Categorical Data and the Multinomial Experiment Chapter 13 Categorical Data Analysis 13.1 Categorical Data and the Multinomial Experiment Recall Variable: (numerical) variable (i.e. # of students, temperature, height,). (non-numerical, categorical)

More information

Master s Written Examination

Master s Written Examination Master s Written Examination Option: Statistics and Probability Spring 016 Full points may be obtained for correct answers to eight questions. Each numbered question which may have several parts is worth

More information

More about Single Factor Experiments

More about Single Factor Experiments More about Single Factor Experiments 1 2 3 0 / 23 1 2 3 1 / 23 Parameter estimation Effect Model (1): Y ij = µ + A i + ɛ ij, Ji A i = 0 Estimation: µ + A i = y i. ˆµ = y..  i = y i. y.. Effect Modell

More information

Testing Independence

Testing Independence Testing Independence Dipankar Bandyopadhyay Department of Biostatistics, Virginia Commonwealth University BIOS 625: Categorical Data & GLM 1/50 Testing Independence Previously, we looked at RR = OR = 1

More information

Confidence Intervals, Testing and ANOVA Summary

Confidence Intervals, Testing and ANOVA Summary Confidence Intervals, Testing and ANOVA Summary 1 One Sample Tests 1.1 One Sample z test: Mean (σ known) Let X 1,, X n a r.s. from N(µ, σ) or n > 30. Let The test statistic is H 0 : µ = µ 0. z = x µ 0

More information

Kruskal-Wallis and Friedman type tests for. nested effects in hierarchical designs 1

Kruskal-Wallis and Friedman type tests for. nested effects in hierarchical designs 1 Kruskal-Wallis and Friedman type tests for nested effects in hierarchical designs 1 Assaf P. Oron and Peter D. Hoff Department of Statistics, University of Washington, Seattle assaf@u.washington.edu, hoff@stat.washington.edu

More information

Non-parametric (Distribution-free) approaches p188 CN

Non-parametric (Distribution-free) approaches p188 CN Week 1: Introduction to some nonparametric and computer intensive (re-sampling) approaches: the sign test, Wilcoxon tests and multi-sample extensions, Spearman s rank correlation; the Bootstrap. (ch14

More information

STAT 7030: Categorical Data Analysis

STAT 7030: Categorical Data Analysis STAT 7030: Categorical Data Analysis 5. Logistic Regression Peng Zeng Department of Mathematics and Statistics Auburn University Fall 2012 Peng Zeng (Auburn University) STAT 7030 Lecture Notes Fall 2012

More information

22s:152 Applied Linear Regression. Chapter 8: 1-Way Analysis of Variance (ANOVA) 2-Way Analysis of Variance (ANOVA)

22s:152 Applied Linear Regression. Chapter 8: 1-Way Analysis of Variance (ANOVA) 2-Way Analysis of Variance (ANOVA) 22s:152 Applied Linear Regression Chapter 8: 1-Way Analysis of Variance (ANOVA) 2-Way Analysis of Variance (ANOVA) We now consider an analysis with only categorical predictors (i.e. all predictors are

More information

HYPOTHESIS TESTING II TESTS ON MEANS. Sorana D. Bolboacă

HYPOTHESIS TESTING II TESTS ON MEANS. Sorana D. Bolboacă HYPOTHESIS TESTING II TESTS ON MEANS Sorana D. Bolboacă OBJECTIVES Significance value vs p value Parametric vs non parametric tests Tests on means: 1 Dec 14 2 SIGNIFICANCE LEVEL VS. p VALUE Materials and

More information

Data Analysis: Agonistic Display in Betta splendens I. Betta splendens Research: Parametric or Non-parametric Data?

Data Analysis: Agonistic Display in Betta splendens I. Betta splendens Research: Parametric or Non-parametric Data? Data Analysis: Agonistic Display in Betta splendens By Joanna Weremjiwicz, Simeon Yurek, and Dana Krempels Once you have collected data with your ethogram, you are ready to analyze that data to see whether

More information

Chapter Fifteen. Frequency Distribution, Cross-Tabulation, and Hypothesis Testing

Chapter Fifteen. Frequency Distribution, Cross-Tabulation, and Hypothesis Testing Chapter Fifteen Frequency Distribution, Cross-Tabulation, and Hypothesis Testing Copyright 2010 Pearson Education, Inc. publishing as Prentice Hall 15-1 Internet Usage Data Table 15.1 Respondent Sex Familiarity

More information

Analysis of variance and regression. April 17, Contents Comparison of several groups One-way ANOVA. Two-way ANOVA Interaction Model checking

Analysis of variance and regression. April 17, Contents Comparison of several groups One-way ANOVA. Two-way ANOVA Interaction Model checking Analysis of variance and regression Contents Comparison of several groups One-way ANOVA April 7, 008 Two-way ANOVA Interaction Model checking ANOVA, April 008 Comparison of or more groups Julie Lyng Forman,

More information

Chapter 12 - Lecture 2 Inferences about regression coefficient

Chapter 12 - Lecture 2 Inferences about regression coefficient Chapter 12 - Lecture 2 Inferences about regression coefficient April 19th, 2010 Facts about slope Test Statistic Confidence interval Hypothesis testing Test using ANOVA Table Facts about slope In previous

More information

TA: Sheng Zhgang (Th 1:20) / 342 (W 1:20) / 343 (W 2:25) / 344 (W 12:05) Haoyang Fan (W 1:20) / 346 (Th 12:05) FINAL EXAM

TA: Sheng Zhgang (Th 1:20) / 342 (W 1:20) / 343 (W 2:25) / 344 (W 12:05) Haoyang Fan (W 1:20) / 346 (Th 12:05) FINAL EXAM STAT 301, Fall 2011 Name Lec 4: Ismor Fischer Discussion Section: Please circle one! TA: Sheng Zhgang... 341 (Th 1:20) / 342 (W 1:20) / 343 (W 2:25) / 344 (W 12:05) Haoyang Fan... 345 (W 1:20) / 346 (Th

More information

Chapter 3. Comparing two populations

Chapter 3. Comparing two populations Chapter 3. Comparing two populations Contents Hypothesis for the difference between two population means: matched pairs Hypothesis for the difference between two population means: independent samples Two

More information

CHI SQUARE ANALYSIS 8/18/2011 HYPOTHESIS TESTS SO FAR PARAMETRIC VS. NON-PARAMETRIC

CHI SQUARE ANALYSIS 8/18/2011 HYPOTHESIS TESTS SO FAR PARAMETRIC VS. NON-PARAMETRIC CHI SQUARE ANALYSIS I N T R O D U C T I O N T O N O N - P A R A M E T R I C A N A L Y S E S HYPOTHESIS TESTS SO FAR We ve discussed One-sample t-test Dependent Sample t-tests Independent Samples t-tests

More information

ANOVA - analysis of variance - used to compare the means of several populations.

ANOVA - analysis of variance - used to compare the means of several populations. 12.1 One-Way Analysis of Variance ANOVA - analysis of variance - used to compare the means of several populations. Assumptions for One-Way ANOVA: 1. Independent samples are taken using a randomized design.

More information

= 1 i. normal approximation to χ 2 df > df

= 1 i. normal approximation to χ 2 df > df χ tests 1) 1 categorical variable χ test for goodness-of-fit ) categorical variables χ test for independence (association, contingency) 3) categorical variables McNemar's test for change χ df k (O i 1

More information

Rama Nada. -Ensherah Mokheemer. 1 P a g e

Rama Nada. -Ensherah Mokheemer. 1 P a g e - 9 - Rama Nada -Ensherah Mokheemer - 1 P a g e Quick revision: Remember from the last lecture that chi square is an example of nonparametric test, other examples include Kruskal Wallis, Mann Whitney and

More information

3 Joint Distributions 71

3 Joint Distributions 71 2.2.3 The Normal Distribution 54 2.2.4 The Beta Density 58 2.3 Functions of a Random Variable 58 2.4 Concluding Remarks 64 2.5 Problems 64 3 Joint Distributions 71 3.1 Introduction 71 3.2 Discrete Random

More information

Agonistic Display in Betta splendens: Data Analysis I. Betta splendens Research: Parametric or Non-parametric Data?

Agonistic Display in Betta splendens: Data Analysis I. Betta splendens Research: Parametric or Non-parametric Data? Agonistic Display in Betta splendens: Data Analysis By Joanna Weremjiwicz, Simeon Yurek, and Dana Krempels Once you have collected data with your ethogram, you are ready to analyze that data to see whether

More information

Two-Way Analysis of Variance - no interaction

Two-Way Analysis of Variance - no interaction 1 Two-Way Analysis of Variance - no interaction Example: Tests were conducted to assess the effects of two factors, engine type, and propellant type, on propellant burn rate in fired missiles. Three engine

More information

We know from STAT.1030 that the relevant test statistic for equality of proportions is:

We know from STAT.1030 that the relevant test statistic for equality of proportions is: 2. Chi 2 -tests for equality of proportions Introduction: Two Samples Consider comparing the sample proportions p 1 and p 2 in independent random samples of size n 1 and n 2 out of two populations which

More information

Mock Exam - 2 hours - use of basic (non-programmable) calculator is allowed - all exercises carry the same marks - exam is strictly individual

Mock Exam - 2 hours - use of basic (non-programmable) calculator is allowed - all exercises carry the same marks - exam is strictly individual Mock Exam - 2 hours - use of basic (non-programmable) calculator is allowed - all exercises carry the same marks - exam is strictly individual Question 1. Suppose you want to estimate the percentage of

More information

Analysis of Variance (ANOVA) Cancer Research UK 10 th of May 2018 D.-L. Couturier / R. Nicholls / M. Fernandes

Analysis of Variance (ANOVA) Cancer Research UK 10 th of May 2018 D.-L. Couturier / R. Nicholls / M. Fernandes Analysis of Variance (ANOVA) Cancer Research UK 10 th of May 2018 D.-L. Couturier / R. Nicholls / M. Fernandes 2 Quick review: Normal distribution Y N(µ, σ 2 ), f Y (y) = 1 2πσ 2 (y µ)2 e 2σ 2 E[Y ] =

More information

Exploratory Data Analysis

Exploratory Data Analysis CS448B :: 30 Sep 2010 Exploratory Data Analysis Last Time: Visualization Re-Design Jeffrey Heer Stanford University In-Class Design Exercise Mackinlay s Ranking Task: Analyze and Re-design visualization

More information

20.1. Balanced One-Way Classification Cell means parametrization: ε 1. ε I. + ˆɛ 2 ij =

20.1. Balanced One-Way Classification Cell means parametrization: ε 1. ε I. + ˆɛ 2 ij = 20. ONE-WAY ANALYSIS OF VARIANCE 1 20.1. Balanced One-Way Classification Cell means parametrization: Y ij = µ i + ε ij, i = 1,..., I; j = 1,..., J, ε ij N(0, σ 2 ), In matrix form, Y = Xβ + ε, or 1 Y J

More information

http://www.statsoft.it/out.php?loc=http://www.statsoft.com/textbook/ Group comparison test for independent samples The purpose of the Analysis of Variance (ANOVA) is to test for significant differences

More information

Group comparison test for independent samples

Group comparison test for independent samples Group comparison test for independent samples The purpose of the Analysis of Variance (ANOVA) is to test for significant differences between means. Supposing that: samples come from normal populations

More information

Analysis of Variance (ANOVA)

Analysis of Variance (ANOVA) Analysis of Variance (ANOVA) Much of statistical inference centers around the ability to distinguish between two or more groups in terms of some underlying response variable y. Sometimes, there are but

More information

Chapter 26: Comparing Counts (Chi Square)

Chapter 26: Comparing Counts (Chi Square) Chapter 6: Comparing Counts (Chi Square) We ve seen that you can turn a qualitative variable into a quantitative one (by counting the number of successes and failures), but that s a compromise it forces

More information

Comparing the means of more than two groups

Comparing the means of more than two groups Comparing the means of more than two groups Chapter 15 Analysis of variance (ANOVA) Like a t-test, but can compare more than two groups Asks whether any of two or more means is different from any other.

More information

Introduction to Machine Learning CMU-10701

Introduction to Machine Learning CMU-10701 Introduction to Machine Learning CMU-10701 23. Decision Trees Barnabás Póczos Contents Decision Trees: Definition + Motivation Algorithm for Learning Decision Trees Entropy, Mutual Information, Information

More information

Formal Statement of Simple Linear Regression Model

Formal Statement of Simple Linear Regression Model Formal Statement of Simple Linear Regression Model Y i = β 0 + β 1 X i + ɛ i Y i value of the response variable in the i th trial β 0 and β 1 are parameters X i is a known constant, the value of the predictor

More information

Introduction to Statistical Inference Lecture 10: ANOVA, Kruskal-Wallis Test

Introduction to Statistical Inference Lecture 10: ANOVA, Kruskal-Wallis Test Introduction to Statistical Inference Lecture 10: ANOVA, Kruskal-Wallis Test la Contents The two sample t-test generalizes into Analysis of Variance. In analysis of variance ANOVA the population consists

More information

Unit 9: Inferences for Proportions and Count Data

Unit 9: Inferences for Proportions and Count Data Unit 9: Inferences for Proportions and Count Data Statistics 571: Statistical Methods Ramón V. León 12/15/2008 Unit 9 - Stat 571 - Ramón V. León 1 Large Sample Confidence Interval for Proportion ( pˆ p)

More information

Comparison of Two Samples

Comparison of Two Samples 2 Comparison of Two Samples 2.1 Introduction Problems of comparing two samples arise frequently in medicine, sociology, agriculture, engineering, and marketing. The data may have been generated by observation

More information

Solutions to Final STAT 421, Fall 2008

Solutions to Final STAT 421, Fall 2008 Solutions to Final STAT 421, Fall 2008 Fritz Scholz 1. (8) Two treatments A and B were randomly assigned to 8 subjects (4 subjects to each treatment) with the following responses: 0, 1, 3, 6 and 5, 7,

More information

THE ROYAL STATISTICAL SOCIETY HIGHER CERTIFICATE

THE ROYAL STATISTICAL SOCIETY HIGHER CERTIFICATE THE ROYAL STATISTICAL SOCIETY 004 EXAMINATIONS SOLUTIONS HIGHER CERTIFICATE PAPER II STATISTICAL METHODS The Society provides these solutions to assist candidates preparing for the examinations in future

More information

Quantitative Introduction ro Risk and Uncertainty in Business Module 5: Hypothesis Testing

Quantitative Introduction ro Risk and Uncertainty in Business Module 5: Hypothesis Testing Quantitative Introduction ro Risk and Uncertainty in Business Module 5: Hypothesis Testing M. Vidyasagar Cecil & Ida Green Chair The University of Texas at Dallas Email: M.Vidyasagar@utdallas.edu October

More information

Statistics for EES Factorial analysis of variance

Statistics for EES Factorial analysis of variance Statistics for EES Factorial analysis of variance Dirk Metzler June 12, 2015 Contents 1 ANOVA and F -Test 1 2 Pairwise comparisons and multiple testing 6 3 Non-parametric: The Kruskal-Wallis Test 9 1 ANOVA

More information

Final Exam. DO NOT SEPARATE the answer sheet from the rest of the test. Work and CIRCLE the answer to each problem INSIDE the test.

Final Exam. DO NOT SEPARATE the answer sheet from the rest of the test. Work and CIRCLE the answer to each problem INSIDE the test. Final Exam Math 114 - Statistics for Business Fall 2009 Name: Section: (circle one) 1 2 3 4 5 6 INSTRUCTIONS: This exam contains 24 problems. The first 16 are multiple-choice, and are 3 points each. Record

More information

Analysis of variance (ANOVA) Comparing the means of more than two groups

Analysis of variance (ANOVA) Comparing the means of more than two groups Analysis of variance (ANOVA) Comparing the means of more than two groups Example: Cost of mating in male fruit flies Drosophila Treatments: place males with and without unmated (virgin) females Five treatments

More information

Regression Analysis. BUS 735: Business Decision Making and Research. Learn how to detect relationships between ordinal and categorical variables.

Regression Analysis. BUS 735: Business Decision Making and Research. Learn how to detect relationships between ordinal and categorical variables. Regression Analysis BUS 735: Business Decision Making and Research 1 Goals of this section Specific goals Learn how to detect relationships between ordinal and categorical variables. Learn how to estimate

More information

Tribhuvan University Institute of Science and Technology 2065

Tribhuvan University Institute of Science and Technology 2065 1CSc. Stat. 108-2065 Tribhuvan University Institute of Science and Technology 2065 Bachelor Level/First Year/ First Semester/ Science Full Marks: 60 Computer Science and Information Technology (Stat. 108)

More information

Statistical Inference Theory Lesson 46 Non-parametric Statistics

Statistical Inference Theory Lesson 46 Non-parametric Statistics 46.1-The Sign Test Statistical Inference Theory Lesson 46 Non-parametric Statistics 46.1 - Problem 1: (a). Let p equal the proportion of supermarkets that charge less than $2.15 a pound. H o : p 0.50 H

More information

Multiple Regression Analysis: Heteroskedasticity

Multiple Regression Analysis: Heteroskedasticity Multiple Regression Analysis: Heteroskedasticity y = β 0 + β 1 x 1 + β x +... β k x k + u Read chapter 8. EE45 -Chaiyuth Punyasavatsut 1 topics 8.1 Heteroskedasticity and OLS 8. Robust estimation 8.3 Testing

More information

Analysis of variance. April 16, Contents Comparison of several groups

Analysis of variance. April 16, Contents Comparison of several groups Contents Comparison of several groups Analysis of variance April 16, 2009 One-way ANOVA Two-way ANOVA Interaction Model checking Acknowledgement for use of presentation Julie Lyng Forman, Dept. of Biostatistics

More information

Lecture 5: ANOVA and Correlation

Lecture 5: ANOVA and Correlation Lecture 5: ANOVA and Correlation Ani Manichaikul amanicha@jhsph.edu 23 April 2007 1 / 62 Comparing Multiple Groups Continous data: comparing means Analysis of variance Binary data: comparing proportions

More information

Nonparametric statistic methods. Waraphon Phimpraphai DVM, PhD Department of Veterinary Public Health

Nonparametric statistic methods. Waraphon Phimpraphai DVM, PhD Department of Veterinary Public Health Nonparametric statistic methods Waraphon Phimpraphai DVM, PhD Department of Veterinary Public Health Measurement What are the 4 levels of measurement discussed? 1. Nominal or Classificatory Scale Gender,

More information

Analysis of variance. April 16, 2009

Analysis of variance. April 16, 2009 Analysis of variance April 16, 2009 Contents Comparison of several groups One-way ANOVA Two-way ANOVA Interaction Model checking Acknowledgement for use of presentation Julie Lyng Forman, Dept. of Biostatistics

More information

The scatterplot is the basic tool for graphically displaying bivariate quantitative data.

The scatterplot is the basic tool for graphically displaying bivariate quantitative data. Bivariate Data: Graphical Display The scatterplot is the basic tool for graphically displaying bivariate quantitative data. Example: Some investors think that the performance of the stock market in January

More information

Categorical Data Analysis 1

Categorical Data Analysis 1 Categorical Data Analysis 1 STA 312: Fall 2012 1 See last slide for copyright information. 1 / 1 Variables and Cases There are n cases (people, rats, factories, wolf packs) in a data set. A variable is

More information

One-Way ANOVA. Some examples of when ANOVA would be appropriate include:

One-Way ANOVA. Some examples of when ANOVA would be appropriate include: One-Way ANOVA 1. Purpose Analysis of variance (ANOVA) is used when one wishes to determine whether two or more groups (e.g., classes A, B, and C) differ on some outcome of interest (e.g., an achievement

More information

3 Way Tables Edpsy/Psych/Soc 589

3 Way Tables Edpsy/Psych/Soc 589 3 Way Tables Edpsy/Psych/Soc 589 Carolyn J. Anderson Department of Educational Psychology I L L I N O I S university of illinois at urbana-champaign c Board of Trustees, University of Illinois Spring 2017

More information

BTRY 4090: Spring 2009 Theory of Statistics

BTRY 4090: Spring 2009 Theory of Statistics BTRY 4090: Spring 2009 Theory of Statistics Guozhang Wang September 25, 2010 1 Review of Probability We begin with a real example of using probability to solve computationally intensive (or infeasible)

More information

Review of Statistics 101

Review of Statistics 101 Review of Statistics 101 We review some important themes from the course 1. Introduction Statistics- Set of methods for collecting/analyzing data (the art and science of learning from data). Provides methods

More information

Example. χ 2 = Continued on the next page. All cells

Example. χ 2 = Continued on the next page. All cells Section 11.1 Chi Square Statistic k Categories 1 st 2 nd 3 rd k th Total Observed Frequencies O 1 O 2 O 3 O k n Expected Frequencies E 1 E 2 E 3 E k n O 1 + O 2 + O 3 + + O k = n E 1 + E 2 + E 3 + + E

More information

Practice Final Exam. December 14, 2009

Practice Final Exam. December 14, 2009 Practice Final Exam December 14, 29 1 New Material 1.1 ANOVA 1. A purication process for a chemical involves passing it, in solution, through a resin on which impurities are adsorbed. A chemical engineer

More information

Introduction 1. STA442/2101 Fall See last slide for copyright information. 1 / 33

Introduction 1. STA442/2101 Fall See last slide for copyright information. 1 / 33 Introduction 1 STA442/2101 Fall 2016 1 See last slide for copyright information. 1 / 33 Background Reading Optional Chapter 1 of Linear models with R Chapter 1 of Davison s Statistical models: Data, and

More information

UNIVERSITY OF TORONTO. Faculty of Arts and Science APRIL - MAY 2005 EXAMINATIONS STA 248 H1S. Duration - 3 hours. Aids Allowed: Calculator

UNIVERSITY OF TORONTO. Faculty of Arts and Science APRIL - MAY 2005 EXAMINATIONS STA 248 H1S. Duration - 3 hours. Aids Allowed: Calculator UNIVERSITY OF TORONTO Faculty of Arts and Science APRIL - MAY 2005 EXAMINATIONS STA 248 H1S Duration - 3 hours Aids Allowed: Calculator LAST NAME: FIRST NAME: STUDENT NUMBER: There are 17 pages including

More information

Tentamentsskrivning: Statistisk slutledning 1. Tentamentsskrivning i Statistisk slutledning MVE155/MSG200, 7.5 hp.

Tentamentsskrivning: Statistisk slutledning 1. Tentamentsskrivning i Statistisk slutledning MVE155/MSG200, 7.5 hp. Tentamentsskrivning: Statistisk slutledning 1 Tentamentsskrivning i Statistisk slutledning MVE155/MSG200, 7.5 hp. Tid: 14 mars 2017, kl 14.00-18.00 Examinator och jour: Serik Sagitov, tel. 031-772-5351,

More information

ˆπ(x) = exp(ˆα + ˆβ T x) 1 + exp(ˆα + ˆβ T.

ˆπ(x) = exp(ˆα + ˆβ T x) 1 + exp(ˆα + ˆβ T. Exam 3 Review Suppose that X i = x =(x 1,, x k ) T is observed and that Y i X i = x i independent Binomial(n i,π(x i )) for i =1,, N where ˆπ(x) = exp(ˆα + ˆβ T x) 1 + exp(ˆα + ˆβ T x) This is called the

More information

Nonparametric Location Tests: k-sample

Nonparametric Location Tests: k-sample Nonparametric Location Tests: k-sample Nathaniel E. Helwig Assistant Professor of Psychology and Statistics University of Minnesota (Twin Cities) Updated 04-Jan-2017 Nathaniel E. Helwig (U of Minnesota)

More information

We need to define some concepts that are used in experiments.

We need to define some concepts that are used in experiments. Chapter 0 Analysis of Variance (a.k.a. Designing and Analysing Experiments) Section 0. Introduction In Chapter we mentioned some different ways in which we could get data: Surveys, Observational Studies,

More information

n y π y (1 π) n y +ylogπ +(n y)log(1 π).

n y π y (1 π) n y +ylogπ +(n y)log(1 π). Tests for a binomial probability π Let Y bin(n,π). The likelihood is L(π) = n y π y (1 π) n y and the log-likelihood is L(π) = log n y +ylogπ +(n y)log(1 π). So L (π) = y π n y 1 π. 1 Solving for π gives

More information

Contents. TAMS38 - Lecture 6 Factorial design, Latin Square Design. Lecturer: Zhenxia Liu. Factorial design 3. Complete three factor design 4

Contents. TAMS38 - Lecture 6 Factorial design, Latin Square Design. Lecturer: Zhenxia Liu. Factorial design 3. Complete three factor design 4 Contents Factorial design TAMS38 - Lecture 6 Factorial design, Latin Square Design Lecturer: Zhenxia Liu Department of Mathematics - Mathematical Statistics 28 November, 2017 Complete three factor design

More information

Session 3 The proportional odds model and the Mann-Whitney test

Session 3 The proportional odds model and the Mann-Whitney test Session 3 The proportional odds model and the Mann-Whitney test 3.1 A unified approach to inference 3.2 Analysis via dichotomisation 3.3 Proportional odds 3.4 Relationship with the Mann-Whitney test Session

More information

Non-parametric Tests

Non-parametric Tests Statistics Column Shengping Yang PhD,Gilbert Berdine MD I was working on a small study recently to compare drug metabolite concentrations in the blood between two administration regimes. However, the metabolite

More information

Inferences About the Difference Between Two Means

Inferences About the Difference Between Two Means 7 Inferences About the Difference Between Two Means Chapter Outline 7.1 New Concepts 7.1.1 Independent Versus Dependent Samples 7.1. Hypotheses 7. Inferences About Two Independent Means 7..1 Independent

More information

BIOS 2083 Linear Models c Abdus S. Wahed

BIOS 2083 Linear Models c Abdus S. Wahed Chapter 5 206 Chapter 6 General Linear Model: Statistical Inference 6.1 Introduction So far we have discussed formulation of linear models (Chapter 1), estimability of parameters in a linear model (Chapter

More information

[ z = 1.48 ; accept H 0 ]

[ z = 1.48 ; accept H 0 ] CH 13 TESTING OF HYPOTHESIS EXAMPLES Example 13.1 Indicate the type of errors committed in the following cases: (i) H 0 : µ = 500; H 1 : µ 500. H 0 is rejected while H 0 is true (ii) H 0 : µ = 500; H 1

More information