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 (February 2002)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 14 Feb 2002 10:41:51 -0800
Reply-To:     Judy Butler <jabutler66@yahoo.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Judy Butler <jabutler66@yahoo.com>
Subject:      Re: Creating New Variable
Comments: To: Lauren_Alongi@tufts-health.com
In-Reply-To:  <OF38D14119.D1CF0039-ON85256B60.0054320C@tufts-health.com>
Content-Type: text/plain; charset=us-ascii

If I were you, I do something like the following: 1) Assuming the the people with the same name and birthdates are not next to each other in the file and that all of the records for a person are grouped together... I would use the lag function to give each group of records for one person an identifier of some kind. 2) Then I would use aggregate to produce a file of each identifier with the visit counter in it and merge it back to the main file.

However, if you have some other variable like address, ssn, or something else that helps you differentiate the different people with the same names and birth dates, you can just do your aggregate based on name, birthdate and that variable with the visit counter and merge the aggregated file back to the main file. Remember to sort by name, birthdate, and the variable first, which will make the merge back easier.

Then you can do whatever you want with the file. Hope that helps.

--- Lauren Alongi <Lauren_Alongi@tufts-health.com> wrote: > I am trying to create a new variable, based on > information from several > different variables. My file has a unique id for > each line. Some lines > are actually the same people (same lname, fname, > dob, etc.), although they > have different ids. I created a duplicate person > flag (0/1) and a > "partner" flag (0/1) and a third flag coded as 1 if > either of the other two > flags =1. After manually looking up some of the > people, I found that some > of them, although they share the same name and dob, > are not actually the > same people (hard to believe, I know, but it's > true). Therefore, I had to > manually change the duplicate flags from 1 to 0. > What I ultimately want to > do, is "transfer hits" among lines that are the > same. So for example, > > id last first dob dupmem num1 > 1 doe jane 1/1/22 0 0 > 2 doe jane 1/1/22 1 1 > 3 doe jane 1/1/22 1 0 > > The num1 variable represents whether or not the > member had an eye exam > (dichotomous 1/0). They did have an exam under one > of their unique ids > (#2) so I want to create a new numerator field where > all three lines will > have a 1 because the member did, in fact, have an > eye exam, albeit under a > different id. For example, > > id last first dob dupmem num1 num1b > 1 doe jane 1/1/22 0 0 1 > 2 doe jane 1/1/22 1 1 1 > 3 doe jane 1/1/22 1 0 1 > > My file has many other variables that I need to keep > separate, i.e. test > dates and provider id, and I need all unique ids. I > don't want to > aggregate because I want to keep separate all of the > other information and > because I do not want to combine people who are not > actually the same > member. I was able to do it using sorts and lag > statements, but only if > there was only two lines with the same member. If > there were >2 lines with > the same member, it didn't work. Sometimes, people > have as many as 5 > unique ids but they are actually the same person. I > would like the num1b > variable to be = 1 if any of lines have num1=1. Any > thoughts would be > appreciated. > > Thanks, > Lauren

===== ****************************************** Check out the latest pictures of Emily at http://www.users.qwest.net/~bcj5 ******************************************

__________________________________________________ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com


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