Data visualization with SAS programming

Why can't I add one Seriesplot in the LAYOUT prototype?

Reply
Frequent Contributor
Posts: 88

Why can't I add one Seriesplot in the LAYOUT prototype?

Dear All,

 

I just defined one template aims to create one histogram change with group.

 

I wanted to add another seriesplot to connect the different bars over time for each group. However, when I tried added the SERIESPLOT in the layout prototype, and then run, there was always  a WARNING:

WARNING: The scatterplot statement will not be drawn because one or more of the required arguments were not supplied.

So could you guide me why this happen? And how should I do to reach my aim.

 

Many thanks,

Jack


*******Pot the frequency data by country, visit and the category;
PROC TEMPLATE;
   define statgraph freq_hist;
   begingraph/designwidth=20in designheight=10in;
   dynamic _x _y _title _footnote _rowvar _columnvar _group;
   entrytitle _title;
   entryfootnote _footnote;
   
   layout datalattice ROWVAR=_rowvar columnvar=_columnvar/rows=2 backgroundcolor=aliceblue border=FALSE headerbackgroundcolor=lightblue                                                      
                                                      columnaxisopts=(display=(ticks tickvalues label) griddisplay=ON label="Visit (month)")
                                                      rowaxisopts=(display=(ticks tickvalues label) griddisplay=ON label="Frquency")
													  skipemptycells=TRUE
                                                     cellwidthmin=80;
       layout prototype;
          barchart category=_x Response=_y/group=_group groupdisplay=CLUSTER includemissinggroup=TRUE 
                                            barlabel=TRUE barlabelfitpolicy=NONE barlabelattrs=(color=gray) name="barchart" legendlabel="BCVA Score";
          seriesplot x=_x y=_y/group=_group groupdisplay=CLUSTER ; 
		 **scatterplot x=_x y=_y/group=_group groupdisplay=CLUSTER jitter=AUTO;
	    endlayout;

        sidebar;
         discretelegend "barchart"/backgroundcolor=lightcyan border=TRUE location=INSIDE title="BCVA SCORE";
		endsidebar;

  endlayout;
  endgraph;
end;
run;

 proc sgrender data=VA_country(where=(missing(BCVASCOR1N)=0)) template=freq_hist;
    dynamic _x="VIS2N" _y="COUNT" _label="Frequency plot of the different scores over Visit" _footnote="Test with categorical data illustration.sas"
	        _rowvar="COU1A" _columnvar="EVLEYE1C" _group="BCVASCOR1N"
			;
	format vis2n VIS_month. COU1A $country.;
run;

Example.png
SAS Super FREQ
Posts: 1,171

Re: Why can't I add one Seriesplot in the LAYOUT prototype?

It is easier to help if you attach full code WITH associated data and any macro variables.  The data can be faked to preserve confidentiality, as long as the program runs.  Clearly, as per log, some data is not as expected.  Also please always include the SAS version you are using.  

 

Any reason you are not using SGPANEL?

 

Use "  sidebar / spacefill=false;  " to shrink legend width.

Frequent Contributor
Posts: 88

Re: Why can't I add one Seriesplot in the LAYOUT prototype?

Posted in reply to Sanjay_SAS

Dear Sanjay,

 

Sure, thanks for your suggestion. The version I am using is SAS 9.4 server version.

 

I will take a try on your proposal. Many thanks.

 

Jack.

Ask a Question
Discussion stats
  • 2 replies
  • 364 views
  • 0 likes
  • 2 in conversation