**FILENAME: Creat97FTEC.sps Last updated: 8-09-01 *Creates 97 cohort file and gathers 97, 98, 99 and 00a discharges to compute *median LOS of the FY97 first-time entry cohort (FTEC). *Uses 97c entry file to identify 97 FTEC (children entering care for the 1st time during 1st six months). *Creates 97 FTEC cohort file and 97 FTEC count file used later to help compute median. get file 'c:\cfsr\EZdata\EZentry97c.sav'. FILTER OFF. USE ALL. SELECT IF(yrmoda(latremyr,latremmo,latremda) <= yrmoda(1997,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 FY97'. 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(1997,09,30)). compute set=1. else if (settime>=yrmoda(1997,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 Placements'. 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\Cohort97.sav'. exe. compute num=($casenum). formats num (f5.0). save outfile='c:\cfsr\EZdata\Count97.sav' /keep num. EXECUTE. **Uses cohort97.sav file to obtain cohort discharges and disreasons in FY97 get file 'c:\cfsr\EZdata\Cohort97.sav'. FILTER OFF. USE ALL. do if (missing(dodfcyr) or yrmoda(dodfcyr,dodfcmo,dodfcda)>=yrmoda(1997,10,01)). compute dod= (2). else if ((yrmoda(dodfcyr,dodfcmo,dodfcda)<=yrmoda(1997,09,30)) and (yrmoda(dodfcyr,dodfcmo,dodfcda)>=yrmoda(1996,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\97FTEC-97dis.sav'. EXECUTE. **Uses 98c exits file to pick up FY98 discharges of 97 f-tec. get file 'c:\cfsr\EZdata\EZexits98c.sav'. FILTER OFF. USE ALL. SELECT IF((yrmoda(latremyr,latremmo,latremda) <= yrmoda(1997,03,31)) and (yrmoda(latremyr,latremmo,latremda) >= yrmoda(1996,10,01))). SELECT IF (totalrem=1). SELECT IF (yrmoda(dodfcyr,dodfcmo,dodfcda)<=yrmoda(1998,09,30)). 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 'FY98 Discharges from FY97 F-TEC'. save outfile='c:\cfsr\EZdata\97FTEC-98dis.sav'. exe. **Uses 99c file to pick up FY99 discharges of 97 f-tec. get file 'c:\cfsr\EZdata\EZexits99c.sav'. FILTER OFF. USE ALL. SELECT IF(yrmoda(latremyr,latremmo,latremda) <= yrmoda(1997,03,31) and yrmoda(latremyr,latremmo,latremda) >= yrmoda(1996,10,01)). SELECT IF (totalrem=1). SELECT IF (yrmoda(dodfcyr,dodfcmo,dodfcda)<=yrmoda(1999,09,30)). 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 'FY99 Discharges from FY97 F-TEC'. save outfile='c:\cfsr\EZdata\97ftec-99dis.sav'. exe. *Uses 00a file to pick up FY00 discharges of 97 FTEC. get file 'c:\cfsr\EZdata\EZ0300f.sav'. FILTER OFF. USE ALL. SELECT IF (totalrem=1). SELECT IF ((yrmoda(latremyr,latremmo,latremda) <= yrmoda(1997,03,31)) and (yrmoda(latremyr,latremmo,latremda) >= yrmoda(1996,10,01))). SELECT IF ((yrmoda(dodfcyr,dodfcmo,dodfcda)<=yrmoda(2000,03,31)) and (yrmoda(dodfcyr,dodfcmo,dodfcda)>=yrmoda(1999,10,01))). compute Records=(1). formats Records (f1.0). exe. TABLES /format blank missing('.') /gbase=cases /ftotal=$t000001 "Total" /table=state + $t000001 BY records /statistics count( records( comma6.0 )'N')/Title '00A Discharges from FY97 FTEC'. save outfile='c:\cfsr\EZdata\97ftec-00dis.sav'. exe. * Merges all discharge 97, 98, 99 and 00 files and apply case numbers from FTEC get file='c:\cfsr\EZdata\97ftec-97dis.sav' /keep state to fcmntpay. ADD FILES /FILE=* /FILE='c:\cfsr\EZdata\97ftec-98dis.sav' /keep state to fcmntpay. ADD FILES /FILE=* /FILE='c:\cfsr\EZdata\97ftec-99dis.sav' /keep state to fcmntpay. ADD FILES /FILE=* /FILE='c:\cfsr\EZdata\97ftec-00dis.sav' /keep state to fcmntpay. save outfile='c:\cfsr\EZdata\97ftec-alldis.sav'. exe. MATCH FILES /FILE=* /FILE='c:\cfsr\EZdata\Count97.sav'. save outfile='c:\cfsr\EZdata\97ftec-alldis.sav'. EXECUTE. *Using all-discharges file, compute LOS, sort LOS ascending, run median LOS of 97 FTEC *NOTE: If Median Case has not exited from care by the end of 00a, then Mdn LOS will be * computed as 500 months, in which case median LOS is "Not yet reached." get file'c:\cfsr\EZdata\97ftec-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\97ftec-alldis.sav'. exe.