141.COMPREHENSIVE ANALYSIS AND STATISTICAL EVALUATION OF CLINICAL TRIAL DATA INCLUDING DEMOGRAPHICS | TREATMENT RESPONSES | ADVERSE EVENTS AND CHRONIC CONDITIONS

COMPREHENSIVE ANALYSIS AND STATISTICAL EVALUATION OF CLINICAL TRIAL DATA INCLUDING DEMOGRAPHICS | TREATMENT RESPONSES | ADVERSE EVENTS AND CHRONIC CONDITIONS


 /* Step 1: Creating a Clinical Trial Dataset */

DATA Clinical_Trial_Data;

    LENGTH Patient_ID $10 Gender $6 Drug_Name $15 Adverse_Event $20;

    FORMAT Age 8. Drug_Dosage 8.1 Response_Score 8.2;

    DO i = 1 TO 10;

        Patient_ID = CAT('P', PUT(i, Z4.));

        Age = 18 + INT(RANUNI(1234)*62);

        /*Gender using IF-ELSE */

        IF INT(RANUNI(1234)*2) = 0 THEN Gender = 'Male';

        ELSE Gender = 'Female';

        

        /*Drug_Name using IF-ELSE*/

        IF INT(RANUNI(1234)*5) = 0 THEN Drug_Name = 'Drug_A';

        ELSE IF INT(RANUNI(1234)*5) = 1 THEN Drug_Name = 'Drug_B';

        ELSE IF INT(RANUNI(1234)*5) = 2 THEN Drug_Name = 'Drug_C';

        ELSE IF INT(RANUNI(1234)*5) = 3 THEN Drug_Name = 'Drug_D';

        ELSE Drug_Name = 'Drug_E';

        

        Drug_Dosage = 50 + INT(RANUNI(1234)*150); /* Dosage between 50mg and 200mg */

        Response_Score = ROUND(RANUNI(1234)*100, 0.1); /* Score from 0 to 100 */

        

        /*Adverse_Event using IF-ELSE*/

        IF INT(RANUNI(1234)*6) = 0 THEN Adverse_Event = 'None';

        ELSE IF INT(RANUNI(1234)*6) = 1 THEN Adverse_Event = 'Headache';

        ELSE IF INT(RANUNI(1234)*6) = 2 THEN Adverse_Event = 'Nausea';

        ELSE IF INT(RANUNI(1234)*6) = 3 THEN Adverse_Event = 'Dizziness';

        ELSE IF INT(RANUNI(1234)*6) = 4 THEN Adverse_Event = 'Fatigue';

        ELSE Adverse_Event = 'Insomnia';

        

        OUTPUT;

    END;

DROP i;

RUN;

PROC PRINT;RUN;


OUTPUT:

Obs Patient_ID Gender Drug_Name Adverse_Event Age Drug_Dosage Response_Score
1 P0001 Male Drug_E Insomnia 33 55.0 10.80
2 P0002 Female Drug_E Headache 74 126.0 28.40
3 P0003 Male Drug_C Dizziness 45 185.0 23.40
4 P0004 Female Drug_C Nausea 57 113.0 49.30
5 P0005 Female Drug_A Headache 29 97.0 96.60
6 P0006 Female Drug_E Fatigue 58 91.0 72.80
7 P0007 Male Drug_C Insomnia 38 74.0 83.00
8 P0008 Female Drug_B Insomnia 35 94.0 36.60
9 P0009 Female Drug_C Insomnia 20 51.0 94.20
10 P0010 Male Drug_D None 69 193.0 73.00


/* Step 2: Additional Patient Information */

DATA Clinical_Trial_Data;

   RETAIN Patient_ID Gender Drug_Name Adverse_Event Age Drug_Dosage Response_Score         BMI Smoker_Status;

    LENGTH Chronic_Condition $18;

    SET Clinical_Trial_Data;

    

    /*BMI generation */

    BMI = ROUND(18 + RANUNI(1234)*12, 1); /* BMI between 18 and 30 */

    

    /*Smoker_Status assignment using IF-ELSE */

    IF INT(RANUNI(1234)*2) = 0 THEN Smoker_Status = 'Non-Smoker';

    ELSE Smoker_Status = 'Smoker';

    

    /*Chronic_Condition assignment using IF-ELSE */

    IF INT(RANUNI(1234)*3) = 0 THEN Chronic_Condition = 'None';

    ELSE IF INT(RANUNI(1234)*3) = 1 THEN Chronic_Condition = 'Hypertension';

    ELSE Chronic_Condition = 'Diabetes';

