BookmarkSubscribeRSS Feed
LarissaW
Obsidian | Level 7

I have two continuous variables and one category variable, so I use sgpanel to plot separated figures. I'd like to how I can add a P-value and parameter estimates to the figures. I tried the way I used in sgplot function but it didn't work. Below is what is in SAS errors, warnings, notes. Does anyone know a solution? 

 

PROC SGPANEL DATA=lab10;
74 format PREVCHD PREVCHD.;
75 PANELBY PREVCHD;
76 reg X = totchol Y = sysbp / cli clm markerattrs=(color=navy size=6 symbol=circle)
77 lineattrs=(color=red thickness=0.25) LEGENDLABEL="Regression Trendline";
78 colaxis label='Serum Total Cholesterol (mg/dL)' labelattrs=(color=black size=11pt)
79 valueattrs=(color=black size=9pt) values=(50 to 700 by 50);
80 rowaxis label='Systolic Blood Pressure (mmHg)'
81 labelattrs=(color=black size=11pt) valueattrs=(color=black size=9pt)
82 values=(50 to 300 by 25);
83 inset 'Intercept = &Int1' 'Slope = &Slope1' 'R-Square = &RSQ1' 'Adj R-Square = &ARSQ1' /
___________________
22
76
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, /, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.
ERROR 76-322: Syntax error, statement will be ignored.
84 border title='Parameter Estimates' position=topright textattrs=(color=black size=8pt);
85 TITLE height=11pt 'Serum Total Cholesterol by Systolic BP for Patients in different CHD Status';
86 RUN;

 

1 REPLY 1
ballardw
Super User

The SGPANEL Inset statement expects a VARIABLE, or multiple variables, to hold values to display in each panel and should hold the value(s) for the panel created for the PanelBy variable(s). This is one of the statements that behaves quite differently between Sgplot and Sgpanel.

If it is single set of text to display look at using an Annotate dataset.

 

BTW that text would not resolve correctly in Sgplot either. Macro variables need to be inside double quotes, not the single quotes you used.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 476 views
  • 0 likes
  • 2 in conversation