BookmarkSubscribeRSS Feed
JoëlJ
Calcite | Level 5

Hi, I am wondering if anyone can confirm that I have the right model.

I have three groups of animals. At the start of the experiment Group 1 received treatment 1, Group 2 received treatment 2 and Group 3 is a control group.  Each animal has a specific ID and is allowed to hibernate (I might as well say, these animals are bats). Whenever the animals wake up for a short period (usually around 1-2 hours), their behaviour is monitored until they go back into hibernation. The proportion of time they spend expressing 10 specific behaviours is recorded. This continues until the end of the experiment. We also note the number of days left until the end of the experiment for each arousal and the histological condition of the wing (category 0-5). Every time a bat arouses, we take a measurement so it is like repeated measures on the individual bats but not all bats have the same number of arousals (between 3 and 7 arousals per bat). We want to know if there is a difference among the groups for each behavior.

‘Group’ is the independent variable

‘Behaviour x’ is the response variable

‘ID’ is a random effect with repeated measures

‘Days to End’ is a random effect. We would like to include it as a covariate or fixed effect but it does not seem to be correlated with any of the behaviour variables so I am not sure if it should be included at all.

I am not sure if ‘Wing Histology’should be included in the model at all as it is dependent on ‘Group’ and the original treatment given to bats and also likely drives some of the behaviours we see.

The model I have so far is:

proc glimmix;

class group id histopath daystoend;

model behavior1 = group daystoend group*daystoend/ dist=beta;

random _residual_ / subject=id;

lsmeans group / diff cl;

run;

Have I specified the repeated measure correctly?

Should ‘daystodeath’ be included as a random variable as well and if so, how would I do this?

Any suggestions would be immensely appreciated. Thank you.

5 REPLIES 5
SteveDenham
Jade | Level 19

I get really scared (and not by bats) when repeated measures are taken at uneven intervals on subjects like this--things are going to get difficult.  Correct me if I am wrong in my assumption that daystoend is a variable that for any given id specifies something about the timing of when the measurement was taken.  If so, you might consider the following:

proc glimmix;

class group id daystoend;

/* create a continuous version of daystoend that will be used to specify the covariance structure */

dte=daystoend;

model behavior1 = group daystoend group*daystoend/ dist=beta;

random daystoend /residual type=sp(pow)(dte) subject=id;

lsmeans group / diff cl;

run;

In this code, daystoend may differ for different individuals, depending on the number of sessions an individual is observed.  If I am incorrect in this assumption, we need to find some other variable to index the sessions.

Steve Denham

JoëlJ
Calcite | Level 5

Hi, thank you very much for your help. Your assumption that days is different depending on the individual is right. I've tried running the code you suggest and I get the following error message:

ERROR:Invalid Operation.

ERROR:Termination due to Floating Point Exception

Do you know why this is happening? I've read that this can happen if there are empty cells in the data set but I've run it without empty cells and it still gives me the message.Do you know what type of information I need to look at in order to understand why the problem is happening and fix it?

Anything you can offer would be greatly appreciated.

Joel

SteveDenham
Jade | Level 19

Just a guess.  With dist=beta, the default link is logit.  You may have structural zeroes.  However, since you have run into the same problem after removing empty cells, I wonder if you are at the other end of the spectrum where ALL of the observations are 1, so that the logit goes off scale.  As I said, this is just a guess.  Depending on the size of the R matrix (number of distinct values of daystoend), you may have some luck if you change the random statement to:

random daystoend /residual type=chol subject=id;

I fear that the matrix may exceed your memory available though.

You might also look at Example 40.4: Quasi-likelihod Estimation for Propotions with Unknown Distribution in the documentation, as another way to attack pseudo-binomial data.  Some of the observations there are zeroes.

Steve Denham

Message was edited by: Steve Denham

JoëlJ
Calcite | Level 5

Thank you so much for the advice. Unfortunately, when I use type=choleski, I receive the following: WARNING: Pseudo-likelihood update fails in outer iteration 1. I am still trying to figure out what this means. However, in many cases, when I use a gamma distribution and an inverse link with the model you initially suggested above (random daystoend /residual type=sp(pow)(dte) subject=id), the model converges. There are empty values in the Output with the full model, but if I remove the group*daystoend interaction, there are no empty results in the Output. From my understanding, some distributions are better suited to certain types of data than others and I am still trying hard to understand how it is possible to choose a distribution that fits the data well but that is theoretically invalid and how this can affect Type1 and Type2 error.

In your opinion, is dist=gamma link=inverse valid for the type of data I have? I know that gamma is often used to model the time to a particular event and in my case, it might be best suited for lag times between arousal and starting a particular behaviour. However, would I also be able to use gamma to model proportion of time spent expressing a behaviour?

I am very grateful for your continued correspondance regarding this problem.

Joel Jameson

Damien_Mather
Lapis Lazuli | Level 10

Hi Joel.

Steve's right on the ball there..

sp(pow) correlation structures are so cool..

A slightly more theory-friendly distribution than the inverse gamma that you might like to try is the generalized (for over-dispersion only) poisson. See Glimmix example 14. When you copy the programming syntax remember to substitute your response ('Behaviour1'..) for 'y'. See the references for the motivation for choosing an generalized poisson..let us know how it goes..

Batrivia: Bats were the only mammals native to New Zealand before humans (and all their pesky mammal pet, pelt, sport and food species) colonized (sic). They developed some un-bat-like and sadly introduced-predator-friendly behaviour like crawling around on the forest floor instead of swooping in and out.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 2643 views
  • 0 likes
  • 3 in conversation