phreg cox

Standard Survival Analysis for Clinical Drug Trial

Scénario de test & Cas d'usage

Business Context

A pharmaceutical company is conducting a clinical trial to evaluate the efficacy of a new drug compared to a placebo. The goal is to analyze the survival time of patients and determine if the treatment significantly reduces the hazard of the event (death), adjusting for age and gender.
Data Preparation

Creation of a simulated clinical trial dataset with 100 patients, including treatment group, age, sex, survival time, and censoring status.

Copied!
1 
2DATA mycas.clinical_trial;
3call streaminit(123);
4DO i = 1 to 100;
5Treatment = (rand('uniform') > 0.5);
6Age = 50 + floor(rand('normal') * 10);
7Sex = ifc(rand('uniform') > 0.5, 'M', 'F');
8LinearPred = 0.5 * Treatment + 0.02 * Age;
9Time = rand('exponential') / exp(LinearPred);
10IF Time > 20 THEN DO;
11Time = 20;
12STATUS = 0;
13END;
14ELSE STATUS = 1;
15OUTPUT;
16END;
17 
18RUN;
19 

Étapes de réalisation

1
Fit a basic Cox proportional hazards model.
Copied!
1 
2PROC CAS;
3phreg.cox TABLE={name='clinical_trial'}, class={{vars={'Sex'}}}, model={depVars={{name='Time', event='Status(1)'}}, effects={{vars={'Treatment', 'Age', 'Sex'}}}};
4 
5RUN;
6 
2
Request Hazard Ratios to interpret the treatment effect.
Copied!
1 
2PROC CAS;
3phreg.cox TABLE={name='clinical_trial'}, class={{vars={'Sex'}}}, model={depVars={{name='Time', event='Status(1)'}}, effects={{vars={'Treatment', 'Age', 'Sex'}}}}, outputTables={names={'ParameterEstimates'}};
4 
5RUN;
6 

Expected Result


The action should successfully fit the model and return the 'ParameterEstimates' table. This table will show the coefficients and hazard ratios for Treatment, Age, and Sex, allowing the researchers to see if the Treatment effect is statistically significant (p-value < 0.05).