Aggregating Arrests over Three Program Periods

Discussion in 'SPSS' started by Damir, Nov 8, 2011.

  1. Damir

    Damir Guest

    Hi All,

    I have a dataset and would like to count the number of arrests, prior
    to programming, during programming, and after programming. The
    dataset contains clinetids (RPUID), arrest date (ARREST_DATE), as well
    as program start and end dates - STARTDATE and ENDDATE. Any
    assistance with SYNTAX would be very much appreciated.

    I would like to create three new VARS Before, During and After. Each
    new variable would contain the number of arrests for each client we
    have in the database. The database has multiple clientids as each row
    represents an indiviudal charge for one arrest.

    The data currently look like this:
    RPUID ARREST_DATE STARTDATE ENDDATE
    1 10-MAY-2000 07-JUN-2000 09-AUG-2000
    1 12-DEC-2001 07-JUN-2000 09-AUG-2000
    2 10-JUL-2000 07-JUN-2000 09-AUG-2000
    2 10-JUL-2000 07-JUN-2000 09-AUG-2000
    3 09-JUL-2001 07-JUN-2000 09-AUG-2000
    3 10-MAY-2002 07-JUN-2000 09-AUG-2000
    3 01-JAN-2003 07-JUN-2000 09-AUG-2000
    3 12-FEB-2010 07-JUN-2000 09-AUG-2000


    I would like to add the following VARS that count arrests
    RPUID BEFORE DURING AFTER
    1 1 0
    1
    1 1 0
    1
    2 0 1
    0
    2 0 1
    0
    3 0 1
    2
    3 0 1
    2
    3 0 1
    2


    Thank you for your assistance. Let me know if you have any questions.

    Cheers,
    Damir
     
    Damir, Nov 8, 2011
    #1
    1. Advertisements

  2. Damir

    David Guest

    See RANGE function under COMPUTE command!
     
    David, Nov 9, 2011
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.