As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Questionnaire Analysis in Clinical Trial Study

From sasCommunity
Jump to: navigation, search

Clinical Trail studies and Personal Health Care studies comprises various type of data and it analysis. When any protocol or SAP stats that questionnaire data need to be analyzed then it become most important thing for SAS Programmer to use proper method and Procedure. Normal Numeric data have enough category and calrity while questionnaire data don't have it. Even sometime data can't get into proper format. Let's have a short tips to choose a road for proper method.

First decide the data listing format because the questionnaire data have commonly includes subject's comments in that observations.

Desing it on paper and choose Proc Report or Proc Tabulate to present in output.

Be sure to use proper format like Yes | No or Male | Female.

Avoid using Proc Import if you have mixed format data and if you still need to use it then use GETNAMES very sharply to avoid truncation. Larger will get covered all data.

If your SAP stats to use common word from the Comments then Use SAS Functions like FIND, SCAN, SUBSTR.

Now if any numeric value or numeric formatted vaule then use Proc Means, Proc Univariate for basic stats. For better representation use output statement to save statistics in dataset and further use Proc Tabulate or Proc Report for ODS Output.

Within and Between Treatment analysis can also be done for questionnaire.

If questionnaire answer are in response format (2 or more then 2) then Chi-Square by using Proc Freq is the best way to get proper way.

Count using Proc SQL and Simple Frequency also helps to get proper result in most of questionnaire results.

McNemar test would be good option if response is in only 2 possibilities.

If you a questionnaire with Yes | No | None of them, then Trinomial Analysis is the best option.

For this analysis you have to go with few tricky but easy datastep.


Below are the few SAS Codes for the various questionnaire analysis.

**********************;
Chi-Square************;
**********************;

proc sort data=symbol;by treatment;run;

proc freq data=symbol;
  by treatment ;
  tables ques/ chisq testp=(0.5,0.5);
  title1 "Within - Treatment Analyses using Chi-Squared Statistics";
  title2 "For Treatment: #byval(Treatment)";
  format ques fres.;
run;

**********************;
McNemar***************;
**********************;

proc freq data=symbol;
  table Q1*Q2;
  exact mcnem;
run;

I have created one macro to generate the Trinomial Analysis.

**********************;
Trinomial*************;
**********************;

%macro trino_symbol(
     fname= ,   **data set name*;
     fout= ,    **out data set of proc freq*;
     var= ,     **variables name in table statement*;
     count= ,   **sql data set name*;
     fcout= ,   **second sql data set name*;
     cfout= );  **final output dataset name*;

     proc freq data = &fname noprint;
         table &var *treatment/ out = &fout; 
         where &var ne .;
     run;

     proc sql ;
         create table &count as select sum(COUNT) as cnt from &fout;
     quit;

     proc sql;
         create table &fcout as select * from &fout, &count;
     quit; 

     data &cfout;
         set &fcout;
         retain percent1 pct1 tot count1 percent2 pct2 count2;
         ord=1;
         if &var =1 then do;
             percent1=percent/100;
             count1=count;
             pct1=percent;
             tot=count;
         end;
         else if &var=2 then do;
             percent2=percent/100;
             count2=count;
             pct2=percent;
             tot=tot+count;
         end;
         else if &var=3 then do;
             percent3=percent/100;
             count3=count;
             pct3=percent;
             tot=tot+count;
             diff=pct2-pct1;
             stderr=sqrt((percent1+percent2)/(tot-1));
             z=(percent1-percent2)/stderr;
             pvalone=probnorm(abs(z));
             pval=2*(1-pvalone);
             end;
         run;

     %put "macro generated by Sanket Sinojia";
%mend trino_symbol;

--sanket sinojia 07:27, 12 January 2013 (EST)