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 |
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 |
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 |
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]] 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 |
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 |
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).
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, 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 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).
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 |
Free forum by Nabble | Edit this page |