RUN;

PROC PRINT;RUN;


OUTPUT:

Obs Patient_ID Gender Drug_Name Adverse_Event Age Drug_Dosage Response_Score BMI Smoker_Status Chronic_Condition
1 P0001 Male Drug_E Insomnia 33 55.0 10.80 21 Non-Smoker Diabetes
2 P0002 Female Drug_E Headache 74 126.0 28.40 21 Non-Smoker None
3 P0003 Male Drug_C Dizziness 45 185.0 23.40 19 Non-Smoker None
4 P0004 Female Drug_C Nausea 57 113.0 49.30 18 Non-Smoker None
5 P0005 Female Drug_A Headache 29 97.0 96.60 29 Smoker Hypertension
6 P0006 Female Drug_E Fatigue 58 91.0 72.80 22 Non-Smoker Diabetes
7 P0007 Male Drug_C Insomnia 38 74.0 83.00 22 Non-Smoker Diabetes
8 P0008 Female Drug_B Insomnia 35 94.0 36.60 27 Non-Smoker Diabetes
9 P0009 Female Drug_C Insomnia 20 51.0 94.20 21 Smoker None
10 P0010 Male Drug_D None 69 193.0 73.00 19 Smoker Diabetes


/* Step 3: Analyzing Data Using Various SAS Procedures */


/* Summary Statistics of Age, Drug Dosage, and Response Score */

PROC MEANS DATA=Clinical_Trial_Data N MEAN MEDIAN MIN MAX STDDEV;

    VAR Age Drug_Dosage Response_Score BMI;

RUN;


OUTPUT:

                                                                   The MEANS Procedure

Variable N Mean Median Minimum Maximum Std Dev
Age
Drug_Dosage
Response_Score
BMI
10
10
10
10
45.8000000
107.9000000
56.8100000
21.9000000
41.5000000
95.5000000
61.0500000
21.0000000
20.0000000
51.0000000
10.8000000
18.0000000
74.0000000
193.0000000
96.6000000
29.0000000
17.9431200
48.6745427
31.0735490
3.5103023


/* Frequency Distribution of Gender, Drug Name, and Adverse Events */

PROC FREQ DATA=Clinical_Trial_Data;

    TABLES Gender Adverse_Event Drug_Name Drug_Dosage Smoker_Status Chronic_Condition / NOCUM NOROW NOCOL;

RUN;


OUTPUT:

                                                                 The FREQ Procedure

Gender Frequency Percent
Female 6 60.00
Male 4 40.00


Adverse_Event Frequency Percent
Dizziness 1 10.00
Fatigue 1 10.00
Headache 2 20.00
Insomnia 4 40.00
Nausea 1 10.00
None 1 10.00


Drug_Name Frequency Percent
Drug_A 1 10.00
Drug_B 1 10.00
Drug_C 4 40.00
Drug_D 1 10.00
Drug_E 3 30.00


Drug_Dosage Frequency Percent
51.0 1 10.00
55.0 1 10.00
74.0 1 10.00
91.0 1 10.00
94.0 1 10.00
97.0 1 10.00
113.0 1 10.00
126.0 1 10.00
185.0 1 10.00
193.0 1 10.00


Smoker_Status Frequency Percent
Non-Smoker 7 70.00
Smoker 3 30.00


Chronic_Condition Frequency Percent
Diabetes 5 50.00
Hypertension 1 10.00
None 4 40.00


/* Crosstab Analysis of Smoking and Chronic Conditions */

PROC FREQ DATA=Clinical_Trial_Data;

    TABLES Smoker_Status*Chronic_Condition / CHISQ; 

RUN;


OUTPUT:

                                                                              The FREQ Procedure

Frequency
Percent
Row Pct
Col Pct
Table of Smoker_Status by Chronic_Condition
Smoker_Status Chronic_Condition
Diabetes Hypertension None Total
Non-Smoker
4
40.00
57.14
80.00
0
0.00
0.00
0.00
3
30.00
42.86
75.00
7
70.00
 
 
Smoker
1
10.00
33.33
20.00
1
10.00
33.33
100.00
1
10.00
33.33
25.00
3
30.00
 
 
Total
5
50.00
1
10.00
4
40.00
10
100.00



Statistics for Table of Smoker_Status by Chronic_Condition

Statistic DF Value Prob
Chi-Square 2 2.6190 0.2699
Likelihood Ratio Chi-Square 2 2.7146 0.2574
Mantel-Haenszel Chi-Square 1 0.0433 0.8351
Phi Coefficient   0.5118  
Contingency Coefficient   0.4556  
Cramer's V   0.5118  
WARNING: 100% of the cells have expected counts less
than 5. Chi-Square may not be a valid test.



Sample Size = 10


/* Generating a Detailed Report */

PROC REPORT DATA=Clinical_Trial_Data NOWD;

    COLUMNS Patient_ID Age Gender Drug_Name Drug_Dosage Response_Score Adverse_Event BMI Smoker_Status Chronic_Condition;

    DEFINE Patient_ID / DISPLAY 'Patient ID';

    DEFINE Age / ANALYSIS 'Age' MEAN;

    DEFINE Gender / GROUP 'Gender';

    DEFINE Drug_Name / GROUP 'Drug Name';

    DEFINE Drug_Dosage / ANALYSIS 'Dosage (mg)' MEAN;

    DEFINE Response_Score / ANALYSIS 'Response Score' MEAN;

    DEFINE Adverse_Event / GROUP 'Adverse Event';

    DEFINE BMI / ANALYSIS 'BMI' MEAN;

    DEFINE Smoker_Status / GROUP 'Smoking Status';

    DEFINE Chronic_Condition / GROUP 'Chronic Condition';

RUN;


OUTPUT:

Patient ID Age Gender Drug Name Dosage (mg) Response Score Adverse Event BMI Smoking Status Chronic Condition
P0005 29 Female Drug_A 97.0 96.60 Headache 29 Smoker Hypertension
P0008 35   Drug_B 94.0 36.60 Insomnia 27 Non-Smoker Diabetes
P0009 20   Drug_C 51.0 94.20 Insomnia 21 Smoker None
P0004 57     113.0 49.30 Nausea 18 Non-Smoker None
P0006 58   Drug_E 91.0 72.80 Fatigue 22 Non-Smoker Diabetes
P0002 74     126.0 28.40 Headache 21 Non-Smoker None
P0003 45 Male Drug_C 185.0 23.40 Dizziness 19 Non-Smoker None
P0007 38     74.0 83.00 Insomnia 22 Non-Smoker Diabetes
P0010 69   Drug_D 193.0 73.00 None 19 Smoker Diabetes
P0001 33   Drug_E 55.0 10.80 Insomnia 21 Non-Smoker Diabetes


/* Additional Analysis: Impact of Smoking on Response */

PROC TTEST DATA=Clinical_Trial_Data;

    CLASS Smoker_Status;

    VAR Response_Score;

    TITLE 'T-Test for Response Score by Smoking Status';

RUN;


OUTPUT:

                                        T-Test for Response Score by Smoking Status
                                                   The TTEST Procedure
 
                                               Variable: Response_Score

Smoker_Status N Mean Std Dev Std Err Minimum Maximum
Non-Smoker 7 43.4714 26.4616 10.0015 10.8000 83.0000
Smoker 3 87.9333 12.9882 7.4987 73.0000 96.6000
Diff (1-2)   -44.4619 23.8188 16.4365    


/* Predicting Response Score Using Multiple Factors */

PROC REG DATA=Clinical_Trial_Data;

    MODEL Response_Score = Age Drug_Dosage BMI;

    TITLE 'Multiple Regression Analysis';

RUN;


OUTPUT:

                                                       Multiple Regression Analysis
                                                          The REG Procedure
                                                            Model: MODEL1
                                               Dependent Variable: Response_Score

Number of Observations Read 10
Number of Observations Used 10


Analysis of Variance
Source DF Sum of
Squares
Mean
Square
F Value Pr > F
Model 3 953.72581 317.90860 0.25 0.8611
Error 6 7736.36319 1289.39387    
Corrected Total 9 8690.08900      


/* Response Score by Chronic Condition */

PROC MEANS DATA=Clinical_Trial_Data;

    CLASS Chronic_Condition;

    VAR Response_Score;

RUN;


OUTPUT:

                                                                   The MEANS Procedure

Analysis Variable : Response_Score
Chronic_Condition N Obs N Mean Std Dev Minimum Maximum
Diabetes 5 5 55.2400000 30.4825852 10.8000000 83.0000000
Hypertension 1 1 96.6000000 . 96.6000000 96.6000000
None 4 4 48.8250000 32.2631239 23.4000000 94.2000000


/* Identifying Patients with Severe Side Effects */

PROC SQL;

    SELECT Patient_ID, Drug_Name, Adverse_Event, Smoker_Status, Chronic_Condition

    FROM Clinical_Trial_Data

    WHERE Adverse_Event IN ('Dizziness', 'Fatigue', 'Insomnia')

    ORDER BY Drug_Name;

QUIT;


OUTPUT:

Patient_ID Drug_Name Adverse_Event Smoker_Status Chronic_Condition
P0008 Drug_B Insomnia Non-Smoker Diabetes
P0009 Drug_C Insomnia Smoker None
P0003 Drug_C Dizziness Non-Smoker None
P0007 Drug_C Insomnia Non-Smoker Diabetes
P0001 Drug_E Insomnia Non-Smoker Diabetes
P0006 Drug_E Fatigue Non-Smoker Diabetes


/* Scatter Plot: Age vs. Response Score */

PROC SGPLOT DATA=Clinical_Trial_Data;

    SCATTER X=Age Y=Response_Score / GROUP=Drug_Name;

    TITLE 'Scatter Plot of Age vs. Response Score by Drug';

RUN;


/* New Data Analysis for High Responders */

DATA High_Responders;

    SET Clinical_Trial_Data;

    IF Response_Score > 85;

RUN;

PROC PRINT DATA=High_Responders;

    TITLE 'Patients with High Response Scores';

RUN;


OUTPUT:        

                                                                 Patients with High Response Scores

Obs Patient_ID Gender Drug_Name Adverse_Event Age Drug_Dosage Response_Score BMI Smoker_Status Chronic_Condition
1 P0005 Female Drug_A Headache 29 97.0 96.60 29 Smoker Hypertension
2 P0009 Female Drug_C Insomnia 20 51.0 94.20 21 Smoker None


/* Final Analysis: Response by Drug and Age Group */

PROC MEANS DATA=Clinical_Trial_Data;

    CLASS Drug_Name Age Chronic_Condition;

    VAR Response_Score;

    TITLE 'Response Score by Drug, Age , and Chronic Condition';

RUN;


OUTPUT:

                                        Response Score by Drug, Age, and Chronic Condition

                                                             The MEANS Procedure

Analysis Variable : Response_Score
Drug_Name Age Chronic_Condition N Obs N Mean Std Dev Minimum Maximum
Drug_A 29 Hypertension 1 1 96.6000000 . 96.6000000 96.6000000
Drug_B 35 Diabetes 1 1 36.6000000 . 36.6000000 36.6000000
Drug_C 20 None 1 1 94.2000000 . 94.2000000 94.2000000
  38 Diabetes 1 1 83.0000000 . 83.0000000 83.0000000
  45 None 1 1 23.4000000 . 23.4000000 23.4000000
  57 None 1 1 49.3000000 . 49.3000000 49.3000000
Drug_D 69 Diabetes 1 1 73.0000000 . 73.0000000 73.0000000
Drug_E 33 Diabetes 1 1 10.8000000 . 10.8000000 10.8000000
  58 Diabetes 1 1 72.8000000 . 72.8000000 72.8000000
  74 None 1 1 28.4000000 . 28.4000000 28.4000000


PRACTICE AND COMMENT YOUR CODE: 

-->PLEASE FOLLOW OUR BLOG FOR MORE UPDATES.

TO FOLLOW OUR TELEGRAM CHANNEL CLICK HERE


Comments