Presentation is loading. Please wait.

Presentation is loading. Please wait.

SADC Course in Statistics Analysis of Variance with two factors (Session 13)

Similar presentations


Presentation on theme: "SADC Course in Statistics Analysis of Variance with two factors (Session 13)"— Presentation transcript:

1 SADC Course in Statistics Analysis of Variance with two factors (Session 13)

2 To put your footer here go to View > Header and Footer 2 Learning Objectives At the end of this session, you will be able to understand and interpret the components of a linear model with two categorical factors fit a model involving two factors, interpret the output and present the results understand the difference between raw means and adjusted means appreciate that a residual analysis is the same with more complex models

3 To put your footer here go to View > Header and Footer 3 Using Paddy again! In the paddy example, there were two categorical factors, variety and village. Here we will look at a model including both factors and the corresponding output. We will also discuss assumptions associated with anova models with categorical factors and procedures to check these assumptions.

4 To put your footer here go to View > Header and Footer 4 A model using two factors Objective here is to compare paddy yields across the 3 varieties and also across villages. A linear model for this takes the form: y ij = 0 + v i + g j + ij Here 0 represents a constant, and the g j (i=1,2,3) represent the variety effect as before. We also have the term v i (i=1,2,3,4) to represent the village effect.

5 To put your footer here go to View > Header and Footer 5 Anova results Sourced.f.S.S.M.S.FProb. Village Variety Residual Total Above is a two-way anova since there are two factors explaining the variability in paddy yields. Again the Residual M.S. (s 2 ) = describes the variation not explained by village and variety.

6 To put your footer here go to View > Header and Footer 6 Sample sizes Above shows data is not balanced. Hence need to worry about the order of fitting terms. How then should we interpret the sequential S.S.s shown in slide 5 anova? | Variety | Village | New Old Trad | Total KESEN | | 7 NANDA | | 14 NIKO | | 5 SABEY | | Total | |

7 To put your footer here go to View > Header and Footer 7 Anova with adjusted SS and MS Sourced.f.Adj.S.S.Adj.M.S.FProb. Village Variety Residual Total How may the above results be interpreted? What are your conclusions?

8 To put your footer here go to View > Header and Footer 8 Model estimates ParameterCoeff.Std.errortt prob 0 :constant v 2 (Nanda) v 3 (Niko) v 4 (Sabey) g 2 (old) g 3 (trad) What do these results tell us?

9 To put your footer here go to View > Header and Footer 9 Relating estimates to means Again:Old - New = =Estimate of g 2 Trad - New = =Estimate of g 3 This is similar to the case with one categorical factor – can make comparisons easily with the base level using model estimates. But when sample sizes are unequal across the two categorical factors, results should be reported in terms of adjusted means!

10 To put your footer here go to View > Header and Footer 10 Raw means and adjusted means SampleRawStd.error VarietySize(n)Means (s.d./n) New improved Old improved Traditional VarietyAdjusted means Std.error (s/n) New improved Old improved Traditional Model based summaries (adjusted means):

11 To put your footer here go to View > Header and Footer 11 Computing adjusted means The model equation y ij = 0 + v i + g j + ij can be used to find the variety adjusted means e.g. adjusted mean for traditional variety is: = [ – ]–2.614 = Thus the variety adjusted mean is an average over the 4 villages.

12 To put your footer here go to View > Header and Footer 12 Checking model assumptions Anova model with two categorical factors is: y ij = 0 + g i + v j + ij Model assumptions are associated with the ij. These are checked in exactly the same way as before. A residual analysis is done, looking at plots of residuals in various ways. We give below a residual analysis for the model fitted above.

13 To put your footer here go to View > Header and Footer 13 Histogram to check normality Histogram of standardised residuals after fitting a model of yield on village and variety.

14 To put your footer here go to View > Header and Footer 14 A normal probability plot… Another check on the normality assumption Do you think the points follow a straight line?

15 To put your footer here go to View > Header and Footer 15 Std. residuals versus fitted values Checking assumption of variance homogeneity, and identification of outliers: What can you say here about the variance homogeneity assumption?

16 To put your footer here go to View > Header and Footer 16 Finally… know your software Different software packages impose different constraints on model parameters so need to be aware what this is. For example, Stata and Genstat set the first level of the factor to zero. SPSS and SAS set the last level to zero. Minitab imposes a constraint that sets the sum of the parameter estimates to zero! Check also whether the software produces sequential or adjusted or some other form of sums of squares. The correct interpretation of anova results would depend on this.

17 To put your footer here go to View > Header and Footer 17 Practical work follows to ensure learning objectives are achieved…


Download ppt "SADC Course in Statistics Analysis of Variance with two factors (Session 13)"

Similar presentations


Ads by Google