* SPSS syntax to generate: * CFSR Item VI) Maltreatment Recurrence in Six Months, * for Unique Child Victims January-June. * Syntax applies to NCANDS Child File V4.0. ************************************************************************************. ****** Lines beginning with '*' are comments and are not executed by SPSS. *****. ****** Name of State Master File must be entered in highlighted section below. *****. ************************************************************************************. * Field CHID (Child ID) used to identify unique victims. * Fields MAL1LEV MAL2LEV MAL3LEV MAL4LEV and MALDEATH * are used to identify maltreatment victims. * Non-victims are removed from the analysis. * Field RPTDT (report date) is used to identify dates maltreatment reported. * Six Month Recurrence is flagged if the report dates for the same child fall * within a six month (183 day) period. * Field SUBYR is used to identify the calendar year associated with the Master File. **********************************************************************************. ********** Enter name of the State Master File in following command line *********. get file = 'ENTER STATE FILE NAME HERE' /keep = staterr subyr chid mal1lev mal2lev mal3lev mal4lev maldeath rptdt. * Create flag variable FLVICTIM to identify maltreatment victims. * If any maltreatment dispositions (MALLEV) are 1=sub or 2=ind, * the child was a victim. * If the child died as result of the maltreatment MALDEATH=1, * the child was a victim. compute flvictim = 0 . if (mal1lev le 2) flvictim = 1. if (mal2lev le 2) flvictim = 1. if (mal3lev le 2) flvictim = 1. if (mal4lev le 2) flvictim = 1. if (maldeath eq 1) flvictim = 1. * Active file currently holds all duplicate children. * Analysis does not include non-victims and they are removed from the file. select if (flvictim eq 1) . * After select, above, active file holds all duplicate victims. * Report dates falling in previous year can be removed as these do not define * the universe of victims under consideration (i.e., Jan-Jun of current year). * Nor is it possible that they constitute a recurrent event for these victims. * Remove these unneeded records by computing the year associated with the report * date and select only those falling within the current year. * The current year is defined by the year stored in SUBYR and is the same * year for all records in the Master File. * To compute the report year, the SPSS XDATE function is applied to RPTDT. compute rptyear = xdate.year(RPTDT). * Select record if report year is current year. select if (rptyear eq subyr) . * After select, above, active file holds duplicate victims with report date * in the current year. * In computing recurrence rates, current practice calls for the 'rolling-up' * of reports for the same child that occur on the same or the next calendar day. * The justification for this practice is that reports falling this close * together more likely reflect multiple reports of the same maltreatment * incident than a recurrent event. * The first step in performing'Roll-up' is done by sorting/grouping the records * in order by the Child ID and then in order by the report date. * Reference 'SORT CASES' command below. sort cases by chid rptdt. * With the records sorted by Child ID and report date, rollup is performed * by comparing consecutive reports for the same child. * If consecutive records for the same child hold dates less than 2 days apart, * the second of the two records is removed. * In SPSS, the days between consecutive reports is computed by taking the difference * between the date for the current record (RPTDT) and the date for the previous * record LAG(RPTDT). (i.e., RPTDT - LAG(RPTDT)). * However, because SPSS computes the difference in dates in terms of seconds, * the difference must be divided by 86400 to get a count of days. compute daysdiff = (rptdt - lag(rptdt))/86400. * At this point, the records that can be retained are those that indicate * a record for a new child (i.e., CHID ne LAG(CHID)) or an additional record * for the same child (i.e., CHID eq LAG(CHID)) but with a report date falling * more than one calendar after the initial date (i.e., daysdiff gt 1). * Reference SELECT IF command below. select if (chid ne lag(chid) or daysdiff gt 1). * After select, above, active file holds duplicate victims within calendar * year but not reports falling within a single caldendar day. * For each unique child identified in the active file, the reports of interest * include only the first report and a second report if it is present. * The first report defines the time frame in which the child was initially * victimized, and the second will identify recurrence if it occurred. * Any additional records should be removed, and can be identified by * computing the position (RPTPOSIT) of all reports for the same child. compute rptposit = 1. if (chid eq lag(chid)) rptposit = lag(rptposit) + 1. * After this assignment, the third report for a child will have RPTPOSIT = 3. * Unneeded reports/records can now be removed. select if (rptposit le 2) . * After select, active file contains records for victims with report dates * falling in the calendar year (post 'Rollup'), and only the first two reports * for each child. * At this point, the objective is to develop a single record for each child * which summarizes 1) Date of initial report; 2) Date of subsequent report * if present; and 3) Number of reports associated with the child. These * characteristics can be generated for each child using the SPSS aggregate * command. The respective subcommands can be translated as follows: * For each value of the /break variable (i.e., unique child) generate * NUMRPTS - number reports associated with the Child ID: /numrpts = n(chid) * FRSTDATE - earliest report date for the child: /frstdate = first(rptdt) * LASTDATE - latest report date for the child: /lastdate = last(rptdt) . aggregate outfile = 'c:\tempfile.sav' /break = chid / numrpts = n(chid) / frstdate = first(rptdt) / lastdate = last(rptdt). * The fields computed through aggregation for each unique child are stored * on disk in a temporary file and must be retrieved for processing. get file = 'c:\tempfile.sav' . * Active file, after GET, holds records for unique children victimized * within the calendar year. * From the current active file of unique victims, select only those whose initial * maltreatment fell between January and June of the current year. compute initmnth = xdate.month(frstdate). select if (initmnth le 6) . * Active file now holds records for unique victims victimized in January - June . * Now determine if the child was a recurrent victim within 6 months (183 days) * of the initial date and assign result to field RECUR6M. compute recur6m = 0 . if (numrpts eq 2 and (lastdate - frstdate)/86400 le 183) recur6m = 1. * Format recurrence field before generating count. var labels recur6m 'Recurrence in 6 Months' . val labels recur6m 1 'Yes' 0 'No' . freq recur6m .