Proc Report Count by Groups and Across

Reply
N/A
Posts: 1

Proc Report Count by Groups and Across

Hello:

I am trying to develop a program that can count the number of patients in cohorts, treatment arms, and their dispositions and display them into a table like this:

Patient Status                          Reason for Treatment Discontinuation                Cohort A             Cohort B         Arm 1    Arm 2          Arm 3        Total

Continued                                                                                                             n                      n                     n          n                 n              n

Discontinued                                                                                                       n                       n                        n          n             n                 n

                                                         Adverse Event                                           n                        n                         n

                                                          Patient Death

                                                                 etc

I am trying to do this without using proc freq or a whole lot of formatting as I intend to write  a macro for later use to kind of streamline this process.

The code I am using so far looks like this:

data flagset1;

  set merge1;

  if eotdecod^=' ' then do

  status='Patients Discontinued Treatment';

  output;

  end;

  if eotdecod=' ' then do

   status='Patients on Treatment';

  output;

  end;

  if ieyn='Y' then do

  col='Enrolled';

  output;

  end;

  if cohort='Cohort A' then do

  col='Cohort A';

  output;

  end;

  if cohort='Cohort B' then do

  col='Cohort B';

  output;

  end;

  if armcd='ARM 1 ' then do

  col='Arm 1';

  output;

  end;

  if armcd='ARM 2' then do

  col='Arm 2';

  output;

  end;

  if armcd='ARM 3' then do

  col='Arm 3';

  output;

  end;

run;

proc report data=flagset1

  spacing=5

  nowindows

  headline

  split='|';

  columns  status eotdecod col;

  define status / group left;

 

  define eotdecod / group left;

  define col / across center ;

Essentially my problem is that the columns, while producing the right numbers, will not display properly in proc report. I get something like this:

Patients Discontinued Treatment

Adverse Event

3

.

.

2

.

3

Disease Progression per CHESON/HALLEK

1

1

.

.

1

2

Subject Death

1

.

.

1

.

1

Voluntary Withdrawal

2

.

1

.

1

3

ZPatient is going to transplant

1

.

.

.

.

1

ZPatient removed from study per protocol for not dosing for more th

1

.

.

.

.

1

ZPt went on to Allogeneic transplant

.

1

.

1

.

1

but if I delete the eotdecod variable I get

Patients Discontinued Treatment

9

2

1

4

2

12

Patients on Treatment

13

4

1

8

4

18

So I know that the dataset has the right values in it.

So why won't proc report throw out both the totals of people discontinued and on tmt as well as the subset of the reasons for why the ones are discontinued?

Post a Question
Discussion Stats
  • 0 replies
  • 2306 views
  • 0 likes
  • 1 in conversation