Quantcast

HELP! Line chart with more than one series

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

HELP! Line chart with more than one series

Mike Donatello

Sorry for posting yet another question, but how do I create a simple line chart with more than one series in SPSS 20?  (I also wonder how something so simple in Excel can be so difficult in SPSS, but I digress.)

 

I chose a multi-series template from the line chart gallery, but I cannot figure out how to add more than one series to the chart.  For example, I have a categorical axis (price in whole dollar amounts) and want to chart cumulative distributions (sales volumes) for two different product lines.  Can anyone tell me how to do this simple task?

 

Thanks!

 

 

---

Mike Donatello

[hidden email]

 

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: HELP! Line chart with more than one series

Art Kendall
Open a new instance of SPSS. Paste the syntax below into a syntax window. Run it. Is this what you want?

I used the GUI and pasted the syntax.  I have only one case but for a sum that should not make a difference.
I dragged prod_line into "set color" , price into "x-axis", volume into the Y-axis, and specified "cumulative sum" as the statistic.

data list list /prod_line(f1) price(f2) volume(f3).
begin data
1 1 150
1 2 120
1 3 70
1 4 50
1 5 2
2 1 120
2 2 70
2 3 50
2 4 25
2 5 10
end data.
 
variable level Prod_line (nominal) price (ordinal) volume(scale).


* Chart Builder.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=price SUM(volume)[name="SUM_volume"] prod_line
    MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: price=col(source(s), name("price"), unit.category())
  DATA: SUM_volume=col(source(s), name("SUM_volume"))
  DATA: prod_line=col(source(s), name("prod_line"), unit.category())
  GUIDE: axis(dim(1), label("price"))
  GUIDE: axis(dim(2), label("Cumulative Sum volume"))
  GUIDE: legend(aesthetic(aesthetic.color.interior), label("prod_line"))
  SCALE: linear(dim(2), include(0))
  ELEMENT: line(position(summary.sum.cumulative(price*SUM_volume)), color.interior(prod_line),
    missing.wings())
END GPL.

Art Kendall
Social Research Consultants

On 4/6/2012 12:45 PM, Mike Donatello wrote:

Sorry for posting yet another question, but how do I create a simple line chart with more than one series in SPSS 20?  (I also wonder how something so simple in Excel can be so difficult in SPSS, but I digress.)

 

I chose a multi-series template from the line chart gallery, but I cannot figure out how to add more than one series to the chart.  For example, I have a categorical axis (price in whole dollar amounts) and want to chart cumulative distributions (sales volumes) for two different product lines.  Can anyone tell me how to do this simple task?

 

Thanks!

 

 

---

Mike Donatello

[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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: HELP! Line chart with more than one series

Jon K Peck
In reply to this post by Mike Donatello
This is a little tricky in the Chart Builder, because multiple-line charts expect a different data organization from yours.

Choose a SINGLE line chart.
Select all the variables for the y axis in the variable list, and drag the set to the y axis.

Set your x axis variable, and you are good to go.

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        Mike Donatello <[hidden email]>
To:        [hidden email]
Date:        04/06/2012 10:48 AM
Subject:        [SPSSX-L] HELP! Line chart with more than one series
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Sorry for posting yet another question, but how do I create a simple line chart with more than one series in SPSS 20?  (I also wonder how something so simple in Excel can be so difficult in SPSS, but I digress.)
 
I chose a multi-series template from the line chart gallery, but I cannot figure out how to add more than one series to the chart.  For example, I have a categorical axis (price in whole dollar amounts) and want to chart cumulative distributions (sales volumes) for two different product lines.  Can anyone tell me how to do this simple task?
 
Thanks!
 
 
---
Mike Donatello
mdonatello@...
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: HELP! Line chart with more than one series

Mike Donatello

Thanks, gents.  Your feedback helped on part of the problem, but it doesn’t quite get me all the way there, as I have a repeated-measures layout:

 

REC     PRICE1     PRICE2     VOL1     VOL2

001     1.20       1.75       175      212

002     1.33       1.90       126      198

etc.

 

 

Isn’t there some way that I can also plot cumulative percentages for both P1 and P2 on the same line chart?  I can’t seem to put two variables on the x-axis, even though they share the same categorical breaks (in this case, dollars and cents.

 

Am I making any sense, or should I just give up and use Excel?

 

 

 

 

From: Jon K Peck [mailto:[hidden email]]

Sent: Friday, April 06, 2012 2:29 PM

To: Mike Donatello

Cc: [hidden email]

Subject: Re: [SPSSX-L] HELP! Line chart with more than one series

 

This is a little tricky in the Chart Builder, because multiple-line charts expect a different data organization from yours.

 

Choose a SINGLE line chart.

Select all the variables for the y axis in the variable list, and drag the set to the y axis.

 

Set your x axis variable, and you are good to go.

 

Jon Peck (no "h") aka Kim

Senior Software Engineer, IBM

[hidden email]

new phone: 720-342-5621

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: HELP! Line chart with more than one series

Jon K Peck
Is this something like you are looking for?


GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=salary salbegin MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: salary=col(source(s), name("salary"))
  DATA: salbegin=col(source(s), name("salbegin"))
  GUIDE: axis(dim(2), label("Frequency"))
  ELEMENT: line(position(summary.proportion.count.cumulative(salary)),color(color.red))
  ELEMENT: line(position(summary.proportion.count.cumulative(salbegin)),color(color.blue))
END GPL.

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        "Mike Donatello" <[hidden email]>
To:        Jon K Peck/Chicago/IBM@IBMUS, "'Art Kendall'" <[hidden email]>
Cc:        <[hidden email]>
Date:        04/08/2012 12:52 PM
Subject:        RE: [SPSSX-L] HELP! Line chart with more than one series




Thanks, gents.  Your feedback helped on part of the problem, but it doesn’t quite get me all the way there, as I have a repeated-measures layout:
 
REC     PRICE1     PRICE2     VOL1     VOL2
001     1.20       1.75       175      212
002     1.33       1.90       126      198
etc.
 
 
Isn’t there some way that I can also plot cumulative percentages for both P1 and P2 on the same line chart?  I can’t seem to put two variables on the x-axis, even though they share the same categorical breaks (in this case, dollars and cents.
 
Am I making any sense, or should I just give up and use Excel?
 
 
 
 
From: Jon K Peck [mailto:peck@...]
Sent: Friday, April 06, 2012 2:29 PM
To: Mike Donatello
Cc: [hidden email]
Subject: Re: [SPSSX-L] HELP! Line chart with more than one series
 
This is a little tricky in the Chart Builder, because multiple-line charts expect a different data organization from yours.
 
Choose a SINGLE line chart.
Select all the variables for the y axis in the variable list, and drag the set to the y axis.
 
Set your x axis variable, and you are good to go.
 
Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: HELP! Line chart with more than one series

David Marso
In reply to this post by Mike Donatello
Not to be curt, but what is stopping you from reshaping the data to  conform to the requirements of the particular graph you need?
--
Mike Donatello wrote
Thanks, gents.  Your feedback helped on part of the problem, but it doesn't
quite get me all the way there, as I have a repeated-measures layout:



REC     PRICE1     PRICE2     VOL1     VOL2

001     1.20       1.75       175      212

002     1.33       1.90       126      198

etc.





Isn't there some way that I can also plot cumulative percentages for both P1
and P2 on the same line chart?  I can't seem to put two variables on the
x-axis, even though they share the same categorical breaks (in this case,
dollars and cents.



Am I making any sense, or should I just give up and use Excel?









From: Jon K Peck [mailto:[hidden email]]

Sent: Friday, April 06, 2012 2:29 PM

To: Mike Donatello

Cc: [hidden email]

Subject: Re: [SPSSX-L] HELP! Line chart with more than one series



This is a little tricky in the Chart Builder, because multiple-line charts
expect a different data organization from yours.



Choose a SINGLE line chart.

Select all the variables for the y axis in the variable list, and drag the
set to the y axis.



Set your x axis variable, and you are good to go.



Jon Peck (no "h") aka Kim

Senior Software Engineer, IBM

[hidden email]

new phone: 720-342-5621
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: HELP! Line chart with more than one series

Art Kendall
In reply to this post by Mike Donatello
How is the example I sent you different from what you are looking for?
Art Kendall
Social Research Consultants

On 4/8/2012 2:50 PM, Mike Donatello wrote:

Thanks, gents.  Your feedback helped on part of the problem, but it doesn’t quite get me all the way there, as I have a repeated-measures layout:

 

REC     PRICE1     PRICE2     VOL1     VOL2

001     1.20       1.75       175      212

002     1.33       1.90       126      198

etc.

 

 

Isn’t there some way that I can also plot cumulative percentages for both P1 and P2 on the same line chart?  I can’t seem to put two variables on the x-axis, even though they share the same categorical breaks (in this case, dollars and cents.

 

Am I making any sense, or should I just give up and use Excel?

 

 

 

 

From: Jon K Peck [[hidden email]]

Sent: Friday, April 06, 2012 2:29 PM

To: Mike Donatello

Cc: [hidden email]

Subject: Re: [SPSSX-L] HELP! Line chart with more than one series

 

This is a little tricky in the Chart Builder, because multiple-line charts expect a different data organization from yours.

 

Choose a SINGLE line chart.

Select all the variables for the y axis in the variable list, and drag the set to the y axis.

 

Set your x axis variable, and you are good to go.

 

Jon Peck (no "h") aka Kim

Senior Software Engineer, IBM

[hidden email]

new phone: 720-342-5621

 

===================== 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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: HELP! Line chart with more than one series

Mike Donatello

Sorry, you’re right. I goofed up your syntax when I edited it.  Thanks very much for the help!

 

 

 

From: Art Kendall [mailto:[hidden email]]
Sent: Sunday, April 08, 2012 6:30 PM
To: Mike Donatello
Cc: [hidden email]
Subject: Re: [SPSSX-L] HELP! Line chart with more than one series

 

How is the example I sent you different from what you are looking for?

Art Kendall
Social Research Consultants


On 4/8/2012 2:50 PM, Mike Donatello wrote:

Thanks, gents.  Your feedback helped on part of the problem, but it doesn’t quite get me all the way there, as I have a repeated-measures layout:

 

REC     PRICE1     PRICE2     VOL1     VOL2

001     1.20       1.75       175      212

002     1.33       1.90       126      198

etc.

 

 

Isn’t there some way that I can also plot cumulative percentages for both P1 and P2 on the same line chart?  I can’t seem to put two variables on the x-axis, even though they share the same categorical breaks (in this case, dollars and cents.

 

Am I making any sense, or should I just give up and use Excel?

 

 

 

 

From: Jon K Peck [[hidden email]]

Sent: Friday, April 06, 2012 2:29 PM

To: Mike Donatello

Cc: [hidden email]

Subject: Re: [SPSSX-L] HELP! Line chart with more than one series

 

This is a little tricky in the Chart Builder, because multiple-line charts expect a different data organization from yours.

 

Choose a SINGLE line chart.

Select all the variables for the y axis in the variable list, and drag the set to the y axis.

 

Set your x axis variable, and you are good to go.

 

Jon Peck (no "h") aka Kim

Senior Software Engineer, IBM

[hidden email]

new phone: 720-342-5621

 

Loading...