****************FAST Track Project ****************************** * Program: thmxscx.sas * * Programmer: Bobby Laird * * Date: 12/13/96 * * Purpose: Program reads cxf elem. datasets and * * scores the Things that Happen to Me * * items as described in the technical report. * * * * Notes: This program is set up to be run on any * * cohort and any year with minor modifications. * * * * Modified: 11/12/01 Pat Malone to run off aggregated datasets* * 03/07/03 Anne Corrigan for local libnames & * * scoring year 4 data. * * Inputs: cxf elem. datasets * * * * Outputs: thmx scored datasets * * * *****************************************************************; **Fill out information in next section for data processed ** **in this run. **; /* %let source=Child; */ /*uncomment if needed*/ %let src=c; %let inst=f; /* %let longname=thingsthathappen; */ /*uncomment if needed */ %let scoredname=THM; /* **Enter high-level path (e.g., l:\datasets) **; %let path=d:\datasets; */ **Enter year of data collection **; %let yr=4; **Enter variable which must be present to retain record (typically interviewer id) **; /* %let screen=intid; */ /* uncomment if needed */ **Specify Lib for input datasets **; Libname SASIN "d:\sasdata\thm&yr.DataAll"; **Specify Lib for output datasets **; Libname SASOUT "d:\sasdata\thm&yr.DataAll"; ****** DO NOT MODIFY BELOW THIS LINE **************; data SASOUT.&scoredname.&yr.sc1; set SASIN.&src.&yr.&inst; /* if &screen ne ''; */ if (c&yr.fth4=1) then c&yr.fth4 = 0; else if (c&yr.fth4 = 0) then c&yr.fth4 = 1; /* Assertive Instrumental */ c&yr.fasin= sum(c&yr.fth1, c&yr.fth8, c&yr.fth15,c&yr.fth22,c&yr.fth29, c&yr.fth39, c&yr.fth43, c&yr.fth50); /* Assertive Friendship */ c&yr.fasfr= sum(c&yr.fth2, c&yr.fth9, c&yr.fth16,c&yr.fth23,c&yr.fth30, c&yr.fth40,c&yr.fth44,c&yr.fth51); /* Assertive Liking */ c&yr.faslk= sum(c&yr.fth3, c&yr.fth10,c&yr.fth17,c&yr.fth24,c&yr.fth31, c&yr.fth41,c&yr.fth45,c&yr.fth52); /* Aggressive Instrumental */ c&yr.fagin= sum(c&yr.fth4, c&yr.fth11,c&yr.fth18,c&yr.fth25,c&yr.fth32, c&yr.fth36,c&yr.fth46,c&yr.fth53); /* Aggressive Friendship */ c&yr.fagfr= sum(c&yr.fth5, c&yr.fth12,c&yr.fth19,c&yr.fth24,c&yr.fth33, c&yr.fth37,c&yr.fth47,c&yr.fth54); /* Aggressive Liking */ c&yr.faglk= sum(c&yr.fth6, c&yr.fth13,c&yr.fth20,c&yr.fth25,c&yr.fth34, c&yr.fth38,c&yr.fth48,c&yr.fth55); /* Relationship Goals - Not reported. Used to calculate c&yr.frgoal */ c&yr.frelg= sum(c&yr.fth7, c&yr.fth14,c&yr.fth21,c&yr.fth28,c&yr.fth35, c&yr.fth42,c&yr.fth49,c&yr.fth56); /* Create composite scores and labels */ /* Assertive Endorsement */ c&yr.fasend= sum(c&yr.fth1, c&yr.fth8, c&yr.fth15,c&yr.fth22,c&yr.fth29, c&yr.fth36,c&yr.fth43,c&yr.fth50, c&yr.fth2, c&yr.fth9, c&yr.fth16,c&yr.fth23,c&yr.fth30, c&yr.fth40,c&yr.fth44,c&yr.fth51, c&yr.fth3, c&yr.fth10,c&yr.fth17,c&yr.fth24,c&yr.fth31, c&yr.fth41,c&yr.fth45,c&yr.fth52); /* Aggressive Endorsement */ c&yr.fagend= sum(c&yr.fth4, c&yr.fth11,c&yr.fth18,c&yr.fth25,c&yr.fth32, c&yr.fth36,c&yr.fth46,c&yr.fth53, c&yr.fth5, c&yr.fth12,c&yr.fth19,c&yr.fth24,c&yr.fth33, c&yr.fth37,c&yr.fth47,c&yr.fth54, c&yr.fth6, c&yr.fth13,c&yr.fth20,c&yr.fth25,c&yr.fth34, c&yr.fth38,c&yr.fth48,c&yr.fth55); /* Instrumental Self-Efficacy */ c&yr.fise= sum(c&yr.fth1, c&yr.fth8, c&yr.fth15,c&yr.fth22,c&yr.fth29, c&yr.fth39,c&yr.fth43,c&yr.fth50, c&yr.fth4, c&yr.fth11,c&yr.fth18,c&yr.fth25,c&yr.fth32, c&yr.fth36,c&yr.fth46,c&yr.fth53); /* Friendship Confidence */ c&yr.ffrcon= sum(c&yr.fth2, c&yr.fth9, c&yr.fth16,c&yr.fth23,c&yr.fth30, c&yr.fth40,c&yr.fth44,c&yr.fth51, c&yr.fth5, c&yr.fth12,c&yr.fth19,c&yr.fth24,c&yr.fth33, c&yr.fth37,c&yr.fth47,c&yr.fth54); /* Liking Confidence */ c&yr.flkcon= sum(c&yr.fth3, c&yr.fth10,c&yr.fth17,c&yr.fth24,c&yr.fth31, c&yr.fth41,c&yr.fth45,c&yr.fth52, c&yr.fth6, c&yr.fth13,c&yr.fth20,c&yr.fth25,c&yr.fth34, c&yr.fth38,c&yr.fth48,c&yr.fth55); /* nonaggressive Instrumental Endorsement */ c&yr.fnagie= (c&yr.fasin - c&yr.fagin); /* nonaggressive Friendship Endorsement */ c&yr.fnagfe= (c&yr.fasfr - c&yr.fagfr); /* nonaggressive Liking Endorsement */ c&yr.fnagle= (c&yr.faslk - c&yr.faglk); /* Endorsement of nonaggression */ c&yr.fendna=((c&yr.fth1 +c&yr.fth8 +c&yr.fth15+c&yr.fth22+c&yr.fth29+ c&yr.fth39+c&yr.fth43+c&yr.fth50+ c&yr.fth2+ c&yr.fth9+ c&yr.fth16+c&yr.fth23+c&yr.fth30+ c&yr.fth40+c&yr.fth44+c&yr.fth51+ c&yr.fth3+ c&yr.fth10+c&yr.fth17+c&yr.fth24+c&yr.fth31+ c&yr.fth41+c&yr.fth45+c&yr.fth52) - (c&yr.fth4+ c&yr.fth11+c&yr.fth18+c&yr.fth25+c&yr.fth32+ c&yr.fth36+c&yr.fth46+c&yr.fth53+ c&yr.fth5+ c&yr.fth12+c&yr.fth19+c&yr.fth24+c&yr.fth33+ c&yr.fth37+c&yr.fth47+c&yr.fth54+ c&yr.fth6+ c&yr.fth13+c&yr.fth20+c&yr.fth25+c&yr.fth34+ c&yr.fth38+c&yr.fth48+c&yr.fth55)); /* Goal Optimism Sum Score */ c&yr.fgopt =(c&yr.fth1 +c&yr.fth8 +c&yr.fth15+c&yr.fth22+c&yr.fth29+ c&yr.fth39+c&yr.fth43+c&yr.fth50+ c&yr.fth2+ c&yr.fth9+ c&yr.fth16+c&yr.fth23+c&yr.fth30+ c&yr.fth40+c&yr.fth44+c&yr.fth51+ c&yr.fth3+ c&yr.fth10+c&yr.fth17+c&yr.fth24+c&yr.fth31+ c&yr.fth41+c&yr.fth45+c&yr.fth52+ c&yr.fth4+ c&yr.fth11+c&yr.fth18+c&yr.fth25+c&yr.fth32+ c&yr.fth36+c&yr.fth46+c&yr.fth53+ c&yr.fth5+ c&yr.fth12+c&yr.fth19+c&yr.fth24+c&yr.fth33+ c&yr.fth37+c&yr.fth47+c&yr.fth54+ c&yr.fth6+ c&yr.fth13+c&yr.fth20+c&yr.fth25+c&yr.fth34+ c&yr.fth38+c&yr.fth48+c&yr.fth55); /* Create another variable for Relationship Goals that adds one for a Social goal (more important if I am liked) and subtracts one for an instrumental goal (more important if I get what I want). */ array relg {8} c&yr.fth7 c&yr.fth14 c&yr.fth21 c&yr.fth28 c&yr.fth35 c&yr.fth42 c&yr.fth49 c&yr.fth56; c&yr.frgoal= 0; goalmiss= 0; do I = 1 to 8; if RELG {I} = 2 then c&yr.frgoal +1; else if RELG {I} = 1 then c&yr.frgoal=(c&yr.frgoal -1); else goalmiss +1; end; * If fewer than 25% missing, missing = 0 and does * * not affect total RGOAL score * * if more than 25% missing, RGOAL var set to missing *; /* original: 25percent -- changed to 50percent below */ /* if goalmiss/8 > .25 then c&yr.frgoal= .; */ if goalmiss/8 > .50 then c&yr.frgoal= .; **** RENAMING to match new variable naming scheme *****; thm&yr.sin= c&yr.fasin ; thm&yr.sfr = c&yr.fasfr ; thm&yr.slk = c&yr.faslk ; thm&yr.gin = c&yr.fagin ; thm&yr.gfr = c&yr.fagfr ; thm&yr.glk = c&yr.faglk ; thm&yr.rlg = c&yr.frelg ; thm&yr.sen = c&yr.fasend ; thm&yr.gen = c&yr.fagend ; thm&yr.ise = c&yr.fise ; thm&yr.fcn = c&yr.ffrcon; thm&yr.lcn = c&yr.flkcon; thm&yr.nie = c&yr.fnagie; thm&yr.nfe = c&yr.fnagfe; thm&yr.nle = c&yr.fnagle; thm&yr.ena = c&yr.fendna; thm&yr.gop = c&yr.fgopt; thm&yr.gol = c&yr.frgoal; label c4fth1="Story 1, Assert1-say: go to line end" c4fth2="Story 1, Assert2-be your friend" c4fth3="Story 1, Assert3-others like you" c4fth4="Story 1, Aggres1-push out of line" c4fth5="Story 1, Aggres2-be your friend" c4fth6="Story 1, Aggres3-others like you" c4fth7="Story 1, OutcomeImport" c4fth8="Story 2, Assert1-say: dont change channel" c4fth9="Story 2, Assert2-be your friend" c4fth10="Story 2, Assert3-others like you" c4fth11="Story 2, Aggres1-say: Ill hit you" c4fth12="Story 2, Aggres2-be your friend" c4fth13="Story 2, Aggres3-others like you" c4fth14="Story 2, Outcome Import" c4fth15="Story 3, Assert1-say: can I play" c4fth16="Story 3, Assert2-be your friend" c4fth17="Story 3, Assert3-others like you" c4fth18="Story 3, Aggres1-say: you better let me" c4fth19="Story 3, Aggres2-be your friend" c4fth20="Story 3, Aggres3-others like you" c4fth21="Story 3, Outcome Import" c4fth22="Story 4, Assert1-say: not fair" c4fth23="Story 4, Assert2-be your friend" c4fth24="Story 4, Assert3-others like you" c4fth25="Story 4, Aggres1-say: Ill hit you" c4fth26="Story 4, Aggres2-be your friend" c4fth27="Story 4, Aggres3-others like you" c4fth28="Story 4, Outcome Import" c4fth29="Story 5, Assert1-say: not fair." c4fth30="Story 5, Assert2-be your friend" c4fth31="Story 5, Assert3-others like you" c4fth32="Story 5, Aggres1-push, grab ball" c4fth33="Story 5, Aggres2-be your friend" c4fth34="Story 5, Aggres3-others like you" c4fth35="Story 5, Outcome Import" c4fth36="Story 6, Aggres1-move game piece ahead" c4fth37="Story 6, Aggres2-be your friend" c4fth38="Story 6, Aggres3-others like you" c4fth39="Story 6, Assert1-say: Ill get lucky" c4fth40="Story 6, Assert2-be your friend" c4fth41="Story 6, Assert3-others like you" c4fth42="Story 6, Outcome Import" c4fth43="Story 7, Assert1-say: we both play" c4fth44="Story 7, Assert2-be your friend" c4fth45="Story 7, Assert3-others like you" c4fth46="Story 7, Aggres1-grab Nintendo" c4fth47="Story 7, Aggres2-be your friend" c4fth48="Story 7, Aggres3-others like you" c4fth49="Story 7, Outcome Import" c4fth50="Story 8, Assert1-say: sit there tomorrow" c4fth51="Story 8, Assert2-be your friend" c4fth52="Story 8, Assert3-others like you" c4fth53="Story 8, Aggres1-push to get seat" c4fth54="Story 8, Aggres2-be your friend" c4fth55="Story 8, Aggres3-others like you" c4fth56="Story 8, Outcome Import" thm&yr.sin= "Assertive Instrumental Y&yr." thm&yr.sfr = "Assertive Friendship Y&yr." thm&yr.slk = "Assertive Liking Y&yr." thm&yr.gin = "Aggressive Instrumental Y&yr." thm&yr.gfr = "Aggressive Friendship Y&yr." thm&yr.glk = "Aggressive Liking Y&yr." thm&yr.rlg = "Relationship Goals Y&yr." thm&yr.sen = "Assertive Endorsement Y&yr." thm&yr.gen = "Aggressive Endorsement Y&yr." thm&yr.ise = "Instrumental Self-Efficacy Y&yr." thm&yr.fcn = "Friendship Confidence Y&yr." thm&yr.lcn = "Liking Confidence Y&yr." thm&yr.nie = "nonaggress Instrumental Endorsement Y&yr." thm&yr.nfe = "nonaggressive Friendship Endorsement Y&yr." thm&yr.nle = "nonaggressive Liking Endorsement Y&yr." thm&yr.ena = "Endorsement of nonaggression Y&yr." thm&yr.gop = "Goal Optimism Sum Score Y&yr." thm&yr.gol = "Relationship Goals Y&yr."; keep tcid site treatmnt norm c&yr.fth1-c&yr.fth56 thm&yr.sin thm&yr.sfr thm&yr.slk thm&yr.gin thm&yr.gfr thm&yr.glk thm&yr.rlg thm&yr.sen thm&yr.gen thm&yr.ise thm&yr.fcn thm&yr.lcn thm&yr.nie thm&yr.nfe thm&yr.nle thm&yr.ena thm&yr.gop thm&yr.gol; run;