Sgpanel : suppression line

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Sgpanel : suppression line

Hello ! I am Theophane, I do an internship in SAS GRAPH. I have a problem with SGPANEL. I have data of people who have different treatments and cancer. I have to make a sgpanel for each dose which represents the number of different cancers. I have to put the allpatient first order for Y is maintained. For this I have a variable 0, A, .. that manages the order of graphs. I would like to delete the first row of each graph but I do not succeed. Or that there are 0, A, B .. Could anyone help me? Thank you!

ods graphics on / border=off height=20cm width=22cm;
proc sgpanel data=all5;
     panelby variable ID_PAT/ novarname BORDER ROWS=2 columns=2;
         hbar &var_4c / response = frequence1 BARWIDTH=.6 DATASKIN=GLOSS;
             ROWaxis type = discrete  discreteorder = data display=(nolabel NOTICKS NOLINE )VALUESHINT  ;
                 colaxis min=0 max=100  label = "Percent (%)" ;
             refline 0 20 40 60 80 100/axis=x  ;
    *format variable $lettres.;
run;
quit;

ods graphics off;

variable : 0,A,B, ..

frequence1 : the response

ID_PAT is the treatment with the (#number)


Accepted Solutions
Solution
‎04-25-2013 11:04 AM
Super Contributor
Posts: 543

Re: Sgpanel : suppression line

Posted in reply to Théophane

What if instead of using a panel by variable ID_Pat you use a format

For example:

proc format;

     value $ var "0" = "All Patients(whatever else you have in there, I can't see)"

                    "A" = "30 mg (.....)"

                    "B" = "60 mg(....)"

                    "C" = "90 mg....(   )"

;

quit;

THEN

ods graphics on / border=off height=20cm width=22cm;
proc sgpanel data=all5;
     panelby variable/ novarname BORDER ROWS=2 columns=2;
         hbar &var_4c / response = frequence1 BARWIDTH=.6 DATASKIN=GLOSS;
             ROWaxis type = discrete  discreteorder = data display=(nolabel NOTICKS NOLINE )VALUESHINT  ;
                 colaxis min=0 max=100  label = "Percent (%)" ;
             refline 0 20 40 60 80 100/axis=x  ;
   format variable $var..;
run;
quit;

ods graphics off;

View solution in original post


All Replies
Super Contributor
Posts: 543

Re: Sgpanel : suppression line

Posted in reply to Théophane

Hi.

What happens when you remove the 'variable' from your panelby statement:

ods graphics on / border=off height=20cm width=22cm;
proc sgpanel data=all5;
     panelby variable ID_PAT/ novarname BORDER ROWS=2 columns=2;
         hbar &var_4c / response = frequence1 BARWIDTH=.6 DATASKIN=GLOSS;
             ROWaxis type = discrete  discreteorder = data display=(nolabel NOTICKS NOLINE )VALUESHINT  ;
                 colaxis min=0 max=100  label = "Percent (%)" ;
             refline 0 20 40 60 80 100/axis=x  ;
    *format variable $lettres.;
run;
quit;

ods graphics off;

Occasional Contributor
Posts: 9

Re: Sgpanel : suppression line

Posted in reply to AncaTilea

If I remove the 'variable' from my panelby statement my graphics are in the alphabetic order and the cancer are not in the good order (The most present in allpatient in first and in decreasing order) .. so it's important

Super User
Posts: 11,343

Re: Sgpanel : suppression line

Posted in reply to Théophane

To remove the observations with specific values the easiest is probably a WHERE clause as a data set option;

proc sgpanel data=all5 (where=(&var_4c ne <value to suppress>)); Where the value to suppress matches the variable type. Or you can use variable not in (list of explicit values).

Solution
‎04-25-2013 11:04 AM
Super Contributor
Posts: 543

Re: Sgpanel : suppression line

Posted in reply to Théophane

What if instead of using a panel by variable ID_Pat you use a format

For example:

proc format;

     value $ var "0" = "All Patients(whatever else you have in there, I can't see)"

                    "A" = "30 mg (.....)"

                    "B" = "60 mg(....)"

                    "C" = "90 mg....(   )"

;

quit;

THEN

ods graphics on / border=off height=20cm width=22cm;
proc sgpanel data=all5;
     panelby variable/ novarname BORDER ROWS=2 columns=2;
         hbar &var_4c / response = frequence1 BARWIDTH=.6 DATASKIN=GLOSS;
             ROWaxis type = discrete  discreteorder = data display=(nolabel NOTICKS NOLINE )VALUESHINT  ;
                 colaxis min=0 max=100  label = "Percent (%)" ;
             refline 0 20 40 60 80 100/axis=x  ;
   format variable $var..;
run;
quit;

ods graphics off;

Occasional Contributor
Posts: 9

Re: Sgpanel : suppression line

Posted in reply to AncaTilea

Yes I found the solution yesterday evening and it's with the utilisaton of format !

Thank you very much for your responses !

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 297 views
  • 1 like
  • 3 in conversation