graphing question

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

graphing question

Maguin, Eugene
I can do a scatterplot matrix type of plot. (how) can I add the regression line for each plot? I tried this:

ELEMENT: point(position((Proficnt/"Proficnt"+Rigid/"Rigid"+
   Resist/"Resist")*(ClientsAvg/"ClientsAvg"+HoldsAvg/"HoldsAvg")))
 ELEMENT: line(position(smooth.linear(Proficnt*ClientsAvg)))

The message back was 'elements within the same graph must share the same faceting structure'.

I'm not too surprised I got the message. It seems like it might work if the faceting business could be specified. Suggestions, please.

Thank you, Gene Maguin

=====================
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: graphing question

ViAnn Beadle
Try the same algebra used in the first ELEMENT.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Maguin, Eugene
Sent: Monday, October 29, 2012 2:50 PM
To: [hidden email]
Subject: graphing question

I can do a scatterplot matrix type of plot. (how) can I add the regression
line for each plot? I tried this:

ELEMENT: point(position((Proficnt/"Proficnt"+Rigid/"Rigid"+
   Resist/"Resist")*(ClientsAvg/"ClientsAvg"+HoldsAvg/"HoldsAvg")))
 ELEMENT: line(position(smooth.linear(Proficnt*ClientsAvg)))

The message back was 'elements within the same graph must share the same
faceting structure'.

I'm not too surprised I got the message. It seems like it might work if the
faceting business could be specified. Suggestions, please.

Thank you, Gene Maguin

=====================
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

=====================
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: graphing question

Maguin, Eugene
ViAnn, thanks for your reply. I'll try it out.

I have a second question. Given a regular scatter plot chart (not a matrix), when I go into the chart editor there is a 'lasso' function that (seems to) draw a circle around a point. But what can I do having done that. I looked in help and it wasn't so helpful  and 'lasso' doesn't turn up much related (seemingly) to graphing.

Thanks, Gene Maguin

-----Original Message-----
From: ViAnn Beadle [mailto:[hidden email]]
Sent: Monday, October 29, 2012 4:52 PM
To: Maguin, Eugene; [hidden email]
Subject: RE: graphing question

Try the same algebra used in the first ELEMENT.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Maguin, Eugene
Sent: Monday, October 29, 2012 2:50 PM
To: [hidden email]
Subject: graphing question

I can do a scatterplot matrix type of plot. (how) can I add the regression line for each plot? I tried this:

ELEMENT: point(position((Proficnt/"Proficnt"+Rigid/"Rigid"+
   Resist/"Resist")*(ClientsAvg/"ClientsAvg"+HoldsAvg/"HoldsAvg")))
 ELEMENT: line(position(smooth.linear(Proficnt*ClientsAvg)))

The message back was 'elements within the same graph must share the same faceting structure'.

I'm not too surprised I got the message. It seems like it might work if the faceting business could be specified. Suggestions, please.

Thank you, Gene Maguin

=====================
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

=====================
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: graphing question

Maguin, Eugene
In reply to this post by Maguin, Eugene

Ruben,

 

Nothing special. I’m just plotting a scatterplot with a regression line and looking at the point distribution. The ‘lasso’ is found in the chart editor.

 

GGRAPH

/GRAPHDATASET NAME="graphdataset" VARIABLES=T_proficiency ClientsAvg

/GRAPHSPEC SOURCE=INLINE.

BEGIN GPL

SOURCE: s=userSource(id("graphdataset"))

DATA: T_proficiency=col(source(s), name("T_proficiency"))

DATA: ClientsAvg=col(source(s), name("ClientsAvg"))

GUIDE: axis(dim(1), label("T_proficiency"))

GUIDE: axis(dim(2), label("Average Clients per Month"))

ELEMENT: point(position(T_proficiency*ClientsAvg))

ELEMENT: line(position(smooth.linear(T_proficiency*ClientsAvg)))

END GPL.

 

Jon,

You all put this in for a reason but I don’t get how to use it. What I was hoping that the ‘lasso’ thing would do is allow me to select a point or group of points and yank them out of the computation of the regression line computation, which implies a dynamic recomputation of the regression line, just like you’d lasso a steer and pull it out of the herd.

 

Gene Maguin

 

 

From: Ruben van den Berg [mailto:[hidden email]]
Sent: Tuesday, October 30, 2012 2:07 AM
To: Maguin, Eugene
Subject: RE: graphing question

 

Dear Gene,

 

I was curious how this works but I can't really replicate because you posted only a tiny snippet of your GPL(?) syntax. Could I see the entire graph producing syntax?

 

TIA!

 

Ruben

> Date: Mon, 29 Oct 2012 16:49:56 -0400


> From: [hidden email]
> Subject: graphing question
> To: [hidden email]
>
> I can do a scatterplot matrix type of plot. (how) can I add the regression line for each plot? I tried this:
>
> ELEMENT: point(position((Proficnt/"Proficnt"+Rigid/"Rigid"+
> Resist/"Resist")*(ClientsAvg/"ClientsAvg"+HoldsAvg/"HoldsAvg")))
> ELEMENT: line(position(smooth.linear(Proficnt*ClientsAvg)))
>
> The message back was 'elements within the same graph must share the same faceting structure'.
>
> I'm not too surprised I got the message. It seems like it might work if the faceting business could be specified. Suggestions, please.
>
> Thank you, Gene Maguin
>
> =====================
> 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: graphing question

Maguin, Eugene
In reply to this post by ViAnn Beadle
I finally stumbled around and got the regression lines to be added. My question now is whether it is possible to add/show an axis for dimension 2, the y-axis. You see what I tried and while it executes, I don't get what I'm looking for, which to show the scale, I guess I would call it, for the row of plots with ClientsAvg on the y axis and the scale for the row of plots with HoldsAvg on the y axis. Maybe this isn't possible, I don't know. I do know that I don't understand the deep structure of GPL and the documentation doesn't help with that.

GUIDE: axis(dim(1), ticks(null()))
 GUIDE: axis(dim(2), label("ClientsAvg+HoldsAvg"))
 GUIDE: axis(dim(1), gap(0px))
 GUIDE: axis(dim(2), gap(0px))
 ELEMENT: point(position((Proficnt/"Proficnt"+Rigid/"Rigid"+
   Resist/"Resist")*(ClientsAvg/"ClientsAvg"+HoldsAvg/"HoldsAvg")))
 ELEMENT: line(position(smooth.linear((Proficnt/"Proficnt"+Rigid/"Rigid"+
   Resist/"Resist")*(ClientsAvg/"ClientsAvg"+HoldsAvg/"HoldsAvg"))))
 END GPL.

I also tried

GUIDE: axis(dim(2), label("ClientsAvg"+"HoldsAvg")), which gave an error (not a quoted string: $$6+$$7), and
GUIDE: axis(dim(2), label(ClientsAvg+HoldsAvg)), which gave a different error (not a quoted string).

I read that the gap() function is relevant, although where specifically that 'gap' is I'm not sure, and I took that out for dim(2) with no apparent effect unless there is some kind of interaction between the label() function and the gap() function.


-----Original Message-----
From: ViAnn Beadle [mailto:[hidden email]]
Sent: Monday, October 29, 2012 4:52 PM
To: Maguin, Eugene; [hidden email]
Subject: RE: graphing question

Try the same algebra used in the first ELEMENT.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Maguin, Eugene
Sent: Monday, October 29, 2012 2:50 PM
To: [hidden email]
Subject: graphing question

I can do a scatterplot matrix type of plot. (how) can I add the regression line for each plot? I tried this:

ELEMENT: point(position((Proficnt/"Proficnt"+Rigid/"Rigid"+
   Resist/"Resist")*(ClientsAvg/"ClientsAvg"+HoldsAvg/"HoldsAvg")))
 ELEMENT: line(position(smooth.linear(Proficnt*ClientsAvg)))

The message back was 'elements within the same graph must share the same faceting structure'.

I'm not too surprised I got the message. It seems like it might work if the faceting business could be specified. Suggestions, please.

Thank you, Gene Maguin

=====================
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

=====================
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: graphing question

Andy W

I believe you can only have one axis varying and still produce scales (this may be undocumented, I'm not sure). Below is an example I had used previously to demonstrate this (also, as always, it would help others if you made a fake dataset to reproduce your charts you are making or trying to make).


data list free / Date (SDATE10) Visits (F5)  Carts_Created (F3)  carts_converted (F2)  Orders_Created (F2).
begin data
2011-11-11    12277     161        9          36  
2011-11-12    11871     93         5          19    
2011-11-13    13072     107        8          8     
2011-11-14    13594     112        4          34    
2011-11-15    12741     129        8          43    
2011-11-16    15491     261        16         57 
2011-11-17    13418     186        17         42
end data.
dataset name lines.


*Making line graph with seperate scales.

DATASET ACTIVATE lines.
* Chart Builder.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=Date Visits Carts_Created carts_converted Orders_Created 
MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: Date=col(source(s), name("Date"))
  DATA: Visits=col(source(s), name("Visits"))
  DATA: Carts_Created=col(source(s), name("Carts_Created"))
  DATA: carts_converted=col(source(s), name("carts_converted"))
  DATA: Orders_Created=col(source(s), name("Orders_Created"))
  GUIDE: axis(dim(1), label("Date"))
  GUIDE: axis(dim(2), label(" "))
  ELEMENT: line(position(Date*(Visits/"Visits" + Carts_Created/"Carts Created"+ Orders_Created/"Orders Created" + carts_converted/"carts converted")), missing.wings())
END GPL.

*switching the algrebra still produces scales.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=Date Visits Carts_Created carts_converted Orders_Created 
MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: Date=col(source(s), name("Date"))
  DATA: Visits=col(source(s), name("Visits"))
  DATA: Carts_Created=col(source(s), name("Carts_Created"))
  DATA: carts_converted=col(source(s), name("carts_converted"))
  DATA: Orders_Created=col(source(s), name("Orders_Created"))
  GUIDE: axis(dim(1), label("Date"))
  GUIDE: axis(dim(2), label(" "))
  ELEMENT: line(position((Visits/"Visits" + Carts_Created/"Carts Created"+ Orders_Created/"Orders Created" + carts_converted/"carts converted")*Date), missing.wings())
END GPL.
*That works.

*now try with two varying axis's, nothing else has changed.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=Date Visits Carts_Created carts_converted Orders_Created 
MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: Date=col(source(s), name("Date"))
  DATA: Visits=col(source(s), name("Visits"))
  DATA: Carts_Created=col(source(s), name("Carts_Created"))
  DATA: carts_converted=col(source(s), name("carts_converted"))
  DATA: Orders_Created=col(source(s), name("Orders_Created"))
  GUIDE: axis(dim(1), label("Date"))
  GUIDE: axis(dim(2), label(" "))
  ELEMENT: point(position((Visits/"Visits" + Carts_Created/"Carts Created")*(Orders_Created/"Orders Created" + carts_converted/"carts converted")))
END GPL.
*This does not produce axis.

Alternative options are to reshape the dataset to long (e.g. ClientsAvg, HoldsAvg and/or Proficnt, Rigid, Resist are in the same column), and use faceting to display the charts. Another option with the data as is is to use graph begin and graph end statements to place multiple graphs in the same output.

Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/
Reply | Threaded
Open this post in threaded view
|

Re: graphing question

Maguin, Eugene

Andy,

I tried out your examples. Thank you. OK, sounds like do what I wanted to do just isn’t possible.

 

Thanks, Gene Maguin

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Andy W
Sent: Tuesday, October 30, 2012 4:35 PM
To: [hidden email]
Subject: Re: graphing question

 

I believe you can only have one axis varying and still produce scales (this may be undocumented, I'm not sure). Below is an example I had used previously to demonstrate this (also, as always, it would help others if you made a fake dataset to reproduce your charts you are making or trying to make).

 
data list free / Date (SDATE10) Visits (F5)  Carts_Created (F3)  carts_converted (F2)  Orders_Created (F2).
begin data
2011-11-11    12277     161        9          36
2011-11-12    11871     93         5          19
2011-11-13    13072     107        8          8
2011-11-14    13594     112        4          34
2011-11-15    12741     129        8          43
2011-11-16    15491     261        16         57
2011-11-17    13418     186        17         42
end data.
dataset name lines.
 
 
*Making line graph with seperate scales.
 
DATASET ACTIVATE lines.
* Chart Builder.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=Date Visits Carts_Created carts_converted Orders_Created
MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: Date=col(source(s), name("Date"))
  DATA: Visits=col(source(s), name("Visits"))
  DATA: Carts_Created=col(source(s), name("Carts_Created"))
  DATA: carts_converted=col(source(s), name("carts_converted"))
  DATA: Orders_Created=col(source(s), name("Orders_Created"))
  GUIDE: axis(dim(1), label("Date"))
  GUIDE: axis(dim(2), label(" "))
  ELEMENT: line(position(Date*(Visits/"Visits" + Carts_Created/"Carts Created"+ Orders_Created/"Orders Created" + carts_converted/"carts converted")), missing.wings())
END GPL.
 
*switching the algrebra still produces scales.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=Date Visits Carts_Created carts_converted Orders_Created
MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: Date=col(source(s), name("Date"))
  DATA: Visits=col(source(s), name("Visits"))
  DATA: Carts_Created=col(source(s), name("Carts_Created"))
  DATA: carts_converted=col(source(s), name("carts_converted"))
  DATA: Orders_Created=col(source(s), name("Orders_Created"))
  GUIDE: axis(dim(1), label("Date"))
  GUIDE: axis(dim(2), label(" "))
  ELEMENT: line(position((Visits/"Visits" + Carts_Created/"Carts Created"+ Orders_Created/"Orders Created" + carts_converted/"carts converted")*Date), missing.wings())
END GPL.
*That works.
 
*now try with two varying axis's, nothing else has changed.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=Date Visits Carts_Created carts_converted Orders_Created
MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: Date=col(source(s), name("Date"))
  DATA: Visits=col(source(s), name("Visits"))
  DATA: Carts_Created=col(source(s), name("Carts_Created"))
  DATA: carts_converted=col(source(s), name("carts_converted"))
  DATA: Orders_Created=col(source(s), name("Orders_Created"))
  GUIDE: axis(dim(1), label("Date"))
  GUIDE: axis(dim(2), label(" "))
  ELEMENT: point(position((Visits/"Visits" + Carts_Created/"Carts Created")*(Orders_Created/"Orders Created" + carts_converted/"carts converted")))
END GPL.
*This does not produce axis.

Alternative options are to reshape the dataset to long (e.g. ClientsAvg, HoldsAvg and/or Proficnt, Rigid, Resist are in the same column), and use faceting to display the charts. Another option with the data as is is to use graph begin and graph end statements to place multiple graphs in the same output.

 


View this message in context: Re: graphing question
Sent from the SPSSX Discussion mailing list archive at Nabble.com.