shovan anova main

31
One Way ANOVA Dr.Shovan padhy, MBBS, MD DM 1 st yr (Senior Resident) NIMS, Hyderabad

Upload: dr-shovan-padhy-md

Post on 21-Apr-2017

23 views

Category:

Health & Medicine


0 download

TRANSCRIPT

One Way Anova

One Way ANOVADr.Shovan padhy, MBBS, MDDM 1st yr (Senior Resident)NIMS, Hyderabad

OverviewIntroduction.Why ANOVA instead of multiple t-tests?One way ANOVA.Assumptions of One way ANOVA.Steps in One way ANOVA.Example.Conclusion.

IntroductionANOVA is an abbreviation for the full name of the method: Analysis Of Variance.

Invented by R.A. Fisher in the 1918.

ANOVA is used to test the significance of the difference between more than two sample means.

Name ANOVA is a misnomer as it compares mean to check variance between group.

Summary Table of Statistical testsLevel of Measurement

Sample Characteristics

Correlation

1 Sample

2 Sample

K Sample (i.e., >2)

Independent

Dependent

Independent

Dependent

Categorical or Nominal

2 or bi-nominal

2

Macnarmars 2

2

Cochrans Q

Rank or Ordinal

Mann Whitney U

Wilcoxin Matched Pairs Signed Ranks

Kruskal Wallis H

Friedmans ANOVA

Spearmans rho

Parametric (Interval & Ratio)

z test ort test

t test between groups

t test within groups

1 way ANOVA between groups

1 way ANOVA (within or repeated measure)

Pearsons r

Factorial (2 way) ANOVA

2

Why ANOVA instead of multiple t-tests?If you are comparing means between more than two groups, we can choose two sample t-tests to compare the mean of one group with the mean of the other groups?:Before ANOVA, this was the only option available to compare means between more than two groups.

The problem with the multiple t-tests approach is that as the number of groups increases, the number of two sample t-tests also increases.

As the number of tests increases the probability of making a Type I error also increases.

One way ANOVAOne way ANOVA (=F test) compares the mean of two or more group whenever there is one independent variable is involved.It finds out whether there are any statistical significance difference between their group means. If more then one independent variable is involved then it is called as N way ANOVA.One way ANOVA specifically tests the null hypothesis.H0 = u1 = u2 = u3 = uk , u = group mean & k= no. of groups.If One way ANOVA shows a statistical significant result it means HA is true.

Variables In One way ANOVA

In an ANOVA, there are two kinds of variables: independent and dependent

The independent variable is controlled or manipulated by the researcher. It is a categorical (discrete) variable used to form the groupings of observations.

There are two types of independent variables: active and attribute.

If the independent variable is an active variable then we manipulate the values of the variable to study its affect on another variable. For example, anxiety level is an active independent variable.

An attribute independent variable is a variable where we do not alter the variable during the study. For example, we might want to study the effect of age on weight. We cannot change a persons age, but we can study people of different ages and weights.

In the One-way ANOVA, only one independent variable is considered, but there are two or more (theoretically any finite number) levels of the independent variable.

The independent variable is typically a categorical variable. The independent variable (or factor) divides individuals into two or more groups or levels.

The procedure is a One-way ANOVA, since there is only one independent variable.

The (continuous) dependent variable is defined as the variable that is, or is presumed to be, the result of manipulating the independent variable.

In the One-way ANOVA, there is only one dependent variable and hypotheses are formulated about the means of the groups on that dependent variable.

The dependent variable differentiates individuals on quantitative (continuous) dimension.

Assumptions of One way ANOVA All populations involved follow a normal distribution.

Homogeneity of variances: The variance within each group should be equal for all groups.

Independence of error: The error (variation of each value around its own group mean) should be independent for each value.Only ONE independent variable should be checked whether it produces a significant difference between the groups.

11

Example of One way ANOVAGroup AGroup BGroup C160,110,118,124,132122,136,124,126,120,138148,126,124,128,140N1= 5N2= 6N3= 5Mean=128.8Mean= 127.66Mean=133.2

EXAMPLE: A study conducted to assess & compare the effect of Treatment A vs Treatment B vs Treatment C on SBP in a specified population.

ANOVA

One way ANOVA Three way ANOVA

Effect of Drugs on SBP

Two way ANOVA

Effect of Diet & Drugs on SBPEffect of Exercise, Drugs, Diet on SBP

Body mass index13

Steps in One way ANOVA 2. State Alpha3. Calculate degrees of Freedom4. Calculate test statistic- Calculate variance between samples- Calculate variance within the samples- Calculate F statistic 1. State null & alternative hypotheses

14

Example- one way ANOVAExample: A investigator wants to find out the analgesic effect of aspirin vs diclofenac vs ibuprofen in a group of population with equal variances. AspirinDiclofenacIbuprofen1594103722914372

Steps Involved1.Null hypothesis No significant difference in the means of 3 samples

2. State Alpha i.e 0.05

3. Calculate degrees of Freedom k-1 & n-k = 2 & 12

4. State decision rule Table value of F at 5% level of significance for d.f 2 & 12 is 3.88The calculated value of F > 3.88 , H0 will be rejected

5. Calculate test statistic

One way ANOVA: Table Source of VariationSS (Sum of Squares)Degrees of FreedomMS (Mean Square)Variance Ratio of FBetween SamplesSSBk-1MSB= SSB/(k-1)MSB/MSW

Within SamplesSSWn-kMSW= SSW/(n-k)TotalSS(Total)n-1

Within group variance is also k/a error or residual variance17

Calculating variance BETWEEN samplesCalculate the mean of each sample.Calculate the Grand mean.Take the difference between means of various samples & grand average.Square these deviations & obtain total which will give sum of squares between samples (SSC)Divide the total obtained in step 4 by the degrees of freedom to calculate the mean sum of square between samples (MSC).

AspirinDiclofenacIbuprofen1724597103922314Total 24M1= 4.825M2 = 520M3 = 4

4.8+ 5+ 4 3 Grand average = = 4.6

Variance BETWEEN samples (M1=4.8, M2=5,M3=4)Sum of squares between samples (SSC) = n1 (M1 Grand avg)2 + n2 (M2 Grand avg)2 + n3(M3 Grand avg)2 5 ( 4.8 - 4.6) 2 + 5 ( 5 - 4.8) 2 + 5 ( 4.6 - 4.8) 2 = 0.6Calculation of Mean sum of squares between samples (MSB) =0.6/2 = 0.3 k= No of Samples, n= Total No of observations

20

Calculating Variance WITHIN SamplesCalculate mean value of each sample.Take the deviations of the various items in a sample from the mean values of the respective samples.Square these deviations & obtain total which gives the sum of square within the samples (SSE) Divide the total obtained in 3rd step by the degrees of freedom to calculate the mean sum of squares within samples (MSE).

Variance WITHIN samples (M1= 4.8, M2= 5,M3= 4)

X1 (X1 M1)2X2 (X2 M2)2X3 (X3 M3)2114.4742440.645092574.84102531917.64292433.2411640 40.765434

Sum of squares within samples (SSE) = 40.76 + 54 +34 =128.76 Calculation of Mean Sum Of Squares within samples (MSW) = 128.76/12 = 10.73

k= No of Samples, n= Total No of observations

22

The mean sum of squares

Calculation of MSC-Mean sum of Squares between samples Calculation of MSEMean Sum Of Squares within samples k= No of Samples, n= Total No of observations

Calculation of F statsitics

Compare the F-statistic value with F(critical) value which is obtained by looking for it in F distribution tables against degrees of freedom. The calculated value of F > table valueH0 is rejected

F Value = MSB/MSW = 0.3/10.73 = 0.02.

The Table value of F at 5% level of significance for d.f 2 & 12 is 3.88The calculated value of F < table valueH0 is accepted. Hence there no is significant difference in sample means

Within-Group VarianceBetween-Group VarianceBetween-group variance is large relative to the within-group variance, so F statistic will be larger & > critical value, therefore statistically significant . Conclusion At least one of group means is significantly different from other group means

26

Within-Group VarianceBetween-Group VarianceWithin-group variance is larger, and the between-group variance smaller, so F will be smaller (reflecting the likely-hood of no significant differences between these 3 sample means)

27

Post-hoc Tests

Used to determine which mean or group of means is/are significantly different from the others (significant F)Depending upon research design & research question:Bonferroni (more powerful) Only some pairs of sample means are to be testedDesired alpha level is divided by no. of comparisons

Tukeys HSD Procedure when all pairs of sample means are to be tested

Scheffes Procedure (when sample sizes are unequal)

Or where difference exists .with different post hoc tests Results are usually similar. Tukey,s HSD ( honestly significant difference)Other= Newman-Keuls Procedure,Dunnetts Procedure

28

Application of ANOVAANOVA is designed to detect differences among means from populations subject to different treatments.

ANOVA is a joint test, the equality of several population means is tested simultaneously or jointly.

ANOVA tests for the equality of several population means by looking at two estimators of the population variance (hence, analysis of variance).

ConclusionThe one-way analysis of variance is used where there is a single factor that will be set to three or more levels.t is not appropriate to analyse such data by repeated t-tests as this will raise the risk of false positives above the acceptable level of 5 per cent. If the ANOVA produces a significant result, this only tells us that at least one level produces a different result from one of the others.Follow-up tests needs to be carried out to find out which group differs from each other.

THANK YOU