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

Hi All,

 

I want to draw a plot which can help me compare two variables , the issue is I have around 1 million rows due to which I am not able to use Line plot.

Code used

proc gplot data=Data_name;

plot (y1 y2)*xavr / overlay legend=legend1

haxis=axis1 vaxis=axis2;

run;

quit;

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

If you are trying to identify where the variables are most different, a scatter plot of y1 vs y2 would do it, since they are evaluated at the same time points. Use semitransparent markers to reduce overplotting. 

 

proc sgplot data=Data_name;
scatter x=y1 y=y2 / transparency=0.8;
run;

If you need to visualize the XVAR information, you can use the COLORRESPONSE=XVAR option.

View solution in original post

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Is plotting 1m records the best way to cmopare some data?  I wouldn't think so.  Think of a piece of paper, then put 1m dots on that piece of paper, would you fit them all on, no, not even close.  I would think there are better methods, e.g. distinct lists of values, proc compare by variables, excluding the sam values etc.

Rick_SAS
SAS Super FREQ

If you are trying to identify where the variables are most different, a scatter plot of y1 vs y2 would do it, since they are evaluated at the same time points. Use semitransparent markers to reduce overplotting. 

 

proc sgplot data=Data_name;
scatter x=y1 y=y2 / transparency=0.8;
run;

If you need to visualize the XVAR information, you can use the COLORRESPONSE=XVAR option.

DanH_sas
SAS Super FREQ

Rick's approach might also be interesting to see as a heatmap:

 

proc sgplot data=bigdata;
heatmap x=y1 y=y2;
run;

 

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1466 views
  • 4 likes
  • 4 in conversation