Solved
New Contributor
Posts: 2

# Plot for comaring two variable- Large data

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;

Accepted Solutions
Solution
‎09-25-2017 05:10 AM
SAS Super FREQ
Posts: 4,124

## Re: Plot for comaring two variable- Large data

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.

All Replies
Super User
Posts: 9,227

## Re: Plot for comaring two variable- Large data

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.

Solution
‎09-25-2017 05:10 AM
SAS Super FREQ
Posts: 4,124

## Re: Plot for comaring two variable- Large data

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.

SAS Super FREQ
Posts: 1,048

## Re: Plot for comaring two variable- Large data

[ Edited ]

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

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

☑ This topic is solved.