# Post-hoc after GLM: What does it exactly say?

## Background:

I have been asked to model the change of weight of a few animals undergoing experimentation via a simple GLM (General Linear Model). The data looks something like this. Note that all data are normally distributed.

I did try to log transform the data t smooth out the line, but that was not working. The following was on non transformed data.

In short, it is a timecourse experiments with weight being monitored weekly for 11 weeks under treatment of a drug or placebo.

## Model:

So here is the model that I constructed. Week + Strain + Treatment + WeekStrain + WeekTreatment + StrainTreatment + WeekStrain*Treatment

It looks like it was a good guess, and a we can see from the table below, we can safely remove all interaction terms as they are not affecting the model in any way(do correct me if I am wrong, as I am not a student of statistics.

Anyway, now to further explain the differences, I performed a posthoc (bonferroni). TO give these results

All well and good, and the results are as expected.

## Question

Now for my question, as we can see in the posthoc, say for example the strain FvB Saline vs FvB treated has a mean difference of -2.83g. Great! Except I do not know where does this difference lie. Is it the difference obtained by averaging all values of mass in the strain and subtracting from each other ?

That is

$$x = \frac{\sum FvBTreated_{(weeks_{1-11})}}{n} - \frac{\sum FvBSaline_{(weeks_{1-11})}}{n'}$$

Which makes sense,as when I perform that computation, as it gives the same value. Or is anything else being calculated behind the scene?

Apologies for being so thick, but if my above assumption is right, why did I perform the GLM in the first place ? I could have just started with the averaging and did a multiple t-test

And secondly, I will not be able to use the post hoc data, as the averaging of the entire series of data is wrong, as it does not make sense scientifically. The drug administered has a greater effect (measured by weight gain) in the initial weeks, with diminishing returns each following week, hence an average across all weeks can not be applied.

So, is there any other way to quantify the data (so I can write up on a paper), that I can use? If you need the raw data let me know, and I can send it over.

## EDIT:

THIS EDIT IS OFF-TOPIC TO THE MAIN QUESTION. I included it nonetheless, just as a reference as to how I proceeded forward in relation to the glm

I have been pointed out that the model to be used here is a repeated measures on the weeks variable.

Applying the repeated measures variable had caused quite a bit of shuffling around the data in the way its organised. Since I kept running out of degrees of freedom when I asked the model (nicely) to figure out if an interaction existed between Strain and treatment, I had to take into account of that.

Essentially, instead of having 2 separate factors of strain and treatment, I merged them into 1 factor (called CumuStrain here). Since they were nominal variables anyway, it does not matter much.

So In the old GLM model a Strain(factor) of FvB which was treated with Saline(factor), has a new amalgamated factor in CumuStrain defined as "FvB Saline".This is allright in terms of the question being asked (its a bit complex to explain, but we can go ahead and amalgamate it.)

The amalgamated CumuStrain factor also takes care of the problem of the degrees of freedom. After a greenhouse gressier correction, the Weeks*CumuStrain is found to be interacting, with a nice comfy p value of 0.01.

Here is the spss output on scribd https://www.scribd.com/doc/248376572/Log-Dump-SPSS1.

• "we can safely remove all interaction terms" note that you did not have sufficient degress of freedom to test 2 of the interaction terms. More importantly, this is a repeated-measures design, so Week cannot be a free term in the model, the model is incorrect. Look into rmANOVA for example. – katya Nov 26 '14 at 20:46
• Oh dear, thanks for pointing it out. I'll correct the model soon. However, do let me know about the post hoc thing ? or does it not apply anymore as the model changes ? – Rover Eye Nov 26 '14 at 20:54
• will have to come back to the post-hoc thing:) - this one is not meaningful. Effect slices week*strain (? - not clear which one is strain which is trt from you graph) is one possibility. – katya Nov 26 '14 at 21:02
• I updated my original post quite a bit with the new model. Weeks*Cumustrain (see original post does indeed interact). Thanks for the heads up. Can you please elaborate on your previous statement as I am not too sure what you mean ? (am a biologist). – Rover Eye Nov 26 '14 at 21:59
• It isn't clear from your edited post (not off-topic for your primary question, btw) whether rm was done correctly. Forgetting this for a moment, the post-hoc does not remain the same if you have an interaction (also obvious from the graph). Here's more info on effect slices ats.ucla.edu/stat/sas/library/SASSlice_os.htm – katya Nov 26 '14 at 22:40