* SPSS syntax to generate: * CFSR Item II) Disposition of C/AN Reports. * 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 RPTID is used to identify the unique reports. * Field RPTDISP is used to identify the report disposition used in deriving CFSR disposition codes. **********************************************************************************. ********** Enter name of the State Master File in following command line *********.. get file = 'ENTER STATE FILE NAME HERE' /keep = staterr subyr rptid rptdisp . * Use NCANDS RPTDISP to assign disposition codes used in CFSR. recode rptdisp (1,2,3 = 1) (5,6 = 2) (else = 3) into cfsrdisp. var labels cfsrdisp 'CFSR Disposition' . val labels cfsrdisp 1 'Sub/Ind/AltVict' 2 'Unsubstantiated' 3 'Other' . * Format CFSRDISP (CFSR disposition) code to be an integer. format cfsrdisp (f8.0). * Group reports with the same ID together using the SORT command. * If more than one child in the report, multiple entries are found for that report. * By also sorting on CFSR disposition code, most severe disposition code * is listed first for all records associated with that report and will be selected. sort cases by rptid cfsrdisp. * Remove multiple entries by selecting only the first entry (most severe) for each report. * SPSS lag function below means: * 'Select record if the Report ID is not the same as previous Report ID (i.e, the first entry)'. select if (rptid ne lag(rptid)) . * Active file now contains only unique reports. * Following command generates count of reports by disposition within this disposition year. freq cfsrdisp.