Appendix: SAS Program %let yr = xx; libname sasin "I:\datacenter\SASDATA\Datasets\Child\feelingsaboutneighborhood\U"; libname sasout "I:\datacenter\SASDATA\Datasets\Child\ feelingsaboutneighborhood\S"; %macro linmean; data &INDATA; set &INDATA; label &var_name = "&var_labl"; array sumvars {*} &var_list; if n(of sumvars(*))>=.5*dim(sumvars) then &var_name=mean(of sumvars(*)); proc sort; by site tcid; run; %mend linmean; data one; set sasin.c&yr.az; C&YR.AZ10R=6-C&YR.AZ10; array one (*) C&yr.AZ5 C&yr.AZ6 C&yr.AZ7 C&yr.AZ8 C&yr.AZ9 C&yr.AZ10r C&yr.AZ11 C&yr.AZ12 C&yr.AZ13 C&yr.AZ14; array two (*) C&yr.AZ5s C&yr.AZ6s C&yr.AZ7s C&yr.AZ8s C&yr.AZ9s C&yr.AZ10rs C&yr.AZ11s C&yr.AZ12s C&yr.AZ13s C&yr.AZ14s ; do i=1 to dim(two); two(i)=one(i); end ; drop i; run; proc standard mean=0 std=1 data=one out=two; var C&yr.AZ5s C&yr.AZ6s C&yr.AZ7s C&yr.AZ8s C&yr.AZ9s C&yr.AZ10rs C&yr.AZ11s C&yr.AZ12s C&yr.AZ13s C&yr.AZ14s; run; data sasout.FAN&yr.; set two; label C&yr.AZ5s ="Std-You have a sense of belonging to your neighborhood." C&yr.AZ6s ="Std-You feel loyal to the people in your neighborhood." C&yr.AZ7s ="Std-You would be willing to work together with others on something to improve your neighborhood." C&yr.AZ8s ="Std-You like to think of yourself as similar to the people who live in this neighborhood." C&yr.AZ9s ="Std-Overall, you are happy living in this neighborhood." C&yr.AZ10rs ="Std-Reversed Given the opportunity, you would like to move out of this neighborhood." C&yr.AZ11s ="Std-People in your neighborhood look out for each other." C&yr.AZ12s ="Std-If a group of kids in your neighborhood were skipping school and hanging out on a street corner, how likely is it that your neighbors would do something about it?" C&yr.AZ13s ="Std-If some kids were spray-painting graffiti on a local house or building, how likely is it that your neighbors would do something about it?" C&yr.AZ14s ="Std-If a kid was showing disrespect to an adult, how likely is it that people in your neighborhood would scold or reprimand him or her?" C&yr.AZ10r ="Reversed-Given the opportunity, you would like to move out of this neighborhood." ;run; %let INDATA = sasout.FAN&yr.; %let var_name = FAN&yr.CEF; %let var_labl = %str(Collective Efficacy-FAN-Year &yr.) ; %let var_list = %str(C&yr.AZ5s C&yr.AZ6s C&yr.AZ7s C&yr.AZ8s C&yr.AZ9s C&yr.AZ10rs C&yr.AZ11s C&yr.AZ12s C&yr.AZ13s C&yr.AZ14s); %linmean; proc sort;by cohort site tcid;run;