Solved
New Contributor
Posts: 2

# Survival analysis PHREG with clustered data

I am working on a data set in which treatments were applied to groups of individuals (in this case, groups of cows), but time to event (pregnancy or removal from the herd) was measured at the individual cow level.

I have analyzed clustered data of continuous or categorical nature with mixed models using Proc Mixed (continuous) and Glimmix (categorical) with random effect of cluster nested within treatment to specify the proper error term for testing the effects of treatments.

In this particular case, cows were housed in different groups within a farm and each group was fed either a control or an intervention diet. For each of the two treatments, we had 8 groups (n = 16 total experimental units) and in each group we had variable numbers of cows (40 to 55 each). The total number of cows was 840, but we only had 16 experimental units (15 degrees of freedom).

When I analyze continuous variables (e.g. milk yield, kg/d), I fit a mixed model with the random effect of group nested within treatment in Proc Mixed

- Random group(treatment);

However, my problem is how to properly analyze time to event (survival analysis) with such type of data.

I have used frailty models with PHREG to analyze clustered data, but the clusters in those cases had individuals that received the treatment and individuals that remained as controls. In those cases, I simply included

- Random cluster;

To handle the random effect of cluster in the model.

The issue with the y current data is that cluster 1 has individuals that received only the control diet, whereas cluster 2 has individuals that received only intervention diet, and so forth.

I have tried to identify how SAS PHREG handles such data, but have not been able to find examples.

See attached file in Excel.

Thank you.  Best regards,

Jose E. Santos

Department of Animal Sciences

University of Florida

Accepted Solutions
Solution
‎05-24-2017 01:41 AM
New Contributor
Posts: 2

## Re: Survival analysis PHREG with clustered data

Thank you!

I used SURVERYPHREG and the Cluster function to identify the clusters and, according to the descritpion in SAS and the denominator DF, it now computes the proper error term.

Best regards,

All Replies
Super User
Posts: 20,765

## Re: Survival analysis PHREG with clustered data

Have you looked at PROC SURVEYPHREG?

https://support.sas.com/rnd/app/stat/procedures/surveyphreg.html

Solution
‎05-24-2017 01:41 AM
New Contributor
Posts: 2

## Re: Survival analysis PHREG with clustered data

Thank you!

I used SURVERYPHREG and the Cluster function to identify the clusters and, according to the descritpion in SAS and the denominator DF, it now computes the proper error term.

Best regards,

☑ This topic is solved.