BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
statsas
Fluorite | Level 6

Dear All,

I'm using sgpanel procedure of SAS 9.4 to get a graph.

I have 2 days (1 and 29) and 3 trt (TRT A, TRT B and Placebo).

my sas code used :

PROC FORMAT ;
   VALUE dy  1    = '1 '
             29='29'
             OTHER =' ';
  value trtn 1="TRT A"
             2="TRT B"
             3='Placebo';
RUN;

PROC SGPANEL DATA=try noautolegend pad=( bottom=10%);
  title "TITLE 1";

  FORMAT trtgpn trtn.;
  PANELBY TRTGPN   / columns=3 LAYOUT=COLUMNLATTICE  sparse SPACING=3 
                    headerattrs=GraphUnicodeText novarname  colheaderpos=top uniscale=all;;

  HIGHLOW y=emn low=lo high=hi/lineattrs=(thickness=1.7 color=black) type=line ;
  HIGHLOW x=vis low=lclm high=uclm/lineattrs=(thickness=1.7 color=blue) type=line LOWCAP=SERIF HIGHCAP=SERIF;  
  SCATTER X=xc Y=yc/ markerchar=nbc MARKERCHARATTRS=(size=7 color=black )  ; 
  SCATTER X=vis Y=ratio/jitter jitterwidth=0.50 markerattrs=(size=8 color=VLIGB symbol=circle ) ;
 
 


  COLAXIS label=' ' TICKVALUEFORMAT=dy.  values=( 1 29 ) INTEGER ;
  ROWAXIS type=log logbase=2 grid display=(nolabel) ;

  COLAXISTABLE emnx / x=vis valueattrs=(color=blue)labelattrs=(color=blue size=7) label="GM Increase" SEPARATOR;
  COLAXISTABLE perc / x=vis valueattrs=(color=green) labelattrs=(color=green size=7)
                      label= "% (*ESC*){unicode '2265'x} 2fold inc";
RUN;

my probelem is with option Jitter that not work for day 29  (on day 29 i don't have any jittering point) but in my graph i have results of day 29 scatter around 29!!! see results bellow :

SGPanel34.png

 

other problem : the line presenting high low points (in blue)  is cutted in some point !! and the line (in black) representing mean of day 1 are behind scatter points!!

 

 

 

Thanks in advance for your help.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Making colaxis a type=discrete axis would probably help

 

data g;
set sashelp.class;
grp = rand("uniform") < 0.5;
if grp then do;
    mid=12; low=11; high=13; end;
else do;
    mid=12; low=10; high=14; end;
run;

proc sgpanel data=g noautolegend;
panelby sex / rows=1;
scatter x=grp y=mid / 
    yerrorlower=low yerrorupper=high errorbarattrs=(thickness=2 color=blue);
scatter x=grp y=mid / markerattrs=(symbol=Plus size=30 color=blue);
scatter x=grp y=age / jitter;
colaxis type=discrete;
run;

SGPanel7.png

PG

View solution in original post

2 REPLIES 2
PGStats
Opal | Level 21

Making colaxis a type=discrete axis would probably help

 

data g;
set sashelp.class;
grp = rand("uniform") < 0.5;
if grp then do;
    mid=12; low=11; high=13; end;
else do;
    mid=12; low=10; high=14; end;
run;

proc sgpanel data=g noautolegend;
panelby sex / rows=1;
scatter x=grp y=mid / 
    yerrorlower=low yerrorupper=high errorbarattrs=(thickness=2 color=blue);
scatter x=grp y=mid / markerattrs=(symbol=Plus size=30 color=blue);
scatter x=grp y=age / jitter;
colaxis type=discrete;
run;

SGPanel7.png

PG
statsas
Fluorite | Level 6

Thanks PGstats..it works.

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1930 views
  • 0 likes
  • 2 in conversation