**************************************************************** * WARNING: USE FOR YEARS 5, 6 ONLY * * * * PROGRAM: SCH56.SAS * * * * PROGRAMMER: Unknown - no comments in original code * * * * PURPOSE: Create a SAS dataset containing derived * * variables of the Supervision - Child measure * * * * MODIFIED: 11/12/01 Patrick Malone to run off aggregated * * datasets. * ****************************************************************; **Fill out information in next section for data processed ** **in this run. **; %let source=Child; %let src=c; %let inst=o; %let longname=supervisionchild; %let scoredname=SCH; **Enter high-level path (e.g., l:\datasets) **; %let path=d:\datasets; **Enter year of data collection **; %let yr=6; **Enter variable which must be present to retain record (typically interviewer id) **; %let screen=c&yr.oint; **Specify Lib for input datasets **; Libname SASIN "&path.\&source.\&longname.\U"; **Specify Lib for output datasets **; Libname SASOUT "&path.\&source.\&longname.\S"; ****** DO NOT MODIFY BELOW THIS LINE **************; ** Process ERQ data **; data SASOUT.&scoredname.&yr.; set SASIN.&src.&yr.&inst; if &screen ne ''; misstot=nmiss(c&yr.o1,c&yr.o2,c&yr.o3,c&yr.o4,c&yr.o6,c&yr.o8,c&yr.o9, c&yr.o10,c&yr.o11,c&yr.o12,c&yr.o13,c&yr.o14,c&yr.o15,c&yr.o16,c&yr.o17,c&yr.o18); if misstot eq 16 then delete; if c&yr.o1 eq 8 then c&yr.o1=.; if c&yr.o2 eq 8 then c&yr.o2=.; if c&yr.o3 eq 8 then c&yr.o3=.; if c&yr.o4 eq 8 then c&yr.o4=.; if c&yr.o5a eq 8 then c&yr.o5a=.; if c&yr.o5a eq 0 then c&yr.o5a=.; if c&yr.o5b eq 'n' then c&yr.o5b=.; if c&yr.o6 eq 8 then c&yr.o6=.; if c&yr.o7a eq 8 then c&yr.o7a=.; if c&yr.o7a eq 0 then c&yr.o7a=.; if c&yr.o7b eq 'n' then c507b=.; if c&yr.o8 eq 8 then c&yr.o8=.; if c&yr.o9 eq 8 then c&yr.o9=.; if c&yr.o10 eq 8 then c&yr.o10=.; if c&yr.o11 eq 8 then c&yr.o11=.; if c&yr.o12 eq 8 then c&yr.o12=.; if c&yr.o13 eq 8 then c&yr.o13=.; if c&yr.o14 eq 8 then c&yr.o14=.; if c&yr.o15 eq 8 then c&yr.o15=.; if c&yr.o16 eq 8 then c&yr.o16=.; if c&yr.o17 eq 8 then c&yr.o17=.; if c&yr.o18 eq 8 then c&yr.o18=.; if c&yr.o18 eq 5 then c&yr.o18=.; misssup=nmiss(c&yr.o8,c&yr.o11,c&yr.o12,c&yr.o13,c&yr.o17); sch&yr.sup=mean(c&yr.o8,c&yr.o11,c&yr.o12,c&yr.o13,c&yr.o17); if misssup gt 2 then schsup=.; label sch&yr.sup="Y&yr. Child - Supervision-Involvement"; sch&yr.dda=(c&yr.o1+c&yr.o2)/2; if c&yr.o1 eq . or c&yr.o2 eq . then schdda=.; label sch&yr.dda="Y&yr. Child - Discussing Daily Activities"; sch&yr.ct=(c&yr.o4+c&yr.o6)/2; if c&yr.o4 eq . or c&yr.o6 eq . then schct=.; label sch&yr.ct="Y&yr. Child - Curfew Time"; keep cohort site sitecode tcid c&yr.o1--c&yr.o4 c&yr.o6 c&yr.o8--c&yr.o18 sch&yr.sup sch&yr.dda sch&yr.ct; run;