hi
i have the following string variable in spss , it can be of length
69, 70 or 71 the example is of length 69
what i want to do is where a woman was pregnant (denoted by p)
create a variable for each occurrence of pregnancy so for example
for line one the woman has been pregnant twice, the variable is
obviously read from the right hand side, and then for each variable
created to count the number of P and B, so for example in line one
of the variable shownthere would be a variable to denote a
pregnancy and another variable to denote the total length until
birth for the first occurrence with entry = 9 , as the woman had
had 2 pregnancies the second variable to denote length would also
be 9, women 2 had no pregnancies and woman 3 had two pregnancies
the first of length 6 and the second of length 9
my question is this possible to construct in spss and how would it
be done?
any help would be greatly appreciated
if there is a solution i trust that this could be extended to those
entries that are of length 70 and 71 respectively
regards
ann
variable
1111111111111111111111000000000000000000BPPPPPPPP00000000000BPPPPPPPP
111111111111111111111111111111111111111111111111111111111111111111111
000000000000000000000000000000000000000BPPPPPPPP011000000000000BPPPPP
----------------------
ann e fitzmaurice
medical statistician
dugald baird centre
department of obs and gynae
university of aberdeen
[log in to unmask]
tel 01224 553876 (direct)
fax 01224 404925
|