## Plotting 3 variables on one graph

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

melburnian
Posts: 2
Joined: Tue Aug 07, 2012 11:52 pm

### Plotting 3 variables on one graph

Hi,

I'm fairly new to SPSS, and have been stuck on a problem that is driving me nuts.

Basically, I have conducted an experiment that and obtained two measurements from different devices at the same time. I am trying to show they correlate with each other.

We conducted this experiment in two positions (call it position A and B), and there was two phases of each experiment (phase 1 and 2).

So all up, both methods was measured in A1, A2, then B1 and B2.

I have managed to plot these on scatterplots, and get regression equations and correlations of each combination individually. What I would like to have is a graph that shows A1 and B1, their regression lines, and also the regression line if you combine the variable, so position C.

Any help with this would be appreciated.

Cheers,

Cas
Penguin_Knight
Posts: 473
Joined: Thu Apr 05, 2012 5:58 pm

### Re: Plotting 3 variables on one graph

1) What are on the x and y axes of the scatterplot?

2) How is your data structured? Aka, what are the variables and what are they?
melburnian
Posts: 2
Joined: Tue Aug 07, 2012 11:52 pm

### Re: Plotting 3 variables on one graph

The two axes are:
x-axis (DeltaTHI/s) - measured with device #1.
y-axis (deltaVol/s) - measured with device #2.

My data file is set up so that there are four columns of data; each row represents a subject, and each subject has data information for all columns (except where there is missing data of course).
PositionA Phase1+2 Device #1; Position A Phase 1+2 Device #2; Position B Phase1+2 Device #1; Position B Phase 1+2 Device #2.
There is also another column that contains nominal data and describes the phase of each measurements 1 or 2.

I have managed to plot these on an overlay scatterplot, with the regression lines. But it won't recognise the 'label cases by' 'nominal data column' when I plot the graph.

I would like to have measurements at phase 1 represented by a different symbol than phase 2, and the different position A + B represented by colours. I have been able to do this if I combined all the data into two columns (for device #1 and #2), but then I can only obtain the regression line for the combined data set.

I have also determined that obtaining the regression line for the combined dataset (combining position A&B and phase 1&2) is meaningless, as it would represent data obtained a position halfway between A and B.

Thanks for any help.
Penguin_Knight
Posts: 473
Joined: Thu Apr 05, 2012 5:58 pm

### Re: Plotting 3 variables on one graph

melburnian wrote: I would like to have measurements at phase 1 represented by a different symbol than phase 2, and the different position A + B represented by colours. I have been able to do this if I combined all the data into two columns (for device #1 and #2), but then I can only obtain the regression line for the combined data set.
In order to do that your data would need to be in "long format":

One variable will be phase number
One variable will be position
And other variables such as your deltathi and deltavol, which from what I guess are taken by device 1 and 2?

When you plot it, put the variable into x and y axis respectively, and the put "phase" into symbol, and position into "color".

### Who is online

Users browsing this forum: No registered users and 1 guest