**FILENAME: EZcreat02f-tec.sps 12-29-2003 Creates First-Time Entry Cohort Part of Data Profile *Be sure you have run the "Pops" syntax before you try to run this syntax. *Creates 02 cohort file and gathers 02 and 03a discharges to compute *median LOS of the FY02 first-time entry cohort ("f-tec"). May replace "EZ" with State abbrev. *Gives Length of Stay with and without the same day children (entered and exited the same day). *Uses 02c entry file to identify 02 f-tec (children entering care for the 1st time during 1st six months). *Creates 02 f-tec cohort file and 02 f-tec count file which is used later to help compute median. get file 'c:\cfsr\EZdata\EZentry02c.sav'. FILTER OFF. USE ALL. SELECT IF(yrmoda(latremyr,latremmo,latremda) <= yrmoda(2002,03,31)). do if (totalrem=1). compute Records=(1). else. compute Records=(2). end if. formats Records (f1.0). value labels Records 1'1st Removal Ever' 2'2nd Removal or More'. exe. TABLES /FORMAT BLANK MISSING('.') /GBASE=CASES /FTOTAL= $t000003 "Total" /TABLE=records + $t000003 BY state /STATISTICS count( state( F5.0 )) cpct( state( PCT5.2 ) 'Col %':state ) /TITLE '1st Time Entry Cohort as %'+ ' of 6-Mo Entry FY02'. recode casegoal (sysmis=9) (0=9). value labels casegoal 1 'Reunification' 2 'Live with Relatives' 3 'Adoption' 4 'Long-Term Foster Care' 5 'Emancipation' 6 'Guardianship' 7 'Not Yet Established' 9 'Missing Goal Info'. exe. compute settime = yrmoda(cursetyr,cursetmo,cursetda). formats settime (f6.0). do if (settime<=yrmoda(2002,09,30)). compute set=1. else if (settime>=yrmoda(2002,10,01)). compute set=2. formats set (f1.0). end if. exe. compute newplace=(numplep). formats newplace (f2.0). if (set=2 and (newplace>=2)) newplace = (newplace-1). exe. recode newplace (sysmis=9) (0=9) (1=1) (2=2) (3=3) (4=4) (5=5) (6 thru highest=6) into NewP. formats NewP (f1.0). variable labels NewP 'Total Number of Placement Settings'. value labels NewP 1 '1 Placement' 2 '2 Placements' 3 '3 Placements' 4 '4 Placements' 5 '5 Placements' 6 '6 Placements or More' 9 'Missing'. exe. recode curplset (sysmis=9) (0=9). if (set=2) curplset=9.5. value labels curplset 1 'Pre-Adoptive Homes' 2 'FFH-Relative' 3 'FFH-NonRelative' 4 'Group Home' 5 'Institution' 6 'Supervised IL' 7 'Runaway' 8 'Trial Home Visit' 9 'Missing' 9.5 'Not Applicable'. select if (records=1). frequencies variables curplset casegoal NewP. save outfile='c:\cfsr\EZdata\EZcohort02.sav'. compute num=($casenum). formats num (f5.0). save outfile'c:\cfsr\EZdata\EZcount02.sav'/keep num. EXECUTE. **Uses cohort02.sav file to obtain cohort discharges and disreasons in FY02 get file 'c:\cfsr\EZdata\EZcohort02.sav'. do if (missing(dodfcyr) or yrmoda(dodfcyr,dodfcmo,dodfcda)>=yrmoda(2002,10,01)). compute dod= (2). else if ((yrmoda(dodfcyr,dodfcmo,dodfcda)<=yrmoda(2002,09,30)) and (yrmoda(dodfcyr,dodfcmo,dodfcda)>=yrmoda(2001,10,01))). compute dod=(1). end if. formats dod (f1.0). recode disreasn (sysmis=9) (0=9) (1=1) (2=1) (3=3) (5=5)(else=8) into Newdis1. formats Newdis1 (f1.0). value labels Newdis1 1'Reunification' 3'Adoption' 5'Guardianship' 8'Other' 9 'Missing'. select if (dod=1). frequencies variables Newdis1. exe. save outfile='c:\cfsr\EZdata\EZ02FTEC-02dis.sav'. EXECUTE . *Uses 03A file to pick up FY03 discharges of 02 F-TEC. get file 'c:\cfsr\EZdata\EZ0303f.sav'. FILTER OFF. USE ALL. SELECT IF (totalrem=1). SELECT IF ((yrmoda(latremyr,latremmo,latremda) <= yrmoda(2002,03,31)) and (yrmoda(latremyr,latremmo,latremda) >= yrmoda(2001,10,01))). SELECT IF ((yrmoda(dodfcyr,dodfcmo,dodfcda)<=yrmoda(2003,03,31)) and (yrmoda(dodfcyr,dodfcmo,dodfcda)>=yrmoda(2002,10,01))). compute Records=(1). formats Records (f1.0). TABLES /format blank missing('.') /gbase=cases /ftotal=$t000001 "Total" /table=state + $t000001 BY records /statistics count( records( comma6.0 )'N')/Title '03A Discharges from FY02 F-TEC'. exe. save outfile='c:\cfsr\EZdata\EZ02ftec-03dis.sav'. exe. *Merges discharge 02 and 03a files and apply case numbers from FTEC get file='c:\cfsr\EZdata\EZ02ftec-02dis.sav' /keep state to fcmntpay. ADD FILES /FILE=* /FILE='c:\cfsr\EZdata\EZ02ftec-03dis.sav' /keep state to fcmntpay. save outfile='c:\cfsr\EZdata\EZ02ftec-alldis.sav'. exe. MATCH FILES /FILE=* /FILE='c:\cfsr\EZdata\EZcount02.sav'. save outfile='c:\cfsr\EZdata\EZ02ftec-alldis.sav'. EXECUTE. *Using all-discharges file, compute LOS, sort LOS ascending, run median LOS of 2002 FTEC *NOTE: If Median Case has not exited from care by the end of 03a, then Mdn LOS will be * computed as 250 or more months, in which case median LOS is "Not yet reached." *Gives Length of Stay with and without the same day children (entered and exited the same day). get file'c:\cfsr\EZdata\EZ02ftec-alldis.sav'. compute LOS1 = (yrmoda(dodfcyr,dodfcmo,dodfcda)-yrmoda(latremyr,latremmo,latremda))/30.4375. DO IF (missing(LOS1)). RECODE LOS1 (sysmis=500). ELSE IF (LOS1<0). RECODE LOS1 (Lowest thru 0=SYSMIS). END IF. exe. SORT CASES BY los1 (A) . exe. variable label LOS1 LOS with "same day" kids (500=Not yet reached). FREQUENCIES Variables=LOS1 /FORMAT=NOTABLE /STATISTICS=MEDIAN /ORDER ANALYSIS. exe. IF (los1 > .01) LOSnosam = los1 . EXECUTE . variable label LOSnosam LOS without "same day" kids (for FTEC footnote). FREQUENCIES Variables=LOSnosam /FORMAT=NOTABLE /STATISTICS=MEDIAN /ORDER ANALYSIS. exe. save outfile='c:\cfsr\EZdata\EZ02ftec-alldis.sav'. EXECUTE.