PROGRAM TSCxSCx PROGRAMMER Mary Gifford-Smith PURPOSE Create a SAS data set containing derived variables from the TxH data sets (Teacher- rated Social Competence-Revised). Program can be modified to process TxH data from any cohorts, beginning in Year 5 (first year measure was given) by setting several parameters at beginning of program. INPUT Datasets containing elemental SAS variables for each site (xTxHx). OUTPUT SAS dataset containing the derived variables. ; Fill out information in next section for data processed in this run. ; Name lib holding SAS data infiles ; libname SASIN 'jfastracktech_rptsocomptrraw'; Specify Lib for output data sets; libname SASOUT 'jfastracktech_rptsocomptrsas'; Enter Cohort Number; %let coh=1; Enter year of data collection; %let yr=5; DO NOT MODIFY BELOW THIS LINE; data temp; set SASIN.DT&yr.H&coh. SASIN.NT&yr.H&coh. SASIN.PT&yr.H&coh. SASIN.ST&yr.H&coh. ; data temp2; set temp; Reverse scoring items for consistency; if T&yr.HCF4A=0 then T&yr.HCF4AR=5; if T&yr.HCF4A=1 then T&yr.HCF4AR=4; if T&yr.HCF4A=2 then T&yr.HCF4AR=3; if T&yr.HCF4A=3 then T&yr.HCF4AR=2; if T&yr.HCF4A=4 then T&yr.HCF4AR=1; if T&yr.HCF4A=5 then T&yr.HCF4AR=0; if T&yr.HCF5A=0 then T&yr.HCF5AR=5; if T&yr.HCF5A=1 then T&yr.HCF5AR=4; if T&yr.HCF5A=2 then T&yr.HCF5AR=3; if T&yr.HCF5A=3 then T&yr.HCF5AR=2; if T&yr.HCF5A=4 then T&yr.HCF5AR=1; if T&yr.HCF5A=5 then T&yr.HCF5AR=0; if T&yr.HCF6A=0 then T&yr.HCF6AR=5; if T&yr.HCF6A=1 then T&yr.HCF6AR=4; if T&yr.HCF6A=2 then T&yr.HCF6AR=3; if T&yr.HCF6A=3 then T&yr.HCF6AR=2; if T&yr.HCF6A=4 then T&yr.HCF6AR=1; if T&yr.HCF6A=5 then T&yr.HCF6AR=0; label T&yr.HCF4Ar=gets angry when provoked, recoded; label T&yr.HCF5Ar=easily irritated when troubled by task, recoded; label T&yr.HCF6Ar=shows physical and verbal aggression, recoded; data temp3; set temp2; compute the overall social competence score; Dealing with missing values; array A[17] t&yr.hac1a t&yr.hac2a t&yr.hac3a t&yr.hac4a t&yr.hac5a t&yr.hcf1a t&yr.hcf2a t&yr.hcf3a t&yr.hcf4ar t&yr.hcf5ar t&yr.hcf6ar t&yr.hcf7a t&yr.hpb1a t&yr.hpb2a t&yr.hpb3a t&yr.hpb4a t&yr.hpb5a ; count1=0; sum1=sum(of A[]); do i=1 to 17; if A[i]=' ' then count1=count1+1; end; drop i; do i=1 to 17; if count1 le 9 then if A[i]= then A[i]=sum1(17-count1); end; drop i; TSC&yr.COMP=(t&yr.hac1a+t&yr.hac2a+t&yr.hac3a+t&yr.hac4a+ t&yr.hac5a+t&yr.hcf1a+t&yr.hcf2a+t&yr.hcf3a+t&yr.hcf4ar+t&yr.hcf5ar+ t&yr.hcf6ar+t&yr.hcf7a+t&yr.hpb1a+t&yr.hpb2a+t&yr.hpb3a+t&yr.hpb4a+t&yr.hpb5a)17; label TSC&yr.COMP='Teacher rated social competence summary score'; compute the overall change in social competence; Dealing with missing values; array B[17] t&yr.hac1b t&yr.hac2b t&yr.hac3b t&yr.hac4b t&yr.hac5b t&yr.hcf1b t&yr.hcf2b t&yr.hcf3b t&yr.hcf4b t&yr.hcf5b t&yr.hcf6b t&yr.hcf7b t&yr.hpb1b t&yr.hpb2b t&yr.hpb3b t&yr.hpb4b t&yr.hpb5b; count2=0; sum2=sum(of B[]); do i=1 to 17; if B[i]=' ' then count2=count2+1; end; drop i; do i=1 to 17; if count2 le 9 then if B[i]= then B[i]=sum2(17-count1); end; drop i; TSC&yr.CHNG=(t&yr.hac1b+t&yr.hac2b+t&yr.hac3b+t&yr.hac4b+ t&yr.hac5b+t&yr.hcf1b+t&yr.hcf2b+t&yr.hcf3b+t&yr.hcf4b+t&yr.hcf5b+ t&yr.hcf6b+t&yr.hcf7b+t&yr.hpb1b+t&yr.hpb2b+t&yr.hpb3b+t&yr.hpb4b+t&yr.hpb5b)17; label TSC&yr.CHNG='total change in social competence'; compute academic skills subscale; Dealing with missing values; array C[5] t&yr.hac1a t&yr.hac2a t&yr.hac3a t&yr.hac4a t&yr.hac5a; count1=0; sum1=sum(of C[]); do i=1 to 5; if C[i]=' ' then count1=count1+1; end; drop i; do i=1 to 5; if count1 le 3 then if C[i]= then C[i]=sum1(5-count1); end; drop i; TSC&yr.AC=(t&yr.hac1a+t&yr.hac2a+t&yr.hac3a+t&yr.hac4a+ t&yr.hac5a)5; label TSC&yr.AC='Teacher rated academic skills'; compute the emotional regulation subscale; Dealing with missing values; array D[5] t&yr.hcf1a t&yr.hcf3a t&yr.hcf4ar t&yr.hcf5ar t&yr.hcf6ar; count1=0; sum1=sum(of D[]); do i=1 to 5; if D[i]=' ' then count1=count1+1; end; drop i; do i=1 to 5; if count1 le 3 then if D[i]= then D[i]=sum1(5-count1); end; drop i; TSC&yr.CF=(t&yr.hcf1a+t&yr.hcf3a+t&yr.hcf4ar+t&yr.hcf5ar+ t&yr.hcf6ar)5; label TSC&yr.CF='Teacher rated emotional regulation'; compute the prosocial behavior subscale; Dealing with missing values; array E[7] t&yr.hcf2a t&yr.hcf7a t&yr.hpb1a t&yr.hpb2a t&yr.hpb3a t&yr.hpb4a t&yr.hpb5a ; count1=0; sum1=sum(of E[]); do i=1 to 7; if E[i]=' ' then count1=count1+1; end; drop i; do i=1 to 7; if count1 le 4 then if E[i]= then E[i]=sum1(7-count1); end; drop i; TSC&yr.PB=(t&yr.hcf2a+t&yr.hcf7a+t&yr.hpb1a+t&yr.hpb2a+ t&yr.hpb3a+t&yr.hpb4a+t&yr.hpb5a)7; label TSC&yr.PB='Teacher rated prosocial behavior'; compute the summated prosocialemotion regulation scale; dealing with missing values; array F[12] t&yr.hcf1a t&yr.hcf3a t&yr.hcf4ar t&yr.hcf5ar t&yr.hcf6ar t&yr.hcf2a t&yr.hcf7a t&yr.hpb1a t&yr.hpb2a t&yr.hpb3a t&yr.hpb4a t&yr.hpb5a; count1=0; sum1=sum(of F[]); do i=1 to 12; if F[i]=' ' then count1=count1+1; end; drop i; do i=1 to 12; if count1 le 6 then if F[i]= then F[i]=sum1(12-count1); end; drop i; TSC&yr.SOC=(t&yr.hcf1a+t&yr.hcf3a+t&yr.hcf4ar+t&yr.hcf5ar+ t&yr.hcf6ar+t&yr.hcf2a+t&yr.hcf7a+t&yr.hpb1a+t&yr.hpb2a+ t&yr.hpb3a+t&yr.hpb4a+t&yr.hpb5a)12; label TSC&yr.SOC='Teacher rated prosocialemotional regulation skills'; computing subscales reflecting improvement over time; compute academic skills subscale; Dealing with missing values; array G[6] t&yr.hac1b t&yr.hac2b t&yr.hac3b t&yr.hac4b t&yr.hac5b t&yr.hcf5b; count1=0; sum1=sum(of G[]); do i=1 to 6; if G[i]=' ' then count1=count1+1; end; drop i; do i=1 to 6; if count1 le 3 then if G[i]= then G[i]=sum1(6-count1); end; drop i; TSC&yr.ACI=(t&yr.hac1b+t&yr.hac2b+t&yr.hac3b+t&yr.hac4b+ t&yr.hac5b+t&yr.hcf5b)6; label TSC&yr.ACI='Teacher rated improvement in academic skills'; compute the improvement in emotional regulation subscale; Dealing with missing values; array H[6] t&yr.hcf1b t&yr.hcf2b t&yr.hcf3b t&yr.hcf4b t&yr.hcf6b t&yr.hcf7b; count1=0; sum1=sum(of H[]); do i=1 to 6; if H[i]=' ' then count1=count1+1; end; drop i; do i=1 to 6; if count1 le 4 then if H[i]= then H[i]=sum1(6-count1); end; drop i; TSC&yr.CFI=(t&yr.hcf1b+t&yr.hcf2b+t&yr.hcf3b+ t&yr.hcf4b+t&yr.hcf6b+t&yr.hcf7b)6; label TSC&yr.CFI='Teacher rated improvement in emotional regulation'; compute the prosocial behavior subscale; Dealing with missing values; array J[5] t&yr.hpb1b t&yr.hpb2b t&yr.hpb3b t&yr.hpb4b t&yr.hpb5b ; count1=0; sum1=sum(of J[]); do i=1 to 5; if J[i]=' ' then count1=count1+1; end; drop i; do i=1 to 5; if count1 le 3 then if J[i]= then J[i]=sum1(5-count1); end; drop i; TSC&yr.PBI=(t&yr.hpb1b+t&yr.hpb2b+ t&yr.hpb3b+t&yr.hpb4b+t&yr.hpb5b)5; label TSC&yr.PBI='Teacher rated improved prosocial behavior'; compute the prosocialemotion regulation subscale; dealing with missing values; array K[12] t&yr.hcf1b t&yr.hcf3b t&yr.hcf4b t&yr.hcf5b t&yr.hcf6b t&yr.hcf2b t&yr.hcf7b t&yr.hpb1b t&yr.hpb2b t&yr.hpb3b t&yr.hpb4b t&yr.hpb5b; count1=0; sum1=sum(of K[]); do i=1 to 12; if K[i]=' ' then count1=count1+1; end; drop i; do i=1 to 12; if count1 le 6 then if K[i]= then K[i]=sum1(12-count1); end; drop i; TSC&yr.SOCI=(t&yr.hcf1b+t&yr.hcf3b+t&yr.hcf4b+t&yr.hcf5b+ t&yr.hcf6b+t&yr.hcf2a+t&yr.hcf7b+t&yr.hpb1b+t&yr.hpb2b+ t&yr.hpb3b+t&yr.hpb4b+t&yr.hpb5b)12; label TSC&yr.SOCI='Teacher rated improvement in prosocialemotional regulation skills'; data SASOUT.TSC&yr.SC&coh; set temp3; run; proc contents; run;