Saturday, June 27, 2009

Spaghetti Plot



The first time when I used the term "Spaghetti" was for one of the pharmacokinetic studies where I would like to see the time-concentration curves for all individuals plotted on the same panel. The figure on the right side is an example of a Spaghetti plot from simulated data.

I don't think there is any formal definition for Spaghetti Plot, but this term refers to the plot for visualizing the trajectories for all individual subjects. The name “spaghetti plot” is called because it looks a bit like spaghetti noodles thrown on a wall.



The funny thing is that one time when I used the term 'spaghetti plot', I was asked not to use this term since it sounded like 'not formal'. Instead of using 'spaghetti plot', I had to change it to 'indivudual plots' or something like that. As a matter of fact, this term is actually used pretty often in pharmacokinetic studies and also in longitudinal studies.

In longitudinal studies, the spaghetti plot is used to visualize the trajectories or patterns or time trends. The spaghetti plot is typically used in the situation that the # of subjects is not too large and is generated for each group (if there is two treatment groups, there will be one spaghetti plot for each treatment group).

Spaghetti plot can be easily generated by software such as R and SAS. In SAS, the following statement can be used:

symbol1 value = circle color = black interpol = join repeat = 5;
proc gplot;
plot y*time = id / nolegend;
run;

Where y is the desired variable we would like to visualize; time is the time or visit; id is the subject #.

Some further readings:
1. UCLA: How can I visualize longitudinal data in SAS?
2. A oral contraceptive drug interaction study
3. A lecture notes by derived variable summaries
4. Quantitative Methods for Tracking Cognitive Change 3 Years After CABG

3 comments:

jd said...

some texts call them profile plots. eg, see page 33 of modeling longitudinal data by robert weiss.

but i prefer spaghetti plots. :)

Anonymous said...

Thank you so much for this discussion... It seems like a "simple" point, but I needed a little background "validation" for this term, and this helped a lot.

Web blog from Dr. Deng said...

in clinical trial, the term 'validation' is typically referring to 'indepedent validation' that will have a second person to independently verify if the data or statistical outputs generated is accurate.