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