I am working with a secondary data set and am having trouble figuring out how to get SPSS to calculate variables that I want.
The data capture sentences for criminal offenses. The unit of analysis is the count of conviction. For each conviction count, there is unique offender ID (Variable 1--string format). However, an individual offender can have multiple conviction counts. In other words, s/he CAN be--but isn't alwasy--several times but won't necessarily be (e.g. they won't if they've only got one count of conviction). Additionally, each count has a 'Batch' number (Variable 2--string format). This tells you which counts belong to the same court case. As I understand it, counts are nested within cases ('Batch' number) as well as nested within offenders (offender ID). However, any offender can be involved in multiple cases. Some cases have multiple offenders, but the only way you can tell is to match up the offender IDs to the same Batch number.
Presumably, SPSS can uses these variables to determine which counts belong to each individual offender as well as to match multiple offenders to a single case (e.g. whether there were co-defendants).
What I would like to do is create variables that tell me :
1) How many counts are related to a given
2) How many co-defendants are involved in a given
Once I have these, I want to create a weight that will enable me to control for the counts that are linked to other counts when looking at the sentences given out for each case and another one for the number of co-defendants (does this make sense)?
I have started doing this by hand by simply sorting the data by offender ID and entering (in a new variable) the number of times s/he appears for the same batch number. I was then going to do the same thing, sorting by Batch number and hand keying the number of co-defendants involved in each count. However, I have over 5,000 cases and am hoping that syntax might solve this more quickly. Any help you could offer would be GREATLY appreciated.
Thank you very much