Presentation is loading. Please wait.

Presentation is loading. Please wait.

GENERAL LINEAR MODELS Oneway ANOVA, GLM Univariate (n-way ANOVA, ANCOVA)

Similar presentations


Presentation on theme: "GENERAL LINEAR MODELS Oneway ANOVA, GLM Univariate (n-way ANOVA, ANCOVA)"— Presentation transcript:

1 GENERAL LINEAR MODELS Oneway ANOVA, GLM Univariate (n-way ANOVA, ANCOVA)

2 BASICS Dependent variable is continuous Independent variables are nominal, categorical (factor, CLASS) or continuous (covariate) Are the group means of the dependent variable different across groups defined by the independents Main effects, interactions and nested effects Often used for testing hypotheses with experimental data

3 BASICS Factor A (industry) Level 1 (manufact) Factor A (industry) Level 2 (trade) Factor B (size) Level 1 (small) Cell Factor B (size) Level 2 (medium) Factor B (size) Level 3 (large) 3 X 2 full factorial design (full: each cell has observations) Balanced design: each cell has equal number of observations

4 ASSUMPTIONS Enough observations in each group? (n >20) Independence of observations Similarity of variance-covariance matrices (no problem if largest group variance < 1.5*smallest group variance, 4* if balanced design) Normality Linearity No outlier-observations

5 STEPS OF INTERPRETATION Model significance? F-test and R square Welch, if unequal group variances (this can be tested using Levene or Brown-Forsythe test) Significance of effects? (F-test and partial eta squared) Which group differences are significant? Post hoc or contrast tests What are the group differences like? Estimated marginal means for groups

6 Oneway ANOVA A continuous dependent variable (y) and one categorical independent variable (x), with min. 3 categories, k= number of categories assumptions: y normally distributed with equal variance in each x category H0: mean of y is the same in all x categories Variance of y is divided into two components: within groups (error) and between groups (model, treatment) Test statistic= between mean square / within mean square follows F-distribution with k-1, n-k degrees of freedom F-test can be replaced by Welch if variances are unequal

7 Oneway ANOVA If the F test is significant, you can use post hoc tests for pairwise comparison of means across the groups Alternatively (in experiments) you can define contrasts ex ante

8 SAS: oneway ANOVA

9 BF or Levene, H0: group variances are equal Use this instead of F if variances are not equal

10 SAS: oneway ANOVA Post hoc -tests

11 SAS: oneway ANOVA

12

13 MODEL FIT SourceDF Sum of SquaresMean SquareF ValuePr > F Model3298.399264099.466421313.41<.0001 Error68504.41393057.4178519 Corrected Total71802.8131944 R-SquareCoeff VarRoot MSEdeathrate Mean 0.37169234.109812.7235737.984722 Class Level Information ClassLevelsValues class_popgrowth41 2 3 4

14 EQUALITY OF VARIANCES Levene's Test for Homogeneity of deathrate Variance ANOVA of Squared Deviations from Group Means SourceDF Sum of Squares Mean SquareF ValuePr > F class_popgrowth33004.31001.44.230.0084 Error6816110.6236.9 Welch's ANOVA for deathrate SourceDFF ValuePr > F class_popgrowth3.000013.00<.0001 Error18.9519

15 GROUP MEANS Level of class_popgrowthN deathrate MeanStd Dev 12710.56666673.01457996 2226.92727271.60064922 3175.97058821.87941637 465.95000005.61809576

16 POST HOC TEST Comparisons significant at the 0.05 level are indicated by ***. class_popgrowth Comparison Difference Between Means Simultaneous 95% Confidence Limits 1 - 23.63941.51355.7653*** 1 - 34.59612.30446.8877*** 1 - 44.61671.27607.9573*** 2 - 1-3.6394-5.7653-1.5135*** 2 - 30.9567-1.43353.3468 2 - 40.9773-2.43174.3862 3 - 1-4.5961-6.8877-2.3044*** 3 - 2-0.9567-3.34681.4335 3 - 40.0206-3.49423.5353 4 - 1-4.6167-7.9573-1.2760*** 4 - 2-0.9773-4.38622.4317 4 - 3-0.0206-3.53533.4942

17 BOXPLOTS

18 Multiway ANOVA, GLM A continuous dependent variable y, two or more categorical independent variables (factorial design) ANCOVA, if there are continuous independents (covariates) main effects and interaction effects can be modeled fixed factor, if all groups are present and random factor, if only some groups are randomly represented in the data Eta squared = SSK/SST expresses how many % of the variance in y is explained by x (not in EG! SAS code: model y = x1 x2 / ss3 EFFECTSIZE;)

19 INTERACTION EFFECT Synergy of two factors, the effect of one factor is different in the groups of the other factor Crossing effect = interaction effect Ordinal (lines in means plot have different slopes, but do not cross) Disordinal (lines cross in the means plot)

20 NO INTERACTION Size and industry both have a significant main effect No interaction, homogeneity of slopes

21 INTERACTIONS Ordinal interaction (the effect of size is stronger in manufacturing than in trade) Dis-ordinal interaction (the effect of size has a different sign in manufacturing and trade)

22 NESTED EFFECTS Nested effect B(A) ”B nested within A” size (industry): the effect of size is estimated separately for each industry group Difference between nested and interaction effect is that the main effect of B (size) is not included The slope of B (size) is different in each category of A (industry)

23 ESTIMATED GROUP MEANS Estimated marginal means or LS (least squares) means Predicted group means are calculated using the estimated model coefficients The effects of other independent variables are controlled for Is not equal to the group means from the sample

24 SUM OF SQUARES Type I SS does not control for the effects of other independent variables which are specified later into the model Type II SS controls for the effects of all other independents Types III and IV SS are better in unbalanced designs, IV if there are empty cells

25 POST HOC TESTS Multiple comparison procedures, mean separation tests The idea is to avoid the risk of Type I error which results from doing many pairwise tests, each at 5% risk level E.g. Bonferroni, Scheffe, Sidak,… Tukey-Kramer is most powerful H0: equal group means -> rejection means that group means are not equal, but failure to reject does not necessarily mean that they are equal (small sample size -> low power -> failure to reject the null)

26 ANCOVA The model includes a covariate (= continuous independent variable, often one whose effect you want to control for) Regress y on the covariate -> then ANOVA with factors explaining the residual The relationship between covariate and y must be linear, and the slope is assumed to be the same at all factor levels The covariate and factor should not be too much related to each other Do not include too many covariates, max 0.1*n – (k- 1)

27 SAS: analyze – ANOVA – linear models

28 Effects to be estimated Interaction here, first select both variables, then click Cross

29 Sums of squares

30 Other options, defaults ok

31 Post hoc-tests

32 Plots

33 SAS - code PROC GLM DATA=libname.datafilename PLOTS(ONLY)=DIAGNOSTICS(UNPACK) PLOTS(ONLY)=RESIDUALS PLOTS(ONLY)=INTPLOT ; CLASS Elinkaari Perheyr; MODEL growthorient=ln_hlo Elinkaari Perheyr Elinkaari*Perheyr / SS3 SOLUTION SINGULAR=1E-07 EFFECTSIZE ; LSMEANS Elinkaari Perheyr Elinkaari*Perheyr / PDIFF ADJUST=BON ; RUN; QUIT;

34 Model significance and fit Class Level Information ClassLevelsValues Elinkaari phase32 3 4 Perheyr family20 1 Number of Observations Read181 Number of Observations Used132 SourceDF Sum of SquaresMean SquareF ValuePr > F Model613.030855422.171809243.590.0026 Error12575.698100810.60558481 Corrected Total13188.72895623 R-SquareCoeff VarRoot MSEgrowthorient Mean 0.14686121.793820.7781933.570707

35 Significance of predictors SourceDFType III SSMean SquareF ValuePr > F ln_hlo employees12.88693851 4.770.0309 Elinkaari phase29.521763374.760881697.860.0006 Perheyr family10.28960870 0.480.4905 Elinkaari*Perheyr Phase*Family 21.990711200.995355601.640.1974

36 EFFECT SIZE OF PREDICTORS Source Total Variation Accounted ForPartial Variation Accounted For Semipartial Eta-Square Semipartial Omega- Square Conservative 95% Confidence Li mits Partial Eta- Square Partial Omega- Square 95% Confidenc e Limits ln_hlo 0.03250.02550.00000.11120.03670.02770.000 0 0.115 8 Elinkaari 0.10730.09300.02190.20560.11170.09420.022 5 0.207 3 Perheyr 0.0033-0.00350.00000.04880.0038-0.00400.000 0 0.050 3 Elinkaari*Per heyr 0.02240.00870.00000.08420.02560.00970.000 0 0.088 7

37 Parameter estimates ParameterEstimate Standard Errort ValuePr > |t| Intercept3.196306815B0.498267146.41<.0001 ln_hlo employees0.1610795780.073775002.180.0309 Elinkaari 2 growth0.372704251B0.490301190.760.4486 Elinkaari 3 mature-0.041166136B0.46224369-0.090.9292 Elinkaari 4 decline0.000000000B... Perheyr 0 non family-0.862973482B0.92404272-0.930.3522 Perheyr 1 family0.000000000B... Elinkaari*Perheyr 2 01.250588328B0.984918051.270.2065 Elinkaari*Perheyr 2 10.000000000B... Elinkaari*Perheyr 3 00.654885600B0.942413800.690.4884 Elinkaari*Perheyr 3 10.000000000B... Elinkaari*Perheyr 4 00.000000000B... Elinkaari*Perheyr 4 10.000000000B...

38 Prediction for 6 cells Elinkaari=2 & perheyr=0 (growth phase, non family) Growth = 3.20 + 0.16*ln_hlo + 0.37 – 0.86 + 1.25 = 3.96 + 0.16*ln_hlo Elinkaari=3 & perheyr=0 (mature phase, non family) Growth = 3.20 + 0.16*ln_hlo – 0.04 – 0.86 + 0.65 = 2.95 + 0.16*ln_hlo Elinkaari=4 & perheyr=0 (decline phase, non family) Growth = 3.20 + 0.16*ln_hlo + 0.00 – 0.86 + 0.00 = 2.34 + 0.16*ln_hlo Elinkaari=2 & perheyr=1 (growth phase, family) Growth = 3.20 + 0.16*ln_hlo + 0.37 + 0.00 + 0.00 = 3.57 + 0.16*ln_hlo Elinkaari=3 & perheyr=1 (mature phase, family) Growth = 3.20 + 0.16*ln_hlo - 0.04 + 0.00 + 0.00 = 3.16 + 0.16*ln_hlo Elinkaari=4 & perheyr=1 (decline phase, family) Growth = 3.20 + 0.16*ln_hlo + 0.00 + 0.00 + 0.00 = 3.20 + 0.16*ln_hlo 38

39 Parameter estimates The X'X matrix has been found to be singular, and a generalized inverse was used to solve the normal equations. Terms whose estimates are followed by the letter 'B' are not uniquely estimable. This warning always occurs if you have categorical independent variables in the model, SAS can however estimate the coefficients 39

40 Homoskedasticity

41 Outlier diagnostics

42 Residual distribution

43 Model fit

44 Influence diagnostics

45 Residual vs. covariate

46 Significance of group differences, main effects Elinkaari phase growthorient LSMEAN LSMEAN Number 2 growth4.146432111 3 mature3.434710352 4 decline3.148433693 Least Squares Means for effect Elinkaari Pr > |t| for H0: LSMean(i)=LSMean(j) Dependent Variable: growthorient i/j123 10.00060.1225 20.00061.0000 30.12251.0000 Perheyr Family growthorient LSMEAN H0:LSMean1=LSMean 2 Pr > |t| 03.462617630.4905 13.69043314

47 Significance of group differences, interaction PhaseFamily growthorient LSMEAN LSMEAN Number 2 growth04.340239531 213.952624682 3 mature03.330666413 313.538754304 4 decline02.716946955 413.579920436 Least Squares Means for effect Elinkaari*Perheyr Pr > |t| for H0: LSMean(i)=LSMean(j) Dependent Variable: growthorient i/j123456 11.00000.01610.10520.84741.0000 2 0.10400.81771.0000 30.01610.10401.0000 40.10520.81771.0000 50.84741.0000 6 Non-family firms in growth phase differ from non-family firms in mature phase

48 REPORTING GLM Model fit: F + df + p and R Square Nature and significance of effects: parameter estimates B+s.e.+t+p and F+p estimated group means (means plot) post hoc test results

49 Means plot Employees at its mean value (20)


Download ppt "GENERAL LINEAR MODELS Oneway ANOVA, GLM Univariate (n-way ANOVA, ANCOVA)"

Similar presentations


Ads by Google