simple crossTab

Clinical Trial Attrition with Missing Data

Scénario de test & Cas d'usage

Business Context

In a clinical drug trial, some patients dropped out, resulting in missing values for the 'SideEffects' variable. The researchers must include these missing values in the analysis to determine if the occurrence of missing data is associated with a specific 'TreatmentGroup' (Placebo vs. Active).
Data Preparation

Generating trial data with missing values in SideEffects.

Copied!
1 
2DATA casuser.clinical;
3call streaminit(777);
4DO i=1 to 200;
5IF mod(i,2)=0 THEN Group='Placebo';
6ELSE Group='Active';
7r = rand('UNIFORM');
8IF r < 0.15 THEN SideEffects=' ';
9ELSE IF r < 0.6 THEN SideEffects='None';
10ELSE SideEffects='Nausea';
11OUTPUT;
12END;
13 
14RUN;
15 

Étapes de réalisation

1
Execute crossTab with includeMissing=true and association=true.
Copied!
1 
2PROC CAS;
3SIMPLE.crossTab / TABLE={name='clinical', caslib='casuser'} row='SideEffects' col='Group' includeMissing=true association=true;
4 
5RUN;
6 

Expected Result


The crosstab results must contain a row for missing 'SideEffects' (blank or dot). The 'Measures' table should be generated, providing statistics (like Cramer's V) to quantify the association between the treatment group and the side effects (including the missing ones).