* SPSS syntax to generate: * CFSR Item VI) Maltreatment Recurrence over 6 months, * for Unique Child Victims. **** PERCENT NOT RECURRED IS NOW USED AS A MEASURE. ****COUNTS BY COUNTY SHOW CHILDREN THAT RECURRED. * Syntax File Name: C:\NCANDS\SPSS_CFSR\CFSR_VI_UNQCHLD.SPS * Instructions: Select 'Run All' after loading, no modification to syntax required. * Location of Report Produced: Reference SPSS output window after execution has completed. ********************************************************************************************. * Summary of Syntax Distributed In Conjunction with NCANDS FY 2005 Data Validation System. * * CREATE MASTER DATA FILE syntax creates file in SPSS format. * Must be run before all other syntax. * 'C:\NCANDS\datasys\dcdc\2005\[staterr]\full\create_master_sav_fy2005.sps * CFSR INDIVIDUAL COMPONENTS syntax generates counts/percentages for specific cells. * Execute only after creating master data file (see above). Produces reports for all counties. * Advantage of cell by cell syntax is that is more easily converted to other platforms * and is most suitable for editing to obtain custom reports. * c:\ncands\spss_cfsr\cfsr_[report item]_[unit of analysis].sps *********************************************************************************************. * 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. **********************************************************************************. **** SPECIFY NAME OF STATE DATA FILE TO PROCESS. get file = 'C:\NCANDS\datasys\dcdc\2005\[staterr]\full\masterv1.sav'. * Define victimization status. compute outcomev = 0 . if (mal1lev le 2) outcomev = 1 . if (mal2lev le 2) outcomev = 1 . if (mal3lev le 2) outcomev = 1 . if (mal4lev le 2) outcomev = 1 . if (maldeath eq 1) outcomev = 1 . var labels outcomev 'Child a Sub/Ind Victim' . * select only victims. select if (outcomev eq 1). exec. * Remove Report/Child pair if report date falls before start of initial period. select if (rptdt ge strtdate). exec. * Remove Report/Child pair if subsequent report date for child falls within 1 day. * (i.e, reports are treated as 'rolled-up' into a single report). sort cases by chid rptdt. * Note: 86,400 is number of seconds in a day and is measurement used in SPSS date fields. compute daysdiff = (rptdt - lag(rptdt))/86400. select if (chid ne lag(chid) or daysdiff gt 1). freq strtdate. * Remove multiple recurrent events if present as they are not used in the computation. * 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 / staterr = first(staterr) / rptcnty = first(rptcnty) / strtdate = first(strtdate) / numrpts = n(chid) / frstdate = first(rptdt) / lastdate = last(rptdt). exec. * The fields computed through aggregation for each unique child are stored * on disk in a temporary file and can be retrieved for processing. get file = 'c:\tempfile.sav' . * Active file, after GET, holds records for unique children victimized * within the reporting. **** SPECIFY DATES FOR REPORTING PERIOD. **** FOR RECURRENCE, REPORTING PERIOD DEFINED BY THE START DATE OF SUBMISSION. * Compute year and month of STRTDATE for reference within computations that follow. compute strtyear = xdate.year(strtdate). compute strtmnth = xdate.month(strtdate). compute strtyrmo = strtyear * 100 + strtmnth. if (strtmnth le 7) endyrmo = 100 * (strtyear ) + (strtmnth + 5). if (strtmnth gt 7) endyrmo = 100 * (strtyear + 1) + (strtmnth -12 + 5). * From the current active file of unique victims, select only those whose initial * maltreatment fell in first six months of reporting period. compute initmnth = xdate.month(frstdate). compute inityear = xdate.year(frstdate). compute inityrmo = 100 * inityear + initmnth. select if (inityrmo ge strtyrmo and inityrmo le endyrmo). * Active file now holds only records for children victimized in first six months. * 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 . * Reproduce same counts but for all counties within the State. sort cases by staterr. recode rptcnty (sys$mis = 9999) . compute cntyfips = rptcnty. sort cases by staterr cntyfips. match files file = * /table = 'c:\ncands\census\county_fips.sav' /by = staterr cntyfips. * Identify missing county codes when referenced by CNTYNAME. if (rptcnty lt 999) cntyname = concat(' ',substr(cntyname,1,23)). if (rptcnty eq 999) cntyname = 'Out of State'. if (rptcnty eq 9999) cntyname = 'Not Reported'. if (cntyname eq ' ') cntyname = 'FIPS Code Invalid'. * Generate selected statistics by county. crosstabs tables = cntyname by recur6m by staterr /cells = count row. ***PERCENT NOT RECURRED IS NOW USED AS A MEASURE. *** **To obtain a list of unique children WITH maltreatment recurrence execute the command below. select if (recur6m eq 1). exec.save outfile = 'c:\ncands\unique_victims_6m_recurrence.sav'. get file = 'c:\ncands\unique_victims_6m_recurrence.sav'.