Amadeus cookies policy - you'll see this message only once.

Amadeus use cookies on this website. They help us to know a little bit about you and how you use our website, which improves the browsing experience and marketing - both for you and for others. They are stored locally on your computer or mobile device. To accept cookies, continue browsing as normal. Or, go to the privacy policy for more information.

Proc PHREG - Random Statement

The PHREG procedure now fits frailty models with the addition of the RANDOM statement.

The (Proportional Hazards Regression) PHREG semi-parametric procedure performs a regression analysis of survival data based on the Cox proportional hazards model. An assumption of the Cox proportional hazard model is a homogeneous population meaning in essence that all individuals sampled are under the same risk of having the event. However, this is not always the case.

In some situations data may be able to be grouped naturally or artificially into clusters. Observations that come from the same cluster are more alike than observations chosen at random and failure times within these clusters tend to be correlated. Ignoring clustering and treating these observations as independent will lead to biased standard errors and test statistics.

There are two approaches to adjust for the intracluster correlation.

  1. To use a robust sandwich covariance matrix estimate to account for the intracluster dependence.

  2. To use a shared frailty model where cluster effects are incorporated into the model as independent and identically distributed random variables.

This tip will concentrate on the new application in SAS 9.3 of applying a shared frailty model.

Introducing a cluster-specific random effect (the frailty) into the model is a natural way to model dependence of clustered events and to account for within-cluster correlations.

Data has been collected on a products' survival time measured as time until sold. Products within the data can be naturally grouped/clustered by store. Please see website for data PRODUCTS.

Status     	0 = Discontinued
 		1 = Sold

Program Code

Proc format;
     value advert    	1 = "Advertising"
			0 = "No Advertising";

proc phreg data =Products;
	class Store Advertising;
	model Time*Status(0)= Advertising;
	random store;
	hazardratio 'Frailty Model Analysis' Advertising;
	format Advertising advert.;


The RANDOM statement identifies the variable used to represents the clusters. In this case, store. This cluster variable is also included on the CLASS statement.

Proc PHREG Random Statement image 1.2


The "Random Class Level Information" table displays the 50 stores in the data set. This can be suppressed by applying the NOCLPRINT option in the RANDOM statement.

Proc PHREG Random Statement image 2.2

Proc PHREG Random Statement image 3.2

The Store effect is not significant (p =0.1824, p > 0.05). Products advertised had 2.61 times the hazard of being sold compared to products not advertised.

NOTE: Results produced for both methods: Robust Sandwich estimate and Frailty Model will be identical.