Spider Plot

A recent question on SAS graphics communities page discussed the topic of ways to visualize the change from baseline for subjects in a study. The sample graph posted by user was a 3D ribbon plot shown below.

There are multiple limitations of the 3D depiction of the data in the above graph. It is not easy to compare the response of different subjects even though the data is likely sorted by the largest reduction in size. Also, the graph area is not used efficiently.

This data can be effectively visualized in a 2D visual called the “Spider Plot”. This is a good way of presenting the history of the Change from Baseline for tumors for subjects in a study by week.  The plot can be classified by response and stage.  

In a previous example posted on Graphically Speaking, I generated a data set to illustrate the process and results. Using the same data, I created a similar plot with a few updates.

This graph displays the change from baseline for all subjects in a study. Each curve represents one subject, and could be labeled with subject id if appropriate. The curve is colored to indicate response type and also labeled by stage. In this example, I have labeled each curve directly, instead of using a symbol and a legend. Whenever possible, direct labeling is easier to decode.

proc sgplot data=spider noborder;
format tgroup $growth.;
styleattrs datacontrastcolors=(green gold red) axisextent=data;
refline 0 / lineattrs=(pattern=shortdash);
series x=week y=change / group=subject grouplc=rgroup
groupmc=rgroup markers markerattrs=(symbol=circlefilled)
lineattrs=(thickness=2 pattern=solid) name=’a’;
text x=weekS y=change text=tgroup / position=right;
keylegend ‘a’ / title=’Response’ type=linecolor valueattrs=(size=7)
location=inside position=topright across=1 opaque;
keylegend ‘b’ / valueattrs=(size=7) noborder;
xaxis label=’Week’ offsetmax=0.2 grid;
yaxis values=(-80 to 80 by 20) grid display=(noline noticks);

I will add the full SAS program file once I figure out the allowed formats. In this version of WordPress, text files or zip files are not allowed.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: