turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- GLIMMIX - unbalanced repeated measures bat behavio...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-01-2012 05:25 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-03-2012 02:06 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-06-2012 06:06 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-07-2012 08:03 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-10-2012 02:25 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-14-2012 07:50 PM

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.