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 (August 2008)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 12 Aug 2008 12:42:44 +0200
Reply-To:     la volta statistics <schmidhauser@lavolta.ch>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         la volta statistics <schmidhauser@lavolta.ch>
Subject:      AW: Display Values in different variables
Comments: To: Balmer Thomas <Thomas.Balmer@phbern.ch>
In-Reply-To:  <E44517773E26CD41B3A1E5F34EEEE3096DCEB7@llbbe1exch002.phbern.intra>
Content-Type: text/plain; charset="us-ascii"

Hi Thomas

Use the command VARSTOCASES to get all the ages into one variable. I made you an example (see below). Ignore the warnings when the dataset is created.

Hope this helps, Christian

******************************* la volta statistics Christian Schmidhauser, Dr.phil.II Weinbergstrasse 108 CH-8006 Zurich Tel: +41 (043) 233 98 01 Fax: +41 (043) 233 98 02 email: mailto:schmidhauser@lavolta.ch internet: http://www.lavolta.ch/

* Start example.

New File. DATASET CLOSE ALL. DATA LIST list /ID AlterKind1 AlterKind21 AlterKind22 AlterKind31 AlterKind32 AlterKind33 AlterKind41 AlterKind42 AlterKind43 AlterKind44 . BEGIN DATA 1 3 2 . 4 5 3 . . . 6 7 8 4 . . . . . . 9 10 11 12 5 4 6 . 5 6 7 . . . 7 8 9 8 . . . . . . 10 11 12 13 5 5 6 . 6 7 7 . . . 8 9 10 8 . . . . . . 11 12 13 14 9 7 10 . 7 8 11 . . . 10 11 12 12 . . . . . . 13 15 17 18 END DATA.

*Ignore the warnings.

VARSTOCASES /ID = id1 /MAKE Age FROM AlterKind1 AlterKind21 AlterKind22 AlterKind31 AlterKind32 AlterKind33 AlterKind41 AlterKind42 AlterKind43 AlterKind44 /INDEX = Index1(10) /KEEP = ID /NULL = KEEP.

Select if (not missing(age)).

DATASET DECLARE Dataset2. AGGREGATE /OUTFILE='Dataset2' /BREAK=Age /n_Counts=N.

DATASET ACTIVATE Dataset2.

Var Label n_counts 'Anzahl Kinder' /Age 'Alter (Jahre)'.

GGRAPH /GRAPHDATASET NAME="graphdataset" VARIABLES=Age n_Counts MISSING= LISTWISE REPORTMISSING=NO /GRAPHSPEC SOURCE=INLINE. BEGIN GPL SOURCE: s=userSource(id("graphdataset")) DATA: Age=col(source(s), name("Age"), unit.category()) DATA: n_Counts=col(source(s), name("n_Counts")) GUIDE: axis(dim(1), label("Alter (Jahre)")) GUIDE: axis(dim(2), label("Anzahl Kinder")) SCALE: cat(dim(1)) SCALE: linear(dim(2), include(0)) ELEMENT: point(position(Age*n_Counts)) END GPL.

* End example.

-----Ursprungliche Nachricht----- Von: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]Im Auftrag von Balmer Thomas Gesendet: Dienstag, 12. August 2008 11:51 An: SPSSX-L@LISTSERV.UGA.EDU Betreff: Display Values in different variables

Hi there!

I have a dataset, in which the age of the children of families are values in different variables: it has been the result of my rather complicated solution in mrInterview to offer to the respondents the possibility to answer according to the number of their children.

Therefore AlterKind1 contains the age of the child in the case, the family has just one child, AlterKind21 and AlterKind22 contain the age of the two children in the case, a family has two children etc...

AlterKind1 AlterKind21 AlterKind22 AlterKind31 AlterKind32 AlterKind33 AlterKind41 AlterKind42 AlterKind43 AlterKind44

Now I'd like to display the frequencies of the ages (1 till 18) of all children for all of the cases (y-axis number, x-axis age 1 to 18), but I can't figure out how to do this with SPSS 16.0.

Thanks for your help.

Thomas

======= To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (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 LISTSERV@LISTSERV.UGA.EDU (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


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