* Encoding: UTF-8. ==== "Please name the datasfile: NZAVS Breakups and Wellbeing Cross et al 2019. ==== "Contents "1. Labelling Data NOTE; Once the data is extracted using the Mplus Syntax the data needs to be labelled before analyses can be run. Variable Labelling missing variables Eyeball data/Run decriptives "2. Creating datafile with PSM (2a) NOTE: Non-numeral Analyse are not allowed to be matching variables in SPSS Built in PS matching command therefore all grouping variables ('nominal' variables) need to be changed to be 'scale'. This includes the following variables) (2b) NOTE: Once this is done I suggest you REORDER the dataset as follows, Identifying variable, Relationhip transition variable, demographic variables, pre scores, post scores. This ordering makes PS matching easier (2c). Propsensity score matching (2d). Centering Continuous Variables (2e). creating interactions "3A. Analyses The Main and Moderated Effects of Relationship Breakups on Social Support, Personal Wellbeing and Life Satisfaction (Moderated by Self-Esteem). (1) Main effects (2) Moderated by Self-Esteem "3B. Additional Anlyses (1) Table SM1. Moderating effects of Relationship Satisfaction and Relationship Length. ===== NOTE; Once the data is extracted using the Mplus Syntax the data needs to be labelled before analyses can be run. 1. Labelling Data "renaming Variables "Note in MPLUS output at the end of teh syntax it lists the order of varaibles careful if recreating syntax to ensure that the order matches the MPLUS output. RENAME VARIABLES V1 = DRAW_AGE. EXECUTE. RENAME VARIABLES V2 = DRAW_LEN. EXECUTE. RENAME VARIABLES V3 = DRAW_SEI. EXECUTE. RENAME VARIABLES V4 = DRAW_GEN. EXECUTE. RENAME VARIABLES V5 = DRAW_MAO. EXECUTE. RENAME VARIABLES V6 = DRAW_PAC. EXECUTE. RENAME VARIABLES V7 = DRAW_ASN. EXECUTE. RENAME VARIABLES V8 = DRAW_BRN. EXECUTE. RENAME VARIABLES V9 = DRAW_SAT. EXECUTE. RENAME VARIABLES V10 = Extra_PRE. EXECUTE. RENAME VARIABLES V11 = Extra_POST. EXECUTE. RENAME VARIABLES V12 = Agree_PRE. EXECUTE. RENAME VARIABLES V13 = Agree_POST. EXECUTE. RENAME VARIABLES V14 = Cons_PRE. EXECUTE. RENAME VARIABLES V15 = Cons_POST. EXECUTE. RENAME VARIABLES V16 = Neuro_PRE. EXECUTE. RENAME VARIABLES V17 = Neuro_POST. EXECUTE. RENAME VARIABLES V18 = Open_PRE. EXECUTE. RENAME VARIABLES V19 = Open_POST. EXECUTE. RENAME VARIABLES V20 = HonHum_PRE. EXECUTE. RENAME VARIABLES V21 = HonHum_POST. EXECUTE. RENAME VARIABLES V22 = SE_PRE. EXECUTE. RENAME VARIABLES V23 = SE_POST. EXECUTE. RENAME VARIABLES V24 = SWL_PRE. EXECUTE. RENAME VARIABLES V25 = SWL_POST. EXECUTE. RENAME VARIABLES V26 = PWI_PRE. EXECUTE. RENAME VARIABLES V27 = PWI_POST. EXECUTE. RENAME VARIABLES V28 = SUPPORT_PRE. EXECUTE. RENAME VARIABLES V29 = SUPPORT_POST. EXECUTE. RENAME VARIABLES V30 = DRAWFROM. EXECUTE. RENAME VARIABLES V31 = Questionnaire.Num. EXECUTE. RENAME VARIABLES V32 = BREAK. EXECUTE. "Variable Labelling *Age at timepoint drawn from VARIABLE LABELS DRAW_AGE 'Age of Participant at time their data was drawn. i.e. pre scores'. EXECUTE. *Relationship Length VARIABLE LABELS DRAW_LEN 'Relationship Length (Years) at time their data was drawn'. EXECUTE. *socioeconomic VARIABLE LABELS DRAW_SEI 'New Zealand socioeconomic index; uses age, education, occupation to calculate a score ranging from 10 to 90, higher values indicate higher socioeconomic status (Milne, Byun, & Lee,2013)'. EXECUTE. *Gender (Dicotious VARIABLE LABELS DRAW_GEN 'Gender Dicotomous Female/Male, 0 = Female, 1 = Man'. EXECUTE. VALUE LABELS DRAW_GEN '0' 'Female' '1' 'Man'. *Ethnic identification (dicotimous) VARIABLE LABELS DRAW_MAO 'Ethnic Idenitication: MAORI. 0 non-Maori,1 Maori'. EXECUTE. VALUE LABELS DRAW_MAO '0' 'Non-Maori' '1' 'Maori'. VARIABLE LABELS DRAW_PAC 'Ethnic Idenitication: PACIFIC .0 non-Pacific,1 Pacific'. EXECUTE. VALUE LABELS DRAW_PAC '0' 'Non-Pacific' '1' 'Pacific'. VARIABLE LABELS DRAW_ASN 'Ethnic Idenitication: ASIAN. 0 non-Asian,1 Asian'. EXECUTE. VALUE LABELS DRAW_ASN '0' 'Non-Asian' '1' 'Asian'. VARIABLE LABELS DRAW_BRN 'Place of Birth: Born in New Zealand 0 no, 1 yes'. EXECUTE. VALUE LABELS DRAW_BRN '0' 'not born in NZ' '1' 'Born in NZ'. *Relationship Satisfaction VARIABLE LABELS DRAW_SAT 'How satisfied are you with your relationship 1 = not satisfied, 7 very satisfied'. EXECUTE. *Big 6 Personality VARIABLE LABELS Extra_PRE 'Big 6 Personality; Extraversion Pre Breakup/not'. EXECUTE. VARIABLE LABELS Extra_POST 'Big 6 Personality; Extraversion Post Breakup/not'. EXECUTE. VARIABLE LABELS Agree_PRE 'Big 6 Personality; Agreeable Pre Breakup/not'. EXECUTE. VARIABLE LABELS Agree_POST 'Big 6 Personality; Agreeable Post Breakup/not'. EXECUTE. VARIABLE LABELS Cons_PRE 'Big 6 Personality; Conscientiousness Pre Breakup/not'. EXECUTE. VARIABLE LABELS Cons_POST 'Big 6 Personality; Conscientiousness Post Breakup/not'. EXECUTE. VARIABLE LABELS Neuro_PRE 'Big 6 Personality; Neuroticism Pre Breakup/not'. EXECUTE. VARIABLE LABELS Neuro_POST 'Big 6 Personality; Neuroticism Post Breakup/not'. EXECUTE. VARIABLE LABELS Open_PRE 'Big 6 Personality; Openness to Experience Pre Breakup/not'. EXECUTE. VARIABLE LABELS Open_POST 'Big 6 Personality; Openness to Experience Post Breakup/not'. EXECUTE. VARIABLE LABELS HonHum_PRE 'Big 6 Personality; Honesty Humility Pre Breakup/not'. EXECUTE. VARIABLE LABELS HonHum_POST 'Big 6 Personality; Honesty Humility Post Breakup/not'. EXECUTE. *Self Esteem VARIABLE LABELS SE_PRE 'Self Esteem Pre Breakup/not: "On the whole am satisfied with myself,” “Take a positive attitude toward myself,” and “Am inclined to feel that I am a failure (RS)'. EXECUTE. VARIABLE LABELS SE_POST 'Self Esteem Post Breakup/not: "On the whole am satisfied with myself,” “Take a positive attitude toward myself,” and “Am inclined to feel that I am a failure (RS)'. EXECUTE. *Satisfaction with life VARIABLE LABELS SWL_PRE 'Satisfaction with Life Pre Breakup/not: “I am satisfied with my life” and “In most ways, my life is close to ideal (average)'. EXECUTE. VARIABLE LABELS SWL_POST 'Satisfaction with Life Post Breakup/not; “I am satisfied with my life” and “In most ways, my life is close to ideal" (average)'. EXECUTE. *Social Support VARIABLE LABELS PWI_PRE 'Personal Wellbeing Pre Breakup/not: Participants rated their “standard of living”, “health”, “future security” and “personal relationships” (average) '. EXECUTE. VARIABLE LABELS PWI_POST 'Personal Wellbeing Post Breakup/not: Participants rated their “standard of living”, “health”, “future security” and “personal relationships” (average)'. EXECUTE. *Self Esteem VARIABLE LABELS SUPPORT_PRE 'Social Support Pre Breakup/not: There are people I can depend on to help me if I really need it, There is no one I can turn to for guidance in times of stress (RS), and I know there are people I can turn to when I need help (average)'. EXECUTE. VARIABLE LABELS SUPPORT_POST 'Social Support Post Breakup/not: There are people I can depend on to help me if I really need it, There is no one I can turn to for guidance in times of stress (RS), and I know there are people I can turn to when I need help (average)'. EXECUTE. *Drawn From (Timing Variable) VARIABLE LABELS DRAWFROM 'Time point ranging from 1-8 that participants data drawn from'. EXECUTE. *Idenifying Variable VARIABLE LABELS Questionnaire.Num 'Questionaire Number, ID number'. EXECUTE. *Relationship Transitions VARIABLE LABELS BREAK 'Relationship Transition, 0 = Stayed in Relationship, 1 Breakup, 1 Started new Relationship'. EXECUTE. VALUE LABELS BREAK '0' 'Stayed in Relationship' '1' 'Breakup' '2' 'Started new Relationship'. *NOTE: The code above includes people who started a new relationship which we do not want in analyses so need to craete a new code with 0 = stayed in Rel, 1 = broke up RECODE BREAK (0=0) (1=1) (2 = SYSMIS) INTO BREAKUP. EXECUTE. VARIABLE LABELS BREAKUP 'Relationship Transition, 0 = Stayed in Relationship, 1 Breakup'. EXECUTE. VALUE LABELS BREAKUP '0' 'Stayed in Relationship' '1' 'Breakup'. *missing variables missing values DRAW_AGE, DRAW_LEN, DRAW_SEI, DRAW_GEN, DRAW_MAO, DRAW_PAC, DRAW_ASN, DRAW_BRN, DRAW_SAT, Extra_PRE, Extra_POST, Agree_PRE, Agree_POST, Cons_PRE, Cons_POST, Neuro_PRE, Neuro_POST, Open_PRE, Open_POST, HonHum_PRE, HonHum_POST, SE_PRE, SE_POST, SWL_PRE, SWL_POST, PWI_PRE, PWI_POST, SUPPORT_PRE, SUPPORT_POST, DRAWFROM, Questionnaire.Num, BREAK, BREAKUP (9999). "JUST EYEBALLING THE MINS AND MEANS TO ENSURE CORRECT DESCRIPTIVES VARIABLES=DRAW_AGE DRAW_LEN DRAW_SEI DRAW_GEN DRAW_MAO DRAW_PAC DRAW_ASN DRAW_BRN DRAW_SAT Extra_PRE Extra_POST Agree_PRE Agree_POST Cons_PRE Cons_POST Neuro_PRE Neuro_POST Open_PRE Open_POST HonHum_PRE HonHum_POST SE_PRE SE_POST SWL_PRE SWL_POST PWI_PRE PWI_POST SUPPORT_PRE SUPPORT_POST DRAWFROM Questionnaire.Num BREAK BREAKUP /STATISTICS=MEAN STDDEV MIN MAX. === SECTION BREAK === "2. Creating datafile with PSM "2A NOTE: Non-numeral Analyse are not allowed to be matching variables in SPSS Built in PS matching command therefore all grouping variables ('nominal' variables) need to be changed to be 'scale'. This includes the following variables "NOTE YOU WILL NEED TO DO THIS MANUALLY. DRAW_GEN DRAW_MAO DRAW_PAC DRAW_ASN DRAW_BRN DRAWFROM BREAK BREAKUP "2B.NOTE: Once this is done I suggest you REORDER the dataset as follows, Identifying variable, Relationhip transition variable, demographic variables, pre scores, post scores. This ordering makes PS matching easier Questionnaire.Num BREAK BREAKUP DRAWFROM DRAW_AGE DRAW_LEN DRAW_SEI DRAW_GEN DRAW_MAO DRAW_PAC DRAW_ASN DRAW_BRN DRAW_SAT Extra_PRE Agree_PRE Cons_PRE Neuro_PRE Open_PRE HonHum_PRE SE_PRE SWL_PRE PWI_PRE SUPPORT_PRE Extra_POST Agree_POST Cons_POST Neuro_POST Open_POST HonHum_POST SE_POST SWL_POST PWI_POST SUPPORT_POST "2c. Propsensity score matching *NOTE: This syntax matches on all demographic variables, timepoint drawn from, and all pre-scores. * Propensity Score Matching. begin program. import spss, random, spssaux, codecs try: import FUZZY except: print "This procedure requires the FUZZY extension command which is not installed." parts = [int(i) for i in FUZZY.__version__.split(".")] if parts < [1,3,0]: raise EnvironmentError("This procedure requires version 1.3.0 or later of FUZZY") ds = spss.ActiveDataset() if ds =="*": ds = "D" + str(random.random()) spss.Submit("DATASET NAME " + ds) ds = codecs.encode(ds) # must use code page rep here matchgroup = "M" + str(random.random()) #temporary variable tempdsname = "D" + str(random.random()) factors = "".split() if len(factors) > 0: catsub = "/CATEGORICAL " + " ".join(factors) else: catsub = "" lrcmd = spssaux.u(r"""LOGISTIC REGRESSION VARIABLES BREAKUP /METHOD=ENTER DRAWFROM DRAW_AGE DRAW_LEN DRAW_SEI DRAW_GEN DRAW_MAO DRAW_PAC DRAW_ASN DRAW_BRN DRAW_SAT Extra_PRE Agree_PRE Cons_PRE Neuro_PRE Open_PRE HonHum_PRE SE_PRE SWL_PRE PWI_PRE SUPPORT_PRE %s /SAVE=PRED(PSM_Variable).""" % catsub) try: spss.Submit(lrcmd) except: raise ValueError("Logistic Regression step failed") fuzzycmd = spssaux.u(r"""FUZZY BY=PSM_Variable SUPPLIERID=Questionnaire.Num NEWDEMANDERIDVARS=MatchID GROUP=BREAKUP EXACTPRIORITY=FALSE MATCHGROUPVAR=%(matchgroup)s FUZZ=.2 DS3=%(tempdsname)s /OPTIONS SAMPLEWITHREPLACEMENT=FALSE MINIMIZEMEMORY=TRUE SHUFFLE=FALSE . DELETE VARIABLES %(matchgroup)s. DATASET ACTIVATE %(ds)s. DELETE VARIABLES %(matchgroup)s. DATASET COPY Breakup_and_Wellbing_PSM_Datafile. DATASET ACTIVATE Breakup_and_Wellbing_PSM_Datafile. SELECT IF BREAKUP EQ 1. DATASET ACTIVATE %(tempdsname)s. DATASET ACTIVATE Breakup_and_Wellbing_PSM_Datafile. ADD FILES /FILE=* /FILE=%(tempdsname)s. EXECUTE. DATASET CLOSE %(tempdsname)s.""" % locals()) spss.Submit(fuzzycmd) end program. *NOTE: eyeball the PSM Output to ensure values are the same "Case Control Matching Statistics Exact Matches 0 Fuzzy Matches 1219 Unmatched Including Missing Keys 222 Unmatched with Valid Keys 0 == NOTE: We are now dealing with the new PSM dataset called "Breakup & Wellbeing PSM Datafile" == "2d. Centering Continuous Variables *Note: For ease I center all pre and post scores define grand_cvars( vlist = !charend('/') /suffix = !cmdend ) compute one_temp = 1. exe. !do !vname !in (!vlist) !let !nname = !concat(!vname, !suffix) aggregate /outfile=* mode=addvariables overwrite = yes /break =one_temp /y_temp=mean(!vname). compute !nname = !vname - y_temp. exe. !doend delete variables y_temp one_temp. !enddefine. grand_cvars vlist = DRAW_AGE DRAW_LEN DRAW_SAT Extra_PRE Agree_PRE Cons_PRE Neuro_PRE Open_PRE HonHum_PRE SE_PRE SWL_PRE PWI_PRE SUPPORT_PRE Extra_POST Agree_POST Cons_POST Neuro_POST Open_POST HonHum_POST SE_POST SWL_POST PWI_POST SUPPORT_POST /suffix = _c. "2e. creating interactions COMPUTE BreakUpxRsat_c=BreakUp*DRAW_SAT_c. EXECUTE. COMPUTE BreakUpxRLength_c=BreakUp*DRAW_LEN_c. EXECUTE. COMPUTE BreakUpxSE_PRE_c=BreakUp*SE_PRE_c. EXECUTE. COMPUTE BreakUpxSUPPORT_PRE_c=BreakUp*SUPPORT_PRE_c. EXECUTE. COMPUTE BreakUpxPWI_PRE_c=BreakUp*PWI_PRE_c. EXECUTE. "3. Analyses "ordering Social Support Personal Wellbeing Satisfaction with Life "3a. Regression Analyses "The Main and Moderated Effects of Relationship Breakups on Social Support, Personal Wellbeing and Life Satisfaction (Moderated by Self-Esteem). "Main effects *Social Support REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS CI(95) R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT SUPPORT_POST /METHOD=ENTER Breakup SUPPORT_PRE_c. *Personal Wellbeing REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS CI(95) R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT PWI_POST /METHOD=ENTER Breakup PWI_PRE_c. *Life Satisfation REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS CI(95) R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT SWL_POST /METHOD=ENTER Breakup SWL_PRE_c. "Moderated by Self-Esteem *Social Support REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS CI(95) BCOV R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT SUPPORT_POST /METHOD=ENTER Breakup SE_PRE_c BreakUpxSE_PRE_c SUPPORT_PRE_c. *Personal Wellbeing REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS CI(95) BCOV R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT PWI_POST /METHOD=ENTER Breakup SE_PRE_c BreakUpxSE_PRE_c PWI_PRE_c. *Life Satisfation REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS CI(95) BCOV R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT SWL_POST /METHOD=ENTER Breakup SE_PRE_c BreakUpxSE_PRE_c SWL_PRE_c. "3B. Additional Anlyses "Table SM1. Moderating effects of Relationship Satisfaction and Relationship Length. "Moderated by Relationship Satisfaction *Social Support REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS CI(95) BCOV R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT SUPPORT_POST /METHOD=ENTER Breakup DRAW_SAT_c BreakUpxRsat_c SUPPORT_PRE_c. *Personal Wellbeing REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS CI(95) BCOV R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT PWI_POST /METHOD=ENTER Breakup DRAW_SAT_c BreakUpxRsat_c PWI_PRE_c. *Life Satisfation REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS CI(95) BCOV R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT SWL_POST /METHOD=ENTER Breakup DRAW_SAT_c BreakUpxRsat_c SWL_PRE_c. "Moderated by Relationship Length *Social Support REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS CI(95) BCOV R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT SUPPORT_POST /METHOD=ENTER Breakup DRAW_LEN_c BreakUpxRLength_c SUPPORT_PRE_c. *Personal Wellbeing REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS CI(95) BCOV R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT PWI_POST /METHOD=ENTER Breakup DRAW_LEN_c BreakUpxRLength_c PWI_PRE_c. *Life Satisfation REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS CI(95) BCOV R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT SWL_POST /METHOD=ENTER Breakup DRAW_LEN_c BreakUpxRLength_c SWL_PRE_c. === "Additional analyses (Just for Emily to know) "differences across brakup (no vs. yes groups) in outcomes DATASET ACTIVATE Breakup_and_Wellbing_PSM_Datafile. T-TEST GROUPS=BREAKUP(0 1) /MISSING=ANALYSIS /VARIABLES=DRAW_LEN DRAW_SAT SE_PRE SWL_PRE PWI_PRE /CRITERIA=CI(.95). "logistic regression whether outcomes/mod variables predict breakup LOGISTIC REGRESSION VARIABLES BREAKUP /METHOD=ENTER DRAW_LEN DRAW_SAT SE_PRE SWL_PRE PWI_PRE /CRITERIA=PIN(.05) POUT(.10) ITERATE(20) CUT(.5). *greater relationship length, satisfaction, and life satisfaction predicts staying together * greater personal wellbeing predicts breaking up? This seems odd. *Self-esteem doesn't predict breakup.