## Binary data analysis with proc glimmix

Occasional Contributor
Posts: 8

# Binary data analysis with proc glimmix

I am analyzing the viability of 3 cell types in 4 animals that were subjected to 3 different treatments plus one control group (4 groups). I am counting the number of live cells and dead cells, of each of the 3 types of cells and then I will need to assess, for example, if one of the groups has a larger number of live cells in relation to the dead ones than another treatment. As I can only have alive or dead cells (and nothing in between) they told me that I could use proc glimmix but considering that the data is binary (o or 1). How can I do this type of analysis? Do I need any special data codification? Thank you.

I have attached a table with some examples

(NOTE:

Vaca = animal,

Grupo = treatment,

Horas = number of hours under the effect of the treatments;

PM_viability, P_viability and S_Viabilidade, are the 3 different types of cells).

Occasional Contributor
Posts: 8

## Re: Binary data analysis with proc glimmix

Sorry, no with the correct file attatched

SAS Super FREQ
Posts: 3,755

## Re: Binary data analysis with proc glimmix

I don't understand your response variables. Look at the first four observations (Vaca=1;Grupo=1; Horas=0,4,24,48). What do the following numbers represent?

PMVivos  PMMortos

9               33

8               09

7               44

25              29

Occasional Contributor
Posts: 8

## Re: Binary data analysis with proc glimmix

Sorry, I forgot to mention that Vivos means alive and Mortos means Dead (PM, P, and S are the 3 cell types), so, for exemple:

Thank you

 Vaca Grupo Horas PMVivos PMMortos 1 1 0 9 9 PM cells alive in animal 1, group 1, with 0h of treatment 33 33 PM dead cells  in animal 1, group 1, with 0h of treatment 1 1 4 8 8 PM cells alive in animal 1, group 1, with 4h of treatment 9 9 PM dead cells in animal 1, group 1, with 4h of treatment 1 1 24 7 7 PM cells alive in animal 1, group 1, with 24h of treatment 44 44 PM dead cells in animal 1, group 1, with 24h of treatment
SAS Super FREQ
Posts: 3,755

## Re: Binary data analysis with proc glimmix

Yes, I understand the words Vivos/Mortos=Alive/Dead.

Often in an experiment, there are a fixed number of cells, N.

At every time t, there are V cells that are alive and N-V cells that are dead. As a function of time,

V(t) is nonincreasing because a dead cell cannot come back to life.

Clearly the total number of cells is changing with time. What is the biological process that allows you to have

42 cells at Horas=0, 17 cells at Horas=4, 51 cells at Horas=24, and 54 cells at Horas=48?  Where are the cells coming from and where do they go?

Occasional Contributor
Posts: 8

## Re: Binary data analysis with proc glimmix

When I do the analysis to see if the cells are alive or dead, II have to "kill" that part of the in vitro cultured tissue sample. So I have to use different pieces of tissue that are not entirely equal between them (although coming from the same animal). So for example, I have a major piece of tissue from the same animal that I divide in the number of smaller pieces to use in the different groups of treatment and hours of treatment. Thank you

PROC Star
Posts: 230

## Re: Binary data analysis with proc glimmix

Does this mean that you have 16 (4 treatments x 4 hours) pieces of tissue from the same animal? Is it appropriate to assume that each of the 16 pieces is statistically independent of the others (for example, each is in its own container)? Are all pieces being run at the same time?

Do you plan to do a separate analysis for each cell type?

Have you tried to write GLIMMIX code? If so, show us how far you've gotten. (If you haven't started to learn how to do this sort of model, you won't understand what anyone in the Community might suggest.)

Occasional Contributor
Posts: 8

## Re: Binary data analysis with proc glimmix

Yes, here it goes what I have at the moment. Thanks

proc glimmix;
class Vaca Grupo Horas;
model PMVivos/PMTotais = Horas/dist =bin link =logit;
random Vaca;
run;

proc glimmix;
class Vaca Grupo Horas;
model PMVivos/PMTotais = Grupo/dist =bin link =logit;
random Vaca;
run;

attachments. -##
Occasional Contributor
Posts: 8

## Re: Binary data analysis with proc glimmix

And the same for the other cell types:

proc glimmix;
class Vaca Grupo Horas;
model PMVivos/PMTotais = Horas/dist =bin link =logit;
random Vaca;
run;

proc glimmix;
class Vaca Grupo Horas;
model PMVivos/PMTotais = Grupo/dist =bin link =logit;
random Vaca;
run;
proc glimmix;
class Vaca Grupo Horas;
model PVivos/Ptotais = Horas/dist =bin link =logit;
random Vaca;
run;

proc glimmix;
class Vaca Grupo Horas;
model PVivos/Ptotais = Grupo/dist =bin link =logit;
random Vaca;
run;

proc glimmix;
class Vaca Grupo Horas;
model SVivos/Stotais = Horas/dist =bin link =logit;
random Vaca;
run;

proc glimmix;
class Vaca Grupo Horas;
model SVivos/Stotais = Grupo/dist =bin link =logit;
random Vaca;
run;

PROC Star
Posts: 230

## Re: Binary data analysis with proc glimmix

You did not answer whether you have 16 (4 treatments x 4 hours) pieces of tissue from the same animal, or whether it is appropriate to assume that each of the 16 pieces is statistically independent of the others (for example, each is in its own container), or whether all pieces are run at the same time.  It's not possible to determine an appropriate model structure without this information.

Your code is helpful, and I believe it illustrates that you may not yet have the correct vision of the model. Currently, you are analyzing the effects of GRUPO and HORAS separately; I would think a two-way factorial (GRUPO and HORAS jointly) model would be more appropriate, but that determination actually depends upon your research questions.

The data set that you provided does not include the "Totais" variable for each cell type; those variables are required if you want to use the binomial distribution for counts (of alive, dead, and hence total) clustered by tissue sample; for clustered counts, you'll need to use the events/trials syntax, where VIVOS is events and TOTAIS is trials; here is the documentation link http://documentation.sas.com/?docsetId=statug&docsetVersion=14.2&docsetTarget=statug_glimmix_syntax1....

Occasional Contributor
Posts: 8

## Re: Binary data analysis with proc glimmix

I apologize for not clarifying things properly. At 0h I assume that the values obtained in one piece of tissue will be equal for all the groups (as the treatment hasn´t started yet) and I use those values at 0h for the rest of the groups from the same animal. So I have 12 pieces of tissue plus one for the 0h (please see image below that only represents animal 1).

All pieces are run at the same time.

In the model, I am using (I use a .prn file were I take the values from) :

alive/ Totals [the same as saying alive/ (dead+alive) ].

When I run the model I have negative values for the estimates (please see image below) that I´m having trouble interpreting but that  I guess they are the logit (have to convert in probabilities ?) ? Can you help me determining an appropriate model structure ? Thank you very much.

PROC Star
Posts: 230

## Re: Binary data analysis with proc glimmix

One approach to analysis of this sort of treatment design is to fit a one-way model (in your case, the one factor would have 13 levels) and then use contrasts to extract the pertinent tests of main effects and interactions. Writing the contrasts is much easier if you take advantage of the LSMESTIMATE statement in GLIMMIX--but it's still a challenge and easy to get wrong.

A slick trick that avoids writing contrasts is found here

http://www.stat.ncsu.edu/people/dickey/courses/st512/lab10/factctrl.html

for which I thank David Dickey at NCSU.

In the attached code, I've modified Dickey's code to add a blocking factor, switch to GLIMMIX, and compare 3 different statistical models (including both Dickey's approach and the one-way/contrast approach). The example data assume a normal distribution (rather than binomial), and the factorial treatment structure is different than yours (the example is a 2x2x3, and you have a 4x3). See how far this takes you!

Regarding negative estimates: You guess correctly. The values in the "Estimate" and "Standard Error" columns are on the link scale. Another lovely advantage of GLIMMIX is that it will report statistics on the inverse link scale (here, proportions) in the "Mean" and "Standard Error Mean" columns.

Occasional Contributor
Posts: 8

## Re: Binary data analysis with proc glimmix

Thank you very much,
I will try now to apply to my data.
Discussion stats
• 12 replies
• 195 views
• 4 likes
• 3 in conversation