LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2001)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 11 Jan 2001 19:41:58 -0500
Reply-To:     Raynald Levesque <rlevesque@VIDEOTRON.CA>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Raynald Levesque <rlevesque@VIDEOTRON.CA>
Subject:      Re: Graphing longitudinal data
Comments: cc: Dennis Deck <dennis_deck@rmccorp.com>
In-Reply-To:  <7D5417137882D111B6EF0060086699A96DC686@RMC_SERVER>
Content-Type: text/plain; charset="iso-8859-1"

Hi Dennis!

this method is appropriate when there are many charts (there are no manual interventions)

* create dummy data. INPUT PROGRAM. SET SEED=98765431. LOOP id=1 TO 200. COMPUTE group=RND(UNIFORM(5)+.5). DO REPEAT v=druga1 TO druga6. COMPUTE v=UNIFORM(2). END REPEAT. END CASE. END LOOP. END FILE. END INPUT PROGRAM. LIST.

VECTOR drug=druga1 TO druga6. LOOP drugnb=1 TO 6. COMPUTE drug=drug(drugnb). XSAVE OUTFILE='c:\temp\temp.sav'/KEEP=drugnb drug group. END LOOP. EXECUTE. GET FILE='c:\temp\temp.sav'.

AGGREGATE /OUTFILE=* /BREAK=group drugnb /drug = MEAN(drug).

STRING dname(A6). COMPUTE dname=CONCAT('Drug',STRING(drugnb,F1)). GRAPH Title='Alcohol Days' /LINE(MULTIPLE)MEAN(drug) BY dname BY group /MISSING=REPORT.

HTH

Raynald Levesque rlevesque@videotron.ca

-----Original Message----- From: Dennis Deck [mailto:dennis_deck@rmccorp.com] Sent: Thursday, January 11, 2001 12:52 PM To: 'Raynald Levesque' Subject: RE: Graphing longitudinal data

thanks. That gets the desired result but the interactive approach is awkward with a large number of charts.

Is there any way to transpose the series automatically? The tranpose does not appear to be under the control of syntax or template.

-----Original Message----- From: Raynald Levesque [mailto:rlevesque@videotron.ca] Sent: Wednesday, January 10, 2001 4:37 PM To: SPSSX-L@LISTSERV.UGA.EDU Cc: Dennis Deck Subject: RE: Graphing longitudinal data

Hi Denis

Does this solve your problem?

* create dummy data. INPUT PROGRAM. SET SEED=98765431. LOOP id=1 TO 200. COMPUTE group=RND(UNIFORM(5)+.5). DO REPEAT v=druga1 TO druga6. COMPUTE v=UNIFORM(2). END REPEAT. END CASE. END LOOP. END FILE. END INPUT PROGRAM. LIST.

GRAPH Title='Alcohol Days' /Line(multipe)= MEAN(druga1 druga2 druga3 druga4 druga5 druga6) by Group.

1. Run above lines. 2. double click on the chart then using the menu in the Chart Editor window: select Series > Transpose Data.

Regards

Raynald Levesque rlevesque@videotron.ca

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of Dennis Deck Sent: Wednesday, January 10, 2001 12:00 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Graphing longitudinal data

Any suggestions for getting SPSS to graph longitudinal data on multiple groups on one chart?

I have repeated measures (monthly) on adolescent drug use and would like to chart the results for different subgroups. The syntax for tol create a simple line chart for a single group is:

GRAPH Title='Alcohol Days' /Line(simple)= MEAN(druga1 druga2 druga3 druga4 druga5 druga6) .

But if I add a BY variable I get a line for each drug rather than a line for each group:

GRAPH Title='Alcohol Days' /Line(multiple)= MEAN(druga1 druga2 druga3 druga4 druga5 druga6) by Group .

I know I can get multiple charts, one for each group, using SPLIT FILES:

SORT CASES BY Group . SPLIT FILE By Group . GRAPH Title='Alcohol Days' /Line(simple)= MEAN(druga1 druga2 druga3 druga4 druga5 druga6) .

But I would like to have the time series for each group on the same chart. I could restructure the database with one record per month for each person but that is does not work for the other analyses I plan to do.

Dennis Deck, Ph.D. RMC Research Corporation 522 SW Fifth, Suite 1407 Portland, OR 97204 (800)788-1887 (503)223-8248 Voice (503)223-8399 Fax


Back to: Top of message | Previous page | Main SPSSX-L page