Horizontal panel for scatterplots?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Horizontal panel for scatterplots?

nina
Dear all,

I would like to produce a panel plot of three scatterplots; these
scatterplots should be arranged horizontally.

The problem is that while there is a common variable for the y-axis
(‘dep_var’) there are three separated independent variables ('ind_var1',
'ind_var_2', 'ind_var3'). So unlike the standard situation where the
relation between y and x is grouped by a single categorical variable, in my
situation I have three separate scatterplots.

Is it still possible to arrange them using syntax in a horizontal output?

Many thanks for your suggestions -
N.



--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Horizontal panel for scatterplots?

PRogman
You need to create the "standard situation". Reformat data to long format and
use the index to split the ind_vars to panels.
HTH, PR

*Demo data.
DATA LIST list /
id iv1 iv2 iv3 dp (5F8.1).
BEGIN DATA
1   1   2   1   1  
2   2   1   3   2
3   3   3   2   3
END DATA.

*don't play with main dataset.
DATASET COPY Test.
DATASET ACTIVATE Test.
*keep relevant vars.
MATCH FILES
  File *
  /KEEP  dp iv1 iv2 iv3
.
*to long format.
VARSTOCASES
  /MAKE  iv FROM iv1 iv2 iv3
  /INDEX p 'Panel' (3)
.
*Name the panels.
VALUE LABELS p  1'iv1'  2'iv2'  3'iv3'.
* Do GGRAPH with iv and dp with p as panel varaiable.
GGRAPH
  /GRAPHDATASET
   NAME="graphdataset"
   VARIABLES= iv dp p
   MISSING=LISTWISE
   REPORTMISSING=NO
  /GRAPHSPEC
   SOURCE=INLINE.
BEGIN GPL
  SOURCE:  s=userSource(id("graphdataset"))
  DATA:    iv=col(source(s), name("iv"))
  DATA:    dp=col(source(s), name("dp"))
  DATA:    p=col(source(s), name("p"), unit.category())
  GUIDE:   axis(dim(1), label("iv"))
  GUIDE:   axis(dim(2), label("dp"))
  GUIDE:   axis(dim(3), label("Panel"), opposite())
  SCALE:   cat(dim(3), include("1", "2", "3"))
  ELEMENT: line(position(iv*dp*p), missing.wings())
END GPL.
*clean up.
DATASET CLOSE Test.



nina wrote

> Dear all,
>
> I would like to produce a panel plot of three scatterplots; these
> scatterplots should be arranged horizontally.
>
> The problem is that while there is a common variable for the y-axis
> (‘dep_var’) there are three separated independent variables ('ind_var1',
> 'ind_var_2', 'ind_var3'). So unlike the standard situation where the
> relation between y and x is grouped by a single categorical variable, in
> my
> situation I have three separate scatterplots.
>
> Is it still possible to arrange them using syntax in a horizontal output?
>
> Many thanks for your suggestions -
> N.
>
>
>
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD





--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Horizontal panel for scatterplots?

Jon Peck
In reply to this post by nina
The STATS REGRESS PLOT extension command, which can be installed from the Extensions > Extension Hub menu if not already present, can do horizontally arranged plots of a continuous y variable against a number of continuous or categorical variables.  For categorical X variables, the charts can be bar charts, line charts, or boxplots.  A scatterplot would be dubious as it implies a continuous X axis.  There is a single Y axis across the charts for each horizontal set.

You can control the size of each panel and other aspects.

The command generates and executes GGRAPH/GPL syntax to carry out the plots.

On Tue, Nov 27, 2018 at 12:17 AM nina <[hidden email]> wrote:
Dear all,

I would like to produce a panel plot of three scatterplots; these
scatterplots should be arranged horizontally.

The problem is that while there is a common variable for the y-axis
(‘dep_var’) there are three separated independent variables ('ind_var1',
'ind_var_2', 'ind_var3'). So unlike the standard situation where the
relation between y and x is grouped by a single categorical variable, in my
situation I have three separate scatterplots.

Is it still possible to arrange them using syntax in a horizontal output?

Many thanks for your suggestions -
N.



--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD


--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD