25
SAS: PROC GLIMMIX Why are your students using it? A. Michelle Edwards, Ph.D., MLIS OAC Stats Consultant

SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

SAS: PROC GLIMMIXWhy are your students using it?

A. Michelle Edwards, Ph.D., MLIS

OAC Stats Consultant

Page 2: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

QUICK REVIEW – How we learned ANOVA

ASSUMPTIONS1. Normal Distribution“robust”

2. Homogeneity of VarianceLevene’s test

3. IndependenceMeasuresExperimental units

A.M.Edwards, Ph.D., MLIS

2

Page 3: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

Null Hypothesis:

𝐻𝐻𝑜𝑜: 𝜇𝜇𝑖𝑖 = 𝜇𝜇𝑗𝑗𝐻𝐻𝑎𝑎: 𝜇𝜇𝑖𝑖 ≠ 𝜇𝜇𝑗𝑗

If p < 0.05 then we got excited and said there were differences between our treatment groups

A.M.Edwards, Ph.D., MLIS

3 QUICK REVIEW – How we learned ANOVA

Page 4: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

Data Types and our Research

Continuous dataWe tend towards this type of data

Categorical or Non-continuous dataScores – Body Condition scores, Disease scoresCountsProportions

A.M.Edwards, Ph.D., MLIS

4

Page 5: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

Non-continuous data and ANOVA

Transformations were our best friend!Log transformation was magic!There were others

Arcsin-square rootBox-cox

Forcing that round peg into that square hole!!

A.M.Edwards, Ph.D., MLIS

5

Page 6: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

Non-continuous data and ANOVA

If that STILL failed….

Non-parametric statistics

Nothing wrong with this approach!!Conclusions are not as “firm”We CANNOT talk about meansMaybe, just maybe, we are not analyzing the same

model – no more RANDOM effects as an exampleA.M.Edwards, Ph.D., MLIS

6

Page 7: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

Back to ANOVA

ANOVA = Analysis of VariancePartitioning of variance (variation)

How can we explain or partition the variation seen in our outcome variable, Y, dependent variable? Regardless of what data type we collected!!!

Experimental design – known sources of variation

A.M.Edwards, Ph.D., MLIS

7

Page 8: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

Total variation

A B AxB Design Cov Unknown

Back to ANOVA

A.M.Edwards, Ph.D., MLIS

8

Page 9: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

Back to ANOVA

It was ALWAYS about the errors – how do we break apart of partition the variation in our outcome measures in a way that minimizes the random error that remains.

A.M.Edwards, Ph.D., MLIS

9

Page 10: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

Back to ANOVA

First of all “Nothing has changed!!!” Statistics have NOT changed!!!

The estimation methods on how to more “accurately” or better way to “define” our variation have improved

Gone are the days of calculating SS by hand!

A.M.Edwards, Ph.D., MLIS

10

Page 11: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

Generalized Linear Mixed ModelsGLMM

Linear Mixed Models – we’ve been doing this for YEARS nowAre you including a RANDOM effect in your model?Then you are using a Linear Mixed Model

“Generalized” means you no longer have “normal” data going into the analysis – you are generalizing your model

A.M.Edwards, Ph.D., MLIS

11

Page 12: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

Whoa!!!! What about the assumptions that were drilled into us???

Model assumptions – not data assumptions!1. Residuals are random2. No dependencies on treatments – no patterns

in our residuals3. Homogeneity of our residuals across treatment

groups4. Residuals have a normal distribution5. Residuals have a mean and sum =0

A.M.Edwards, Ph.D., MLIS

12

Page 13: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

ANOVA

Errors (unknown parts) Random Independent of treatment and design effects Common covariance (homogenous) Normally distributed Mean of 0

A B AxB Design Cov Unknown

Total variation

A.M.Edwards, Ph.D., MLIS

13

Page 14: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

Checking assumptions?

Various plots of residualsNormality test

A.M.Edwards, Ph.D., MLIS

14

Page 15: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

What does this REALLY mean?

Data types we can use:Continuous (normal/Gaussian)Lognormal distributionCounts (Poisson or Negative Binomial)Yes/No (Binary)Proportions (Beta or Binomial)Time to event (Gamma)Scores (Multinomial nominal or ordinal)

A.M.Edwards, Ph.D., MLIS

15

Page 16: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

What does this REALLY mean?

For the most part – there will always be an exception

NO MORE TRANSFORMATIONS!!!

Analyse different types of data collected in a trial with the same model!!

A.M.Edwards, Ph.D., MLIS

16

Page 17: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

SAS – A little history

PROC ANOVA1966Balanced and FIXED effects ONLY!

PROC GLM1976Balanced and unbalanced (Type I and Type III SS)RANDOM statement – Expected Mean Square

A.M.Edwards, Ph.D., MLIS

17

Page 18: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

SAS – A little history

PROC MIXED1992REML – moving past the SS (OLS)RANDOM – that is incorporated – no more EMSREPEATED

A.M.Edwards, Ph.D., MLIS

18

Page 19: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

SAS – A little history

Data MUST be from a normal distribution for:

PROC ANOVAPROC GLM

PROC MIXED

A.M.Edwards, Ph.D., MLIS

19

Page 20: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

SAS – A little history

PROC GLIMMIXFirst introduced as %GLIMMIX – a macro2005DISTRIBUTIONs

A.M.Edwards, Ph.D., MLIS

20

Page 21: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

SAS – PROC GLIMMIX

Let’s work through 3 examples:

1. RCBD using PROC GLM, MIXED and GLIMMIX with continuous measure To show similarities and differences between the 2

PROCs

A.M.Edwards, Ph.D., MLIS

21

Page 22: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

SAS – PROC GLIMMIX

Let’s work through 3 examples:

2. An example with data that was collected as a count and a proportion To show how to use a different distribution than the

default Gaussian

A.M.Edwards, Ph.D., MLIS

22

Page 23: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

SAS – PROC GLIMMIX

Let’s work through 3 examples:

3. An example with score data To show how to use a multinomial ordinal distribution

A.M.Edwards, Ph.D., MLIS

23

Page 24: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

SAS: PROC GLIMMIXWhy are your students using it?

Still an ANOVA or Partitioning of Variation

Uses upto date estimation methods

Allows us to use the same model for MOST datatypes collected during a trial

A.M.Edwards, Ph.D., MLIS

24

Page 25: SAS: PROC GLIMMIX Why are your students using it? · SAS – A little history PROC ANOVA 1966 Balanced and FIXED effects ONLY! PROC GLM 1976 Balanced and unbalanced (Type I and Type

If you have any Questions or workshop/class requests

Email: [email protected]

Appointments: http://oacstats.youcanbook.me

Blog: oacstats.blog

A.M.Edwards, Ph.D., MLIS

25