*********************************************************************; *Program:PCP.sas *Programmer: Cari McCarty *Date 1/26/01 *Purpose: to score the PxX dataset (Parent-Child Communication Parent) *Modified: to work more generically for aggregated datasets - Cindy Rains 1/21/04 Jennifer Godwin 8/25/04 **********************************************************************; **Enter year of data collection **; %let yr=5; Libname SASIN "N:\Datasets\Parent\parentchildcommunication\U"; Libname SASOUT "N:\Datasets\Parent\parentchildcommunication\S"; ****** DO NOT MODIFY BELOW THIS LINE **************; *when calculating the mean; %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 pcp; set sasin.p&yr.x_c; **Reverse-scoring**; P&yr.XC11r=6-P&yr.XC11; P&yr.XC12r=6-P&yr.XC12; P&yr.XC15r=6-P&yr.XC15; label P&yr.XC1="You can discuss your beliefs with your child without embarrassment" P&yr.XC2="Your child is a good listener" P&yr.XC3="Your child can tell how you feel" P&yr.XC4="You are satisfied with how your child talks with you" P&yr.XC5="Your child tries to understand your point of view" P&yr.XC6="You do not discuss certain things with your child" P&yr.XC7="You discuss child-related problems with your child" P&yr.XC8="Your child insults you when angry" P&yr.XC9="You can tell your child how you really feel" P&yr.XC10="Your child tells you about personal problems" P&yr.XC11="Your child keeps feelings to self" P&yr.XC12="Your child hides being angry" P&yr.XC13="You encourage your child to think and talk about things" P&yr.XC14="When your child is upset it is difficult to understand his/her feelings" P&yr.XC15="Your child lets things pile up without dealing with them" P&yr.XC16="Your child lets you know what is bothering him/her" P&yr.XC17="You do not discuss certain topics with your child" P&yr.XC18="Your child admits mistakes without hiding them" P&yr.XC19="You allow your child to have a say even if you disagree" P&yr.XC20="You and your child come to solutions about problems" P&yr.XC11r="Your child keeps his/her feelings to self--reversed" P&yr.XC12r="Your child hides being angry--reversed" P&yr.XC15r="Your child lets things pile up without dealing with them--reversed"; run; /* Specify definitions for SCALE VARIABLES below: ** */ %let INDATA = pcp; ************************************************************; %let var_name = PCP&yr.PAC ; %let var_labl = %str(PCP Parent Communication - PCP Y&yr.) ; %let var_list = %str(P&yr.XC1 P&yr.XC4 P&yr.XC7 P&yr.XC9 P&yr.XC13 P&yr.XC20) ; %linmean; ************************************************************; %let var_name = PCP&yr.PRT ; %let var_labl = %str(PCP Parent Restricted Topics - PCP Y&yr.) ; %let var_list = %str(P&yr.XC6 P&yr.XC17) ; %linmean; ************************************************************; %let var_name = PCP&yr.CEL ; %let var_labl = %str(PCP Child Empathy/Listening - PCP Y&yr.) ; %let var_list = %str(P&yr.XC2 P&yr.XC3 P&yr.XC5) ; %linmean; ************************************************************; %let var_name = PCP&yr.CEE ; %let var_labl = %str(PCP Child Emotional Expression - PCP Y&yr.) ; %let var_list = %str(P&yr.XC10 P&yr.XC11r P&yr.XC12r P&yr.XC15r P&yr.XC16) ; %linmean; ************************************************************; data sasout.PCP&yr.; set pcp; run; proc sort; by cohort site tcid;run;