I have a large data file with over 200 000 records. For each
individual record i have a variable which calculates time in dataset
(xdays) to onset of 13 individual diseases (xincid). What i want to do
is within each individual record identify which of the xdays var has
the minimum/smallest value and then create a new variable which links
the minimum value with the xincid variable
any suggestions would be more than helpful
cheers Ian
Breastdays BreastIncid Liverdays LiverIncid, Heartdays
Heartincid Colondays ColonIncid..............
2000 1 2000 1 1000 1
2000 1 1000 1 3000 1
new file.
set blanks 0.
data list list/ Breastdays (f5) BreastIncid(f1) Liverdays (f5)
LiverIncid(f1) Heartdays (f5)
Heartincid(f1) Colondays (f5) ColonIncid (f1).
begin data
2000 1 2000 1 1000 1
2000 1 1000 1 3000 1
2000 1 500 1 500 1
end data.
match files fil=* /keep =
Breastdays Liverdays Heartdays Colondays
BreastIncid LiverIncid HeartIncid ColonIncid ALL.
numeric Breastatmin Liveratmin Heartatmin Colonatmin (f1) mindays(f5).
compute mindays = min (Breastdays to Colondays).
do repeat
days = Breastdays to Colondays/
incid= BreastIncid to ColonIncid/
hit = breastatmin to Colonatmin.
compute hit = incid eq 1 and days eq mindays.
end repeat.
list.
Art Kendall
Social Research Consultants