BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ChristosK
Quartz | Level 8
proc template;
   define style mystyle;
   parent=styles.sasweb;
      class graphwalls / 
            frameborder=off;
      class graphbackground / 
            color=white;
   end;
run;

ods listing close;
ods html style=mystyle path='.' file='newgraph.html';
ods graphics / reset=all border=off width=580 height=800;
   
   proc sgplot data=glm_MAP2 nowall noborder  ;

      title 'Linear Regression Models with Parameter estimates and SD for MAP';
      styleattrs datacontrastcolors=(CX016381 CX1BC9FF CXFF7F00 CX814101  ) ;

refline "rMAP_Nexmean" "rMAP_LAmean" "rMAP_UAmean" "rMAP_LLmean"/ discretethickness=1 lineattrs=(color=pink) axis=y;
hbarparm category=IV  response= Param / group =DV groupdisplay =cluster  grouporder=data 
barwidth=0.4  clusterwidth=1   limitupper=SD_Param    ;

yaxis type=discrete discreteorder=data label =".";
xaxis label ="."; 
keylegend / position=bottom location=inside  position=bottomright  autoitemsize title='Time of Sampling' noborder ;  
yaxistable N rpIII  rParam rLCL 	rUCL ;
 run;

I also cant see the keylegend anymore, so have tried to adjust the size the image to no avail.

Might just have to transpose the images again. It should work either way.

Maybe its because Im still using SAS Studio?

DanH_sas
SAS Super FREQ

The REFLINES are not working because you changed the name if the category values. For example, "rMap_Nexmean" is now "mean Nex" in your new version. You need to change the corresponding values on the REFLINE statement.

 

As for the legend, it might have gotten dropped because it exceeded the LEGENDAREAMAX value. You can adjust the max value on the ODS GRAPHICS statement.

 

Thanks!
Dan

ChristosK
Quartz | Level 8

Names of variables haven't been changes, I just had run this formatting and label step.

Even before doffing this the pink bar wasn't there but I'll go back and recheck:

proc format;
value $IVfmt 
"rMAP_Nexmean" ="mean Nex"
"rMAP_LAmean"  ="mean LA"
"rMAP_UAmean"  ="mean UA"
"rMAP_LLmean"  ="mean LL"
"BI_Nex_MAP"   ="BI Nex"
"BI_LA_MAP"    ="BI LA"
"BI_UA_MAP"    ="BI UA"
"BI_LL_MAP"    ="BI LL"
"i3min_Nex_MAP" = "3min Nex"
"i3min_LA_MAP"  = "3min LA"
"i3min_UA_MAP"  = "3min UA"
"i3min_LL_MAP"  = "3min LL"
"i15min_Nex_MAP" = "15min Nex"
"i15min_LA_MAP"  = "15min LA"
"i15min_UA_MAP"  = "15min UA"
"i15min_LL_MAP"  = "15min LL"
"i30min_Nex_MAP" = "30min Nex"
"i30min_LA_MAP"  = "30min LA"
"i30min_UA_MAP"  = "30min UA"
"i30min_LL_MAP"  = "30min LL"
"i45min_Nex_MAP" = "45min Nex"
"i45min_LA_MAP"  = "45min LA"
"i45min_UA_MAP"  = "45min UA"
"i45min_LL_MAP"  = "45min LL"
"p3min_Nex_MAP" = "pI 3min Nex"
"p3min_LA_MAP"  = "pI 3min LA"
"p3min_UA_MAP"  = "pI 3min UA"
"p3min_LL_MAP"  = "pI 3min LL"
;
value $DVfmt
"rMAP_Amean"	= "mean"
"BI_A_MAP"      = "BI"
"i3min_A_MAP"   = "3min"
"i15min_A_MAP"  = "15min"
"i30min_A_MAP"  = "30min"
"i45min_A_MAP"  = "45min"
"p3min_A_MAP"   = "pI 3min"
;

label N ="n" rpIII= "p value"  rParam= Estimate"" rLCL= "LCL" 	rUCL= "UCL";
;
run; 

data glm_MAP2;
set glm_MAP1;
format IV $IVfmt. DV $DVfmt.;
run;
DanH_sas
SAS Super FREQ

The string for the REFLINE must be the formatted axis value.

ChristosK
Quartz | Level 8

Yup, it looks like what actually appears on the axis label counts post formatting is what it goes by.

 

 

Instead of  LEGENDAREAMAX, I put :  maxlegendarea=45 and a bunch of other numbers as below, and I switched the keylegend to the outside:

ods listing close;
ods html style=mystyle path='.' file='newgraph.html';
ods graphics / reset=all border=off width=600 height=800  maxlegendarea=45 ;
   
   proc sgplot data=glm_MAP2 nowall noborder  ;

      title 'Linear Regression Models with Parameter estimates and SD for MAP';
      styleattrs datacontrastcolors=(CX016381 CX1BC9FF CXFF7F00 CX814101  ) ;

refline "mean Nex" "mean LA" "mean UA" "mean LL"/ discretethickness=1 lineattrs=(color=pink) axis=y;
hbarparm category=IV  response= Param / group =DV groupdisplay =cluster  grouporder=data 
barwidth=0.4  clusterwidth=1   limitupper=SD_Param    ;

yaxis type=discrete discreteorder=data label =".";
xaxis label ="."; 
keylegend / position=bottom location=outside  position=bottomright  autoitemsize title='Time of Sampling' noborder ;  
yaxistable N rpIII  rParam rLCL 	rUCL ;
 run;

Am getting this error:

 
 NOTE: PROCEDURE SGPLOT used (Total process time):
       real time           0.50 seconds
       cpu time            0.25 seconds
       
 WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
 WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
 WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
 NOTE: There were 28 observations read from the data set USER.GLM_MAP2.
 
 93         
 94         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 107        

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 19 replies
  • 2798 views
  • 6 likes
  • 2 in conversation