Scénario de test & Cas d'usage
Creation of a simulated clinical trial dataset with 100 patients, including treatment group, age, sex, survival time, and censoring status.
| 1 | |
| 2 | DATA mycas.clinical_trial; |
| 3 | call streaminit(123); |
| 4 | DO i = 1 to 100; |
| 5 | Treatment = (rand('uniform') > 0.5); |
| 6 | Age = 50 + floor(rand('normal') * 10); |
| 7 | Sex = ifc(rand('uniform') > 0.5, 'M', 'F'); |
| 8 | LinearPred = 0.5 * Treatment + 0.02 * Age; |
| 9 | Time = rand('exponential') / exp(LinearPred); |
| 10 | IF Time > 20 THEN DO; |
| 11 | Time = 20; |
| 12 | STATUS = 0; |
| 13 | END; |
| 14 | ELSE STATUS = 1; |
| 15 | OUTPUT; |
| 16 | END; |
| 17 | |
| 18 | RUN; |
| 19 |
| 1 | |
| 2 | PROC CAS; |
| 3 | phreg.cox TABLE={name='clinical_trial'}, class={{vars={'Sex'}}}, model={depVars={{name='Time', event='Status(1)'}}, effects={{vars={'Treatment', 'Age', 'Sex'}}}}; |
| 4 | |
| 5 | RUN; |
| 6 |
| 1 | |
| 2 | PROC CAS; |
| 3 | phreg.cox TABLE={name='clinical_trial'}, class={{vars={'Sex'}}}, model={depVars={{name='Time', event='Status(1)'}}, effects={{vars={'Treatment', 'Age', 'Sex'}}}}, outputTables={names={'ParameterEstimates'}}; |
| 4 | |
| 5 | RUN; |
| 6 |
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).