AW: RE: How id entify case by “feat ure” of another case ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

AW: RE: How id entify case by “feat ure” of another case ?

Jara Kampmann-2
Rich,
what I want is to identify the couple, not only which persons are partnered, but also with whome in the hh.  But in the data only the second person of the couple is "marked" with the code "3".
As you can see in the example data: person 4 is coded "3" in ph01f3 the variable giving the relation to person 3. However, person 3 (in line 8) has in ph01f4 the variable giving the relation to person 4, only a missing value. So how can I identify person 3 as part of the couple?
Maybe the solution is trivial, but I do not see it.
Any suggestions?

Jara

------Originalnachricht------
Von: Rich Ulrich
An: [hidden email]
An: [hidden email]
Betreff: RE: How id entify case by “feat ure” of another case ?
Gesendet: 9. Apr 2011 23:13



[snip]
>
> In the data above there is one couple: household 6; persons 3 and 4 (line 8 and 9). This fact can be identified by the “3” in variable ph01f3 in line 9 for person 4, but only if looking in the data. I tried several solutions, but in the end it is always just postponing the problem: How do I identify a person by a “feature” of another person?
>
> I hope I could describe the problem at hand accurately. If not, let me know and I try again.

I do not see the difficulty.



If you do,

SELECT IF   ANY(3, ph01f2 to ph01f8) .


- You pick out the lines where "partner" is the code.

What next?  You can save those lines in a file and match
back to the original, if that is what you want.

Am I missing something?
--
Rich Ulrich


Von meinem drahtlosen BlackBerry®-Handheld gesendet

=====================
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
Reply | Threaded
Open this post in threaded view
|

RE: AW: RE: How id entify case by “feat ure” of another case ?

Rich Ulrich
----------------------------------------
> Date: Sat, 9 Apr 2011 21:51:53 +0000
> From: [hidden email]
> Subject: AW: RE: How id entify case by “feat ure” of another case ?
> To: [hidden email]
>
> Rich,
> what I want is to identify the couple, not only which persons are partnered, but also with whome in the hh. But in the data only the second person of the couple is "marked" with the code "3".
> As you can see in the example data: person 4 is coded "3" in ph01f3 the variable giving the relation to person 3. However, person 3 (in line 8) has in ph01f4 the variable giving the relation to person 4, only a missing value. So how can I identify person 3 as part of the couple?
> Maybe the solution is trivial, but I do not see it.

Okay.  You not only want to find the person, you want to
mark their record in the original file.

From the SELECT ANY(3,  varlist)  you can pick out the
line that says, Person 4; and there is a "3" in ph01f3,
indicating that Person 3  could be said to deserve a "3"
for ph01f4 -- if that is the convenient marker.

This is simple if you are sitting at an editor and looking
at the data file, and need to do one line; but it is tedious
when you want a formula for processing a lot of cases.  Like this --

There are two things that need to be done to that extracted line.
 1) Find the number of the variable that was "3", to know which person/
line to match (in this case, also "3").  This is an index to match on.
 2) Place "3", for partner, into ph01f4.  And set all other to Missing.

Then you work it something like this, after fixing the syntax. And
using your own variable names.  I think the records were unique for
Household and Person.  I think there were 8 persons.



vector ph01f1 to ph0f8.
Loop for #i= 1 to 8.
if   (ph01f(#i) eq 3)  person= #i.
+compute ph01f(#i)= $sysmis.
end loop.

compute  ph01f(person) = 3.

save outfile= "changes.sav"/ vars= household, person, ph01f1 to ph01f8.


Now you can use UPDATE, with the original and Master and Changes
as the Update file, matching on Household and Person.  "Missing"
are ignored for Updates.
Alternately, if it is more congenial to you, you could use Add Files
and then Aggregate, to leave an updated code.

Hope this does it.

By the way, this file organization is inconvenient for most
purposes.  It might be best to thoroughly reorganize.

--
Rich Ulrich




=====================
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