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 (March 1999)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 30 Mar 1999 19:33:10 -0500
Reply-To:     Raynald Levesque <rlevesque@VIDEOTRON.CA>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@UGA.CC.UGA.EDU>
From:         Raynald Levesque <rlevesque@VIDEOTRON.CA>
Subject:      Re: slecting one child from a household
Comments: To: Stefan Jonsson <stefanj@POP.PSU.EDU>
Content-type: text/plain; charset=iso-8859-1

Hi Stephan!

This will select one child (at random) from each hh#:

USE ALL. compute rv=uniform(1). RANK VARIABLES=rv (A) BY hh# /RANK /PRINT=NO /TIES=MEAN . SELECT IF(rrv=1). EXECUTE .

Regards

Raynald Levesque rlevesque@videotron.ca

----- Original Message ----- From: Stefan Jonsson <stefanj@POP.PSU.EDU> Newsgroups: bit.listserv.spssx-l To: <SPSSX-L@UGA.CC.UGA.EDU> Sent: Tuesday, March 30, 1999 11:12 AM Subject: slecting one child from a household

> Hello all. > > I have what simple problem but can not figure out the best(any) solution to. > My data set consists of about 19,000 children (the NHIS dataset) in > somewhat fewer households (the HH coding scheme is bizare). I want to > select exactly one child at random from within each household where there > are 2 or more children and select the only child where there is only one > child. Each household has at least one child, some HH have 2 other 3 etc. > > I have: > HH# Child# > 1 1 > 1 2 > 2 1 > 3 1 > 4 1 > 4 2 > > > I Want: > HH# Child# > 1 2 (or 1) > 2 1 > 3 1 > 4 1 (or 2) > > > Thanks, > Stefan > > P.S. are the SPSS mailing messages archived somewhere on the www?


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