Loading required package: lavaan
This is lavaan 0.5-20
lavaan is BETA software! Please report any bugs.
 
###############################################################################
This is semTools 0.4-12
All users of R (or SEM) are invited to submit functions or ideas for functions.
###############################################################################

Attaching package: 'dplyr'
The following objects are masked from 'package:plyr':

    arrange, count, desc, failwith, id, mutate, rename, summarise,
    summarize
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

Attaching package: 'tibble'
The following objects are masked from 'package:dplyr':

    as_data_frame, data_frame, data_frame_, frame_data, glimpse,
    knit_print.trunc_mat, tbl_df, tibble, trunc_mat, type_sum

Read-in the dataset

Read data

setwd("~/Documents/stats_march_2016/Adult_study Data_Analysis")
adult2<-read.csv("adult2withscaled.csv")
dim(adult2)
## [1]  89 137

Fits Create indevidual dataframes

#View(adult2)
NewPurpose<-as_data_frame(select(adult2, SCALED_1_NewPurpose, SCALED_2_NewPurpose, SCALED_3_NewPurpose, NewPurpose_mean_1.GROUP1))
MLQ<-as_data_frame(select(adult2, SCALED_1_MLQP, SCALED_2_MLQP, SCALED_3_MLQP, MLQ_mean_1.GROUP1))
MLQS<-as_data_frame(select(adult2, SCALED_1_MLQS, SCALED_2_MLQS, SCALED_3_MLQS, MLQS_mean_1.GROUP1))
PermaHappy<-as_data_frame(select(adult2, SCALED_1_PERMA_Happy, SCALED_2_PERMA_Happy, SCALED_3_PERMA_Happy, PERMA_Happy_mean_1.GROUP1))
PermaLonely<-as_data_frame(select(adult2, SCALED_1_PERMA_Lonely, SCALED_2_PERMA_Lonely, SCALED_3_PERMA_Lonely, PERMA_Lonely_mean_1.GROUP1))
GRIT<-as_data_frame(select(adult2, SCALED_1_GRIT, SCALED_2_GRIT, SCALED_3_GRIT, GRIT_mean_1.GROUP1))
Resiliance<-as_data_frame(select(adult2, SCALED_1_Res, SCALED_2_Res, SCALED_3_Res, Res_mean_1.GROUP1))
APSI<-as_data_frame(select(adult2, SCALED_1_APSI, SCALED_2_APSI, SCALED_3_APSI, PurposeAPSI_mean_1.GROUP1))
PWB<-as_data_frame(select(adult2, SCALED_1_PWB, SCALED_2_PWB, SCALED_3_PWB, PurposePWB_mean_1.GROUP1))
Optimism<-as_data_frame(select(adult2, SCALED_1_Optimism, SCALED_2_Optimism, SCALED_3_Optimism, Optimism_mean_1.GROUP1))
LifeSatisfaction<-as_data_frame(select(adult2, SCALED_1_LS, SCALED_2_LS, SCALED_3_LS, LifeSatisfaction_mean_1.GROUP1))
LifeEngagement<-as_data_frame(select(adult2, SCALED_1_LET, SCALED_2_LET, SCALED_3_LET, LifeEngagement_mean_1.GROUP1))
PermaEngagement<-as_data_frame(select(adult2, SCALED_1_Engagement, SCALED_2_Engagement, SCALED_3_Engagement, Engagement_mean_1.GROUP1))
PermaRelationships<-as_data_frame(select(adult2, SCALED_1_Rrealtionships, SCALED_2_Rrealtionships, SCALED_3_Rrealtionships, Relationships_mean_1.GROUP1))
PermaNegetive<-as_data_frame(select(adult2, SCALED_1_Nagative, SCALED_2_Nagative, SCALED_3_Nagative, Negative_mean_1.GROUP1))
PermaAcheivement<-as_data_frame(select(adult2, SCALED_1_Acheivement, SCALED_2_Acheivement, SCALED_3_Acheivement, Acheivement_mean_1.GROUP1))
PermaPositive<-as_data_frame(select(adult2, SCALED_1_Positive, SCALED_2_Positive, SCALED_3_Positive, Positive_mean_1.GROUP1))
#create nexted dataframe
#by_scale<-nest(NewPurpose, MLQ, MLQS, PermaHappy, PermaLonely, PermaPositive, PermaAcheivement, PermaRelationships, PermaEngagement, PermaNegetive, LifeEngagement, LifeSatisfaction, Optimism, PWB, APSI, Resiliance, GRIT)


##Time 1 to time 2 and time 1 to time 3 NewPurpose
modelNewPurpose_interaction <- '
# Regression model 
SCALED_2_NewPurpose ~ GROUP1 + GROUP2 + SCALED_1_NewPurpose + NewPurpose_mean_1.GROUP1
SCALED_3_NewPurpose ~ GROUP1 + GROUP2 + SCALED_1_NewPurpose + NewPurpose_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account NewPurpose
modelNewPurpose_interaction_T3 <- '
# Regression model 
SCALED_2_NewPurpose ~ GROUP1 + GROUP2 + SCALED_1_NewPurpose + NewPurpose_mean_1.GROUP1
SCALED_3_NewPurpose ~ GROUP1 + GROUP2 + SCALED_1_NewPurpose + NewPurpose_mean_1.GROUP1 + SCALED_2_ NewPurpose '


#Time 1 to time 2 and time 1 to time 3 MLQP
modelMLQP_interaction <- '
# Regression model 
SCALED_2_MLQP ~ GROUP1 + GROUP2 + SCALED_1_MLQP + MLQ_mean_1.GROUP1
SCALED_3_MLQP ~ GROUP1 + GROUP2 + SCALED_1_MLQP + MLQ_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account MLQP

modelMLQP_interaction_T3 <- '
# Regression model 
SCALED_2_MLQP ~ GROUP1 + GROUP2 + SCALED_1_MLQP+ MLQ_mean_1.GROUP1
SCALED_3_MLQP ~ GROUP1 + GROUP2 + SCALED_1_MLQP + MLQ_mean_1.GROUP1 + SCALED_2_MLQP'

#Time 1 to time 2 and time 1 to time 3 MLQS
modelMLQS_interaction <- '
# Regression model 
SCALED_2_MLQS ~ GROUP1 + GROUP2 + SCALED_1_MLQS + MLQS_mean_1.GROUP1
SCALED_3_MLQS ~ GROUP1 + GROUP2 + SCALED_1_MLQS + MLQS_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account MLQS
modelMLQS_interaction_T3 <- '
# Regression model 
SCALED_2_MLQS ~ GROUP1 + GROUP2 + SCALED_1_MLQS+ MLQS_mean_1.GROUP1
SCALED_3_MLQS ~ GROUP1 + GROUP2 + SCALED_1_MLQS + MLQS_mean_1.GROUP1 + SCALED_2_MLQS'

#Time 1 to time 2 and time 1 to time 3 Perman Happy
modelHappy_interaction <- '
# Regression model 
SCALED_2_PERMA_Happy ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Happy + PERMA_Happy_mean_1.GROUP1
SCALED_3_PERMA_Happy ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Happy + PERMA_Happy_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account Perma Happy
modelHappy_interaction_T3 <- '
# Regression model 
SCALED_2_PERMA_Happy ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Happy + PERMA_Happy_mean_1.GROUP1
SCALED_3_PERMA_Happy ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Happy + PERMA_Happy_mean_1.GROUP1 + SCALED_2_PERMA_Happy '

#Time 1 to time 2 and time 1 to time 3 Perma Lonely
modelLonely_interaction <- '
# Regression model 
SCALED_2_PERMA_Lonely ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Lonely + PERMA_Lonely_mean_1.GROUP1
SCALED_3_PERMA_Lonely ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Lonely + PERMA_Lonely_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account Perma Lonely
modelLonely_interaction_T3 <- '
# Regression model 
SCALED_2_PERMA_Lonely ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Lonely + PERMA_Lonely_mean_1.GROUP1
SCALED_3_PERMA_Lonely ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Lonely + PERMA_Lonely_mean_1.GROUP1 + SCALED_2_PERMA_Lonely '

#Time 1 to time 2 and time 1 to time 3 Grit
modelGRIT_interaction <- '
# Regression model 
SCALED_2_GRIT ~ GROUP1 + GROUP2 + SCALED_1_GRIT +GRIT_mean_1.GROUP1
SCALED_3_GRIT ~ GROUP1 + GROUP2 + SCALED_1_GRIT +GRIT_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account Grit
modelGRIT_interaction_T3 <- '
# Regression model 
SCALED_2_GRIT ~ GROUP1 + GROUP2 + SCALED_1_GRIT +GRIT_mean_1.GROUP1
SCALED_3_GRIT ~ GROUP1 + GROUP2 + SCALED_1_GRIT +GRIT_mean_1.GROUP1 + SCALED_2_GRIT '


#Time 1 to time 2 and time 1 to time 3 Resiliance
modelRes_interaction <- '
# Regression model 
SCALED_2_Res ~ GROUP1 + GROUP2 + SCALED_1_Res +Res_mean_1.GROUP1
SCALED_3_Res ~ GROUP1 + GROUP2 + SCALED_1_Res +Res_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account Resiliance
modelRes_interaction_T3 <- '
# Regression model 
SCALED_2_Res ~ GROUP1 + GROUP2 + SCALED_1_Res +Res_mean_1.GROUP1
SCALED_3_Res ~ GROUP1 + GROUP2 + SCALED_1_Res +Res_mean_1.GROUP1 + SCALED_2_Res '

#Time 1 to time 2 and time 1 to time 3 APSI
modelAPSI_interaction <- '
# Regression model 
SCALED_2_APSI ~ GROUP1 + GROUP2 + SCALED_1_APSI + PurposeAPSI_mean_1.GROUP1
SCALED_3_APSI ~ GROUP1 + GROUP2 + SCALED_1_APSI + PurposeAPSI_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account APSI
modelAPSI_interaction_T3 <- '
# Regression model 
SCALED_2_APSI ~ GROUP1 + GROUP2 + SCALED_1_APSI + PurposeAPSI_mean_1.GROUP1
SCALED_3_APSI ~ GROUP1 + GROUP2 + SCALED_1_APSI + PurposeAPSI_mean_1.GROUP1 + SCALED_2_APSI '

#Time 1 to time 2 and time 1 to time 3 PWB
modelPWB_interaction <- '
# Regression model 
SCALED_2_PWB ~ GROUP1 + GROUP2 + SCALED_1_PWB + PurposePWB_mean_1.GROUP1
SCALED_3_PWB ~ GROUP1 + GROUP2 + SCALED_1_PWB + PurposePWB_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account PWB
modelPWB_interaction_T3 <- '
# Regression model 
SCALED_2_PWB ~ GROUP1 + GROUP2 + SCALED_1_PWB + PurposePWB_mean_1.GROUP1
SCALED_3_PWB ~ GROUP1 + GROUP2 + SCALED_1_PWB + PurposePWB_mean_1.GROUP1 + SCALED_2_PWB '

#Time 1 to time 2 and time 1 to time 3 OPTIMISM
modelOPTIMISM_interaction <- '
# Regression model 
SCALED_2_Optimism ~ GROUP1 + GROUP2 + SCALED_1_Optimism + Optimism_mean_1.GROUP1
SCALED_3_Optimism ~ GROUP1 + GROUP2 + SCALED_1_Optimism + Optimism_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account OPTIMISM
modelOPTIMISM_interaction_T3 <- '
# Regression model 
SCALED_2_Optimism ~ GROUP1 + GROUP2 + SCALED_1_Optimism + Optimism_mean_1.GROUP1
SCALED_3_Optimism ~ GROUP1 + GROUP2 + SCALED_1_Optimism + Optimism_mean_1.GROUP1 + SCALED_2_Optimism'

#Time 1 to time 2 and time 1 to time 3 LS
modelLS_interaction <- '
# Regression model 
SCALED_2_LS ~ GROUP1 + GROUP2 + SCALED_1_LS +LifeSatisfaction_mean_1.GROUP1
SCALED_3_LS ~ GROUP1 + GROUP2 + SCALED_1_LS +LifeSatisfaction_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account LS
modelLS_interaction_T3 <- '
# Regression model 
SCALED_2_LS ~ GROUP1 + GROUP2 + SCALED_1_LS +LifeSatisfaction_mean_1.GROUP1
SCALED_3_LS ~ GROUP1 + GROUP2 + SCALED_1_LS +LifeSatisfaction_mean_1.GROUP1 + SCALED_2_LS '

#Time 1 to time 2 and time 1 to time 3 Engagement
modelEngagement_interaction <- '
# Regression model 
SCALED_2_Engagement ~ GROUP1 + GROUP2 + SCALED_1_Engagement + Engagement_mean_1.GROUP1
SCALED_3_Engagement ~ GROUP1 + GROUP2 + SCALED_1_Engagement + Engagement_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account Engagement
modelEngagement_interaction_T3 <- '
# Regression model 
SCALED_2_Engagement ~ GROUP1 + GROUP2 + SCALED_1_Engagement + Engagement_mean_1.GROUP1
SCALED_3_Engagement ~ GROUP1 + GROUP2 + SCALED_1_Engagement + Engagement_mean_1.GROUP1 + SCALED_2_Engagement'
#Time 1 to time 2 and time 1 to time 3 RELATIONSHIPS
modelRelationships_interaction <- '
# Regression model 
SCALED_2_Rrealtionships ~ GROUP1 + GROUP2 + SCALED_1_Rrealtionships + Relationships_mean_1.GROUP1
SCALED_3_Rrealtionships ~ GROUP1 + GROUP2 + SCALED_1_Rrealtionships + Relationships_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account RELATIONSHIPS
modelRelationships_interaction_T3 <- '
# Regression model 
SCALED_2_Rrealtionships ~ GROUP1 + GROUP2 + SCALED_1_Rrealtionships +Relationships_mean_1.GROUP1
SCALED_3_Rrealtionships ~ GROUP1 + GROUP2 + SCALED_1_Rrealtionships +Relationships_mean_1.GROUP1 + SCALED_2_Rrealtionships '

#Time 1 to time 2 and time 1 to time 3 NAGATIVE
modelNegative_interaction <- '
# Regression model 
SCALED_2_Nagative ~ GROUP1 + GROUP2 + SCALED_1_Nagative + Negative_mean_1.GROUP1
SCALED_3_Nagative ~ GROUP1 + GROUP2 + SCALED_1_Nagative + Negative_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account NAGATIVE
modelNegative_interaction_T3 <- '
# Regression model 
SCALED_2_Nagative ~ GROUP1 + GROUP2 + SCALED_1_Nagative + Negative_mean_1.GROUP1
SCALED_3_Nagative ~ GROUP1 + GROUP2 + SCALED_1_Nagative + Negative_mean_1.GROUP1 + SCALED_2_Nagative '

#Time 1 to time 2 and time 1 to time 3 Acheivement
modelAcheivement_interaction <- '
# Regression model 
SCALED_2_Acheivement ~ GROUP1 + GROUP2 + SCALED_1_Acheivement + Acheivement_mean_1.GROUP1
SCALED_3_Acheivement ~ GROUP1 + GROUP2 + SCALED_1_Acheivement + Acheivement_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account Acheivement
modelAcheivement_interaction_T3 <- '
# Regression model 
SCALED_2_Acheivement ~ GROUP1 + GROUP2 + SCALED_1_ Acheivement + Acheivement_mean_1.GROUP1
SCALED_3_Acheivement ~ GROUP1 + GROUP2 + SCALED_1_ Acheivement + Acheivement_mean_1.GROUP1 + SCALED_2_Acheivement '

#Time 1 to time 2 and time 1 to time 3 Positive
modelPositive_interaction <- '
# Regression model 
SCALED_2_Positive ~ GROUP1 + GROUP2 + SCALED_1_ Positive + Positive_mean_1.GROUP1
SCALED_3_Positive ~ GROUP1 + GROUP2 + SCALED_1_Positive + Positive_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account Positive
modelPositive_interaction_T3 <- '
# Regression model 
SCALED_2_Positive ~ GROUP1 + GROUP2 + SCALED_1_Positive + Positive_mean_1.GROUP1
SCALED_3_Positive ~ GROUP1 + GROUP2 + SCALED_1_Positive + Positive_mean_1.GROUP1 + SCALED_2_Positive'

#Time 1 to time 2 and time 1 to time 3 LET
modelLET_interaction <- '
# Regression model 
SCALED_2_LET ~ GROUP1 + GROUP2 + SCALED_1_LET + LifeEngagement_mean_1.GROUP1
SCALED_3_LET ~ GROUP1 + GROUP2 + SCALED_1_LET + LifeEngagement_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account LET
modelLET_interaction_T3 <- '
# Regression model 
SCALED_2_LET ~ GROUP1 + GROUP2 + SCALED_1_LET + LifeEngagement_mean_1.GROUP1
SCALED_3_LET ~ GROUP1 + GROUP2 + SCALED_1_LET+ LifeEngagement_mean_1.GROUP1 + SCALED_2_LET '

#Time 1 to time 2 and time 1 to time 3 Perma Happy
modelPERMA_Happy_interaction <- '
# Regression model 
SCALED_2_PERMA_Happy ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Happy + PERMA_Happy_mean_1.GROUP1
SCALED_3_PERMA_Happy ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Happy + PERMA_Happy_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account Perma Happy
modelPERMA_Happy_interaction_T3 <- '
# Regression model 
SCALED_2_PERMA_Happy ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Happy + PERMA_Happy_mean_1.GROUP1
SCALED_3_PERMA_Happy ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Happy + PERMA_Happy_mean_1.GROUP1 + SCALED_2_PERMA_Happy '

#Time 1 to time 2 and time 1 to time 3 Perma Lonely
modelPERMA_Lonely_interaction <- '
# Regression model 
SCALED_2_PERMA_Lonely ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Lonely + PERMA_Lonely_mean_1.GROUP1
SCALED_3_PERMA_Lonely ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Lonely + PERMA_Lonely_mean_1.GROUP1'

#Time 1 to time 2 and time 1 to time 3 taking time 2 into account Perma Lonely
modelPERMA_Lonely_interaction_T3 <- '
# Regression model 
SCALED_2_PERMA_Lonely ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Lonely + PERMA_Lonely_mean_1.GROUP1
SCALED_3_PERMA_Lonely ~ GROUP1 + GROUP2 + SCALED_1_PERMA_Lonely + PERMA_Lonely_mean_1.GROUP1 + SCALED_2_PERMA_Lonely ' 

Fits

#####Functions for fit creation
fitsetc<- function(scale, fitone, fittwo, modelname1, modelname2, dataset, xname1, intercation, xname2, yname, xlabname, ylabnaem){
fits1<-noquote(paste0(fitone,"<-","sem","(", modelname1,",", dataset,",", "missing='fiml',", "meanstructure=TRUE",",", "fixed.x=T",")", collapse=NULL))
sum1<-noquote(paste0("summary","(", fitone,",", "fit.measures=TRUE", ",","rsquare=TRUE,", "standardize=T",")",collapse=NULL))
paramas1<- noquote(paste0("parameterEstimates","(", fitone,")", collapse=NULL))
interprobe1<-noquote(paste0("inter", scale,"1","<-","probe2WayMC","(",fitone,",", "nameX=c(", xname1,",", intercation,",",xname2,"),", 
                          "nameY=", yname,",", "modVar=", intercation,",", "valProbe=c(1,2)",")",collapse=NULL))
PlotProbes1<- noquote(paste0("plotProbe","(","inter",scale,"1", ",","xlim=c(1,9)","," ,"xlab=", xlabname,",", "ylab=", ylabnaem,")",collapse=NULL))
fits2<-noquote(paste0(fittwo,"<-","sem","(", modelname2,",", dataset,",", "missing='fiml',", "meanstructure=TRUE",",", "fixed.x=T",")", collapse=NULL))
sum2<-noquote(paste0("summary","(", fittwo,",", "fit.measures=TRUE", ",","rsquare=TRUE,", "standardize=T",")",collapse=NULL))
paramas2<- noquote(paste0("parameterEstimates","(", fitone,")", collapse=NULL))
interprobe2<-noquote(paste0("inter", scale,"1","<-","probe2WayMC","(",fitone,",", "nameX=c(", xname1,",", intercation,",",xname2,"),", 
                            "nameY=", yname,",", "modVar=", intercation,",", "valProbe=c(1,2)",")",collapse=NULL))
PlotProbes2<- noquote(paste0("plotProbe","(","inter",scale,"1", ",","xlim=c(1,9)","," ,"xlab=", xlabname,",", "ylab=", ylabnaem,")",collapse=NULL))
all<-list(c(fits1, sum1, paramas1, interprobe1, PlotProbes1, fits2, sum2, paramas2, interprobe2, PlotProbes2))
all
}



#Model fits

Functions for tables and interactions

FitTable<-function(fitname, interactionterm, current_scale_name, new_scale_name){
  #Function to round numbers in a df
  round_df<-function(df, num){nums<-map_lgl(df, is.numeric);df[,nums]<-round(df[,nums],num);(df)}
  lolollol<-(parameterEstimates(fitname)) 
  lolollol<-round_df(lolollol, 2)
lolollol$CI<-paste(lolollol$ci.lower, lolollol$ci.upper, sep = ", ")
    lolollol<-select(lolollol, rhs, est, se, z, pvalue, CI)
    lolollol<-slice(lolollol, c(22, 1:4, 23, 5:8))
    lolollol<-rename(lolollol, Item = rhs, β = est, SE = se, p = pvalue, "90% CI" = CI)
  lolollol[1,1] <- sprintf('Intercept', lolollol[1,1])
  lolollol[6,1] <- sprintf('Intercept', lolollol[1,1])
  lolollol[,1]<-gsub("SCALED_1_", "", lolollol[,1])
  lolollol[,1]<-gsub(interactionterm, "Interaction w/ Group", lolollol[,1])
  lolollol[,1]<-gsub(current_scale_name, new_scale_name, lolollol[,1])
  lolollol1<-slice(lolollol, 1:5)
  lolollol2<-slice(lolollol, 6:10)
  lolollol<-list(lolollol1,lolollol2)
  lolollol
}



library(ggplot2)

PlotInter<-function(fitname, PlotTitle){
fit<-(parameterEstimates(fitname)) 
Treat=1
Control=0
Group0 <-fit[22,4]
Group1<- fit[1,4]
T1 = fit[3,4]
interaction1 = fit[4,4]
Group0_2 = fit[23,4]
Group2 = fit[5,4]
T1_2 = fit[7,4]
interaction2 = fit[8,4] 
library(ggplot2)
TreatHighT2 =  Group0 + T1*1 + Group1*Treat - interaction1*1*Treat
TreatMediumT2 =  Group0 + T1*0 + Group1*Treat - interaction1*0*Treat
TreatLowT2 =  Group0 + T1*-1 + Group1*Treat - interaction1*-1*Treat
ControlHighT2 =  Group0 + T1*1 + Group1*Control - interaction1*1*Control
ControlMediumT2 =  Group0 + T1*0 + Group1*Control - interaction1*0*Control
ControlLowT2 =  Group0 + T1*-1 + Group1*Control - interaction1*-1*Control
#Same thing for time three as IV
TreatHighT3 =  Group0_2 + T1_2*1 + Group1*Treat - interaction2*1*Treat
TreatMediumT3 =  Group0_2 + T1_2*0 + Group1*Treat - interaction2*0*Treat
TreatLowT3 =  Group0_2 + T1_2*-1 + Group1*Treat - interaction2*-1*Treat
ControlHighT3 =  Group0_2 + T1_2*1 + Group1*Control - interaction2*1*Control
ControlMediumT3 =  Group0_2 + T1_2*0 + Group1*Control - interaction2*0*Control
ControlLowT3 =  Group0_2 + T1_2*-1 + Group1*Control - interaction2*-1*Control
Treat_T2 = c(TreatLowT2, TreatMediumT2, TreatHighT2)
Control_T2 = c(ControlLowT2, ControlMediumT2, ControlHighT2)
Treat_T3 = c(TreatLowT3, TreatMediumT3, TreatHighT3)
Control_T3 = c(ControlLowT3, ControlMediumT3, ControlHighT3)
levels = c("-1","0","1")
fdsd<-data.frame(levels, Treat_T2,Control_T2,Treat_T3,Control_T3)
Plot1<-ggplot(fdsd, aes(levels)) + 
  geom_line(aes(levels, Treat_T2, group = 1, lty="Treatment")) + 
  geom_line(aes(levels, Control_T2, group = 1, lty="Control")) +
  labs(list(title = "Time 2", x = "Levels Pre in SD", y="Levels Post in SD", lty = "Lines" ))
Plot2<-ggplot(fdsd, aes(levels)) + 
  geom_line(aes(levels, Treat_T3, group = 1, lty="Treatment")) + 
  geom_line(aes(levels, Control_T3, group = 1, lty="Control")) +
  labs(list(title = "Time 3", x = "Levels Pre in SD", y="Levels Post in SD", lty = "Lines" ))
library(gridExtra)
grid.arrange(Plot1, Plot2, ncol=2, top = PlotTitle)}

SimpleSlopes<-function(fitName){
fit<-(parameterEstimates(fitName)) 
Treat=1
Control=0
Group0 <-fit[22,4]
Group1<- fit[1,4]
T1 = fit[3,4]
interaction1 = fit[4,4]
Group0_2 = fit[23,4]
Group2 = fit[5,4]
T1_2 = fit[7,4]
interaction2 = fit[8,4] 
library(ggplot2)
TreatHighT2 =  Group0 + T1*1 + Group1*Treat + interaction1*1*Treat
TreatMediumT2 =  Group0 + T1*0 + Group1*Treat + interaction1*0*Treat
TreatLowT2 =  Group0 + T1*-1 + Group1*Treat + interaction1*-1*Treat
ControlHighT2 =  Group0 + T1*1 + Group1*Control + interaction1*1*Control
ControlMediumT2 =  Group0 + T1*0 + Group1*Control + interaction1*0*Control
ControlLowT2 =  Group0 + T1*-1 + Group1*Control + interaction1*-1*Control
#Same thing for time three as IV
TreatHighT3 =  Group0_2 + T1_2*1 + Group1*Treat + interaction2*1*Treat
TreatMediumT3 =  Group0_2 + T1_2*0 + Group1*Treat + interaction2*0*Treat
TreatLowT3 =  Group0_2 + T1_2*-1 + Group1*Treat + interaction2*-1*Treat
ControlHighT3 =  Group0_2 + T1_2*1 + Group1*Control + interaction2*1*Control
ControlMediumT3 =  Group0_2 + T1_2*0 + Group1*Control + interaction2*0*Control
ControlLowT3 =  Group0_2 + T1_2*-1 + Group1*Control + interaction2*-1*Control
Treat_T2 = c(TreatLowT2, TreatMediumT2, TreatHighT2)
Control_T2 = c(ControlLowT2, ControlMediumT2, ControlHighT2)
Treat_T3 = c(TreatLowT3, TreatMediumT3, TreatHighT3)
Control_T3 = c(ControlLowT3, ControlMediumT3, ControlHighT3)
levels = c("-1","0","1")
fdsd<-data.frame(levels, Treat_T2,Control_T2,Treat_T3,Control_T3)
round_df<-function(df, num){nums<-map_lgl(df, is.numeric);df[,nums]<-round(df[,nums],num);(df)}
round_df(fdsd,2)}


results<-function(modelname, fitname, data, interactionterm,  current_scale_name, new_scale_name){
fitname<-sem(modelname, data, missing='fiml', meanstructure=TRUE,fixed.x=T) 
fits<- summary(fitname,fit.measures=TRUE,rsquare=TRUE,standardize=T)  
table<-FitTable(fitname, interactionterm, current_scale_name, new_scale_name)
slopes<-SimpleSlopes(fitname)
all<-list((table), (slopes))
all
}

plots<-function(modelname, fitname, data, interactionterm,  current_scale_name, new_scale_name){
fitname<-sem(modelname, data, missing='fiml', meanstructure=TRUE,fixed.x=T)  
PlotInter(fitname, new_scale_name)
}

Fits

#########################################
#################  New Purpose  ###########
#########################################
library(purrr) 
## 
## Attaching package: 'purrr'
## The following object is masked from 'package:dplyr':
## 
##     order_by
## The following object is masked from 'package:plyr':
## 
##     compact
results(modelname = modelNewPurpose_interaction, fitname = fitNewPurpose1, data = adult2,  interactionterm = "NewPurpose_mean_1.GROUP1", current_scale_name = "NewPurpose", new_scale_name = "New Purpose")
## lavaan (0.5-20) converged normally after  35 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic              106.890
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -330.990
##   Loglikelihood unrestricted model (H1)       -330.990
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 687.980
##   Bayesian (BIC)                               720.332
##   Sample-size adjusted Bayesian (BIC)          679.307
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                         Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_NewPurpose ~                                             
##     GROUP1                 0.699    0.137    5.086    0.000    0.699
##     GROUP2                 0.055    0.389    0.141    0.888    0.055
##     SCALED_1_NwPrp         0.815    0.072   11.367    0.000    0.815
##     NwPr__1.GROUP1        -0.530    0.156   -3.396    0.001   -0.530
##   SCALED_3_NewPurpose ~                                             
##     GROUP1                 0.646    0.249    2.597    0.009    0.646
##     GROUP2                 0.724    0.826    0.877    0.380    0.724
##     SCALED_1_NwPrp         0.710    0.137    5.167    0.000    0.710
##     NwPr__1.GROUP1        -0.553    0.298   -1.856    0.063   -0.553
##   Std.all
##          
##     0.342
##     0.011
##     0.794
##    -0.237
##          
##     0.291
##     0.136
##     0.636
##    -0.227
## 
## Covariances:
##                          Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_NewPurpose ~~                                             
##     SCALED_3_NwPrp          0.177    0.074    2.397    0.017    0.177
##   Std.all
##          
##     0.414
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_NwPrp   -0.478    0.093   -5.131    0.000   -0.478   -0.469
##     SCALED_3_NwPrp   -0.589    0.187   -3.156    0.002   -0.589   -0.533
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_NwPrp    0.285    0.051    5.581    0.000    0.285    0.275
##     SCALED_3_NwPrp    0.645    0.134    4.805    0.000    0.645    0.527
## 
## R-Square:
##                    Estimate
##     SCALED_2_NwPrp    0.725
##     SCALED_3_NwPrp    0.473
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.48 0.09 -5.13 0.00  -0.66, -0.3
## 2               GROUP1  0.70 0.14  5.09 0.00   0.43, 0.97
## 3               GROUP2  0.05 0.39  0.14 0.89  -0.71, 0.82
## 4          New Purpose  0.81 0.07 11.37 0.00   0.67, 0.96
## 5 Interaction w/ Group -0.53 0.16 -3.40 0.00 -0.84, -0.22
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.59 0.19 -3.16 0.00 -0.96, -0.22
## 2               GROUP1  0.65 0.25  2.60 0.01   0.16, 1.13
## 3               GROUP2  0.72 0.83  0.88 0.38  -0.89, 2.34
## 4          New Purpose  0.71 0.14  5.17 0.00   0.44, 0.98
## 5 Interaction w/ Group -0.55 0.30 -1.86 0.06  -1.14, 0.03
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.06      -1.29    -0.05      -1.30
## 2      0     0.22      -0.48     0.11      -0.59
## 3      1     0.51       0.34     0.27       0.12
plots(modelname = modelNewPurpose_interaction, fitname = fitNewPurpose1, data = adult2,  interactionterm = "NewPurpose_mean_1.GROUP1", current_scale_name = "NewPurpose", new_scale_name = "New Purpose")
## 
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
## 
##     combine

#Time 3 as a result of time 1 and 2

results(modelname = modelNewPurpose_interaction_T3, fitname = fitNewPurpose1, data = adult2,  interactionterm = "NewPurpose_mean_1.GROUP1", current_scale_name = "NewPurpose", new_scale_name = "New Purpose")
## lavaan (0.5-20) converged normally after  35 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic              106.890
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -330.990
##   Loglikelihood unrestricted model (H1)       -330.990
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 687.980
##   Bayesian (BIC)                               720.332
##   Sample-size adjusted Bayesian (BIC)          679.307
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                         Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_NewPurpose ~                                             
##     GROUP1                 0.699    0.137    5.086    0.000    0.699
##     GROUP2                 0.055    0.389    0.141    0.888    0.055
##     SCALED_1_NwPrp         0.815    0.072   11.367    0.000    0.815
##     NwPr__1.GROUP1        -0.530    0.156   -3.396    0.001   -0.530
##   SCALED_3_NewPurpose ~                                             
##     GROUP1                 0.211    0.275    0.767    0.443    0.211
##     GROUP2                 0.690    0.857    0.806    0.420    0.690
##     SCALED_1_NwPrp         0.203    0.214    0.949    0.343    0.203
##     NwPr__1.GROUP1        -0.223    0.297   -0.751    0.452   -0.223
##     SCALED_2_NwPrp         0.622    0.228    2.734    0.006    0.622
##   Std.all
##          
##     0.342
##     0.011
##     0.794
##    -0.237
##          
##     0.095
##     0.129
##     0.182
##    -0.092
##     0.573
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_NwPrp   -0.478    0.093   -5.131    0.000   -0.478   -0.469
##     SCALED_3_NwPrp   -0.292    0.202   -1.444    0.149   -0.292   -0.264
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_NwPrp    0.285    0.051    5.581    0.000    0.285    0.275
##     SCALED_3_NwPrp    0.535    0.116    4.627    0.000    0.535    0.437
## 
## R-Square:
##                    Estimate
##     SCALED_2_NwPrp    0.725
##     SCALED_3_NwPrp    0.563
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.48 0.09 -5.13 0.00  -0.66, -0.3
## 2               GROUP1  0.70 0.14  5.09 0.00   0.43, 0.97
## 3               GROUP2  0.05 0.39  0.14 0.89  -0.71, 0.82
## 4          New Purpose  0.81 0.07 11.37 0.00   0.67, 0.96
## 5 Interaction w/ Group -0.53 0.16 -3.40 0.00 -0.84, -0.22
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.29 0.20 -1.44 0.15  -0.69, 0.1
## 2               GROUP1  0.21 0.28  0.77 0.44 -0.33, 0.75
## 3               GROUP2  0.69 0.86  0.81 0.42 -0.99, 2.37
## 4          New Purpose  0.20 0.21  0.95 0.34 -0.22, 0.62
## 5 Interaction w/ Group -0.22 0.30 -0.75 0.45 -0.81, 0.36
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.06      -1.29     0.43      -0.49
## 2      0     0.22      -0.48     0.41      -0.29
## 3      1     0.51       0.34     0.39      -0.09
#plots

plots(modelname = modelNewPurpose_interaction_T3, fitname = fitNewPurpose1, data = adult2,  interactionterm = "NewPurpose_mean_1.GROUP1", current_scale_name = "NewPurpose", new_scale_name = "New Purpose")

#########################################
#################  MLQP  #################
#########################################
 
results(modelname = modelMLQP_interaction, fitname = MLQ1, data = adult2,  interactionterm = "MLQ_mean_1.GROUP1", current_scale_name = "MLQP", new_scale_name = "MLQ - P")
## lavaan (0.5-20) converged normally after  29 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic              124.231
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -358.423
##   Loglikelihood unrestricted model (H1)       -358.423
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 742.845
##   Bayesian (BIC)                               775.197
##   Sample-size adjusted Bayesian (BIC)          734.172
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_MLQP ~                                                       
##     GROUP1            0.777    0.148    5.266    0.000    0.777    0.376
##     GROUP2            0.267    0.420    0.635    0.525    0.267    0.054
##     SCALED_1_MLQP     0.798    0.076   10.549    0.000    0.798    0.770
##     MLQ_m_1.GROUP1   -0.262    0.111   -2.366    0.018   -0.262   -0.174
##   SCALED_3_MLQP ~                                                       
##     GROUP1            0.840    0.188    4.468    0.000    0.840    0.361
##     GROUP2            0.653    0.641    1.019    0.308    0.653    0.116
##     SCALED_1_MLQP     0.888    0.108    8.215    0.000    0.888    0.761
##     MLQ_m_1.GROUP1   -0.553    0.156   -3.549    0.000   -0.553   -0.327
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_MLQP ~~                                                      
##     SCALED_3_MLQP     0.182    0.062    2.939    0.003    0.182    0.505
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQP    -0.519    0.100   -5.197    0.000   -0.519   -0.503
##     SCALED_3_MLQP    -0.745    0.136   -5.468    0.000   -0.745   -0.641
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQP     0.330    0.061    5.444    0.000    0.330    0.310
##     SCALED_3_MLQP     0.395    0.081    4.850    0.000    0.395    0.292
## 
## R-Square:
##                    Estimate
##     SCALED_2_MLQP     0.690
##     SCALED_3_MLQP     0.708
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.52 0.10 -5.20 0.00 -0.71, -0.32
## 2               GROUP1  0.78 0.15  5.27 0.00   0.49, 1.07
## 3               GROUP2  0.27 0.42  0.64 0.53  -0.56, 1.09
## 4              MLQ - P  0.80 0.08 10.55 0.00   0.65, 0.95
## 5 Interaction w/ Group -0.26 0.11 -2.37 0.02 -0.48, -0.04
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.74 0.14 -5.47 0.00 -1.01, -0.48
## 2               GROUP1  0.84 0.19  4.47 0.00   0.47, 1.21
## 3               GROUP2  0.65 0.64  1.02 0.31   -0.6, 1.91
## 4              MLQ - P  0.89 0.11  8.22 0.00    0.68, 1.1
## 5 Interaction w/ Group -0.55 0.16 -3.55 0.00 -0.86, -0.25
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.28      -1.32    -0.30      -1.63
## 2      0     0.26      -0.52     0.03      -0.74
## 3      1     0.79       0.28     0.37       0.14
plots(modelname = modelMLQP_interaction, fitname = MLQ, data = adult2,  interactionterm = "MLQ_mean_1.GROUP1", new_scale_name = "Meaning in Life Questionnaire - P")                              

#Time 3 as a result of time 1 and 2

results(modelname = modelMLQP_interaction_T3, fitname = MLQ1, data = adult2,  interactionterm = "MLQ_mean_1.GROUP1", current_scale_name = "MLQP", new_scale_name = "MLQ - P")
## lavaan (0.5-20) converged normally after  27 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic              124.231
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -358.423
##   Loglikelihood unrestricted model (H1)       -358.423
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 742.845
##   Bayesian (BIC)                               775.197
##   Sample-size adjusted Bayesian (BIC)          734.172
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_MLQP ~                                                       
##     GROUP1            0.777    0.148    5.266    0.000    0.777    0.376
##     GROUP2            0.267    0.420    0.635    0.525    0.267    0.054
##     SCALED_1_MLQP     0.798    0.076   10.549    0.000    0.798    0.770
##     MLQ_m_1.GROUP1   -0.262    0.111   -2.366    0.018   -0.262   -0.174
##   SCALED_3_MLQP ~                                                       
##     GROUP1            0.412    0.209    1.972    0.049    0.412    0.177
##     GROUP2            0.506    0.679    0.745    0.457    0.506    0.090
##     SCALED_1_MLQP     0.447    0.153    2.930    0.003    0.447    0.383
##     MLQ_m_1.GROUP1   -0.408    0.151   -2.706    0.007   -0.408   -0.241
##     SCALED_2_MLQP     0.552    0.150    3.682    0.000    0.552    0.490
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQP    -0.519    0.100   -5.197    0.000   -0.519   -0.503
##     SCALED_3_MLQP    -0.458    0.144   -3.177    0.001   -0.458   -0.394
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQP     0.330    0.061    5.444    0.000    0.330    0.310
##     SCALED_3_MLQP     0.294    0.067    4.417    0.000    0.294    0.218
## 
## R-Square:
##                    Estimate
##     SCALED_2_MLQP     0.690
##     SCALED_3_MLQP     0.782
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.52 0.10 -5.20 0.00 -0.71, -0.32
## 2               GROUP1  0.78 0.15  5.27 0.00   0.49, 1.07
## 3               GROUP2  0.27 0.42  0.64 0.53  -0.56, 1.09
## 4              MLQ - P  0.80 0.08 10.55 0.00   0.65, 0.95
## 5 Interaction w/ Group -0.26 0.11 -2.37 0.02 -0.48, -0.04
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.46 0.14 -3.18 0.00 -0.74, -0.18
## 2               GROUP1  0.41 0.21  1.97 0.05      0, 0.82
## 3               GROUP2  0.51 0.68  0.74 0.46  -0.83, 1.84
## 4              MLQ - P  0.45 0.15  2.93 0.00   0.15, 0.75
## 5 Interaction w/ Group -0.41 0.15 -2.71 0.01  -0.7, -0.11
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.28      -1.32     0.28      -0.90
## 2      0     0.26      -0.52     0.32      -0.46
## 3      1     0.79       0.28     0.36      -0.01
plots(modelname = modelMLQP_interaction_T3, fitname = MLQ, data = adult2,  interactionterm = "MLQ_mean_1.GROUP1", new_scale_name = "Meaning in Life Questionnaire - P")   

#########################################
#################  MLQS  #################
#########################################

results(modelname = modelMLQS_interaction, fitname = MLQ1, data = adult2,  interactionterm = "MLQS_mean_1.GROUP1", current_scale_name = "MLQS", new_scale_name = "MLQ - S")
## lavaan (0.5-20) converged normally after  34 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               82.096
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -393.798
##   Loglikelihood unrestricted model (H1)       -393.798
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 813.597
##   Bayesian (BIC)                               845.949
##   Sample-size adjusted Bayesian (BIC)          804.923
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_MLQS ~                                                       
##     GROUP1           -0.045    0.176   -0.255    0.799   -0.045   -0.023
##     GROUP2           -0.194    0.511   -0.379    0.705   -0.194   -0.041
##     SCALED_1_MLQS     0.684    0.084    8.136    0.000    0.684    0.701
##     MLQS__1.GROUP1    0.138    0.108    1.274    0.203    0.138    0.113
##   SCALED_3_MLQS ~                                                       
##     GROUP1            0.076    0.224    0.340    0.734    0.076    0.038
##     GROUP2            1.244    0.803    1.551    0.121    1.244    0.255
##     SCALED_1_MLQS     0.578    0.116    4.985    0.000    0.578    0.574
##     MLQS__1.GROUP1    0.142    0.150    0.950    0.342    0.142    0.113
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_MLQS ~~                                                      
##     SCALED_3_MLQS     0.315    0.081    3.880    0.000    0.315    0.576
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQS     0.044    0.117    0.374    0.709    0.044    0.045
##     SCALED_3_MLQS    -0.016    0.153   -0.104    0.917   -0.016   -0.016
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQS     0.489    0.086    5.693    0.000    0.489    0.509
##     SCALED_3_MLQS     0.612    0.119    5.131    0.000    0.612    0.598
## 
## R-Square:
##                    Estimate
##     SCALED_2_MLQS     0.491
##     SCALED_3_MLQS     0.402
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.04 0.12  0.37 0.71 -0.19, 0.27
## 2               GROUP1 -0.04 0.18 -0.25 0.80  -0.39, 0.3
## 3               GROUP2 -0.19 0.51 -0.38 0.70  -1.2, 0.81
## 4              MLQ - S  0.68 0.08  8.14 0.00  0.52, 0.85
## 5 Interaction w/ Group  0.14 0.11  1.27 0.20 -0.07, 0.35
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.02 0.15 -0.10 0.92 -0.32, 0.28
## 2               GROUP1  0.08 0.22  0.34 0.73 -0.36, 0.52
## 3               GROUP2  1.24 0.80  1.55 0.12 -0.33, 2.82
## 4              MLQ - S  0.58 0.12  4.98 0.00  0.35, 0.81
## 5 Interaction w/ Group  0.14 0.15  0.95 0.34 -0.15, 0.44
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.82      -0.64    -0.78      -0.59
## 2      0     0.00       0.04    -0.06      -0.02
## 3      1     0.82       0.73     0.66       0.56
plots(modelname = modelMLQS_interaction, fitname = MLQ, data = adult2,  interactionterm = "MLQS_mean_1.GROUP1", new_scale_name = "Meaning in Life Questionnaire - S")                              

#Time 3 as a result of time 1 and 2

results(modelname = modelMLQS_interaction_T3, fitname = MLQ1, data = adult2,  interactionterm = "MLQS_mean_1.GROUP1", current_scale_name = "MLQS", new_scale_name = "MLQ - S")
## lavaan (0.5-20) converged normally after  27 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               82.096
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -393.798
##   Loglikelihood unrestricted model (H1)       -393.798
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 813.597
##   Bayesian (BIC)                               845.949
##   Sample-size adjusted Bayesian (BIC)          804.923
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_MLQS ~                                                       
##     GROUP1           -0.045    0.176   -0.255    0.799   -0.045   -0.023
##     GROUP2           -0.194    0.511   -0.379    0.705   -0.194   -0.041
##     SCALED_1_MLQS     0.684    0.084    8.136    0.000    0.684    0.701
##     MLQS__1.GROUP1    0.138    0.108    1.274    0.203    0.138    0.113
##   SCALED_3_MLQS ~                                                       
##     GROUP1            0.105    0.197    0.533    0.594    0.105    0.052
##     GROUP2            1.369    0.865    1.584    0.113    1.369    0.281
##     SCALED_1_MLQS     0.137    0.134    1.022    0.307    0.137    0.136
##     MLQS__1.GROUP1    0.054    0.134    0.400    0.689    0.054    0.043
##     SCALED_2_MLQS     0.645    0.124    5.214    0.000    0.645    0.624
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQS     0.044    0.117    0.374    0.709    0.044    0.045
##     SCALED_3_MLQS    -0.044    0.138   -0.319    0.750   -0.044   -0.044
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQS     0.489    0.086    5.693    0.000    0.489    0.509
##     SCALED_3_MLQS     0.409    0.086    4.771    0.000    0.409    0.400
## 
## R-Square:
##                    Estimate
##     SCALED_2_MLQS     0.491
##     SCALED_3_MLQS     0.600
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.04 0.12  0.37 0.71 -0.19, 0.27
## 2               GROUP1 -0.04 0.18 -0.25 0.80  -0.39, 0.3
## 3               GROUP2 -0.19 0.51 -0.38 0.70  -1.2, 0.81
## 4              MLQ - S  0.68 0.08  8.14 0.00  0.52, 0.85
## 5 Interaction w/ Group  0.14 0.11  1.27 0.20 -0.07, 0.35
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.04 0.14 -0.32 0.75 -0.32, 0.23
## 2               GROUP1  0.11 0.20  0.53 0.59 -0.28, 0.49
## 3               GROUP2  1.37 0.86  1.58 0.11 -0.33, 3.06
## 4              MLQ - S  0.14 0.13  1.02 0.31  -0.13, 0.4
## 5 Interaction w/ Group  0.05 0.13  0.40 0.69 -0.21, 0.32
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.82      -0.64    -0.28      -0.18
## 2      0     0.00       0.04    -0.09      -0.04
## 3      1     0.82       0.73     0.10       0.09
plots(modelname = modelMLQS_interaction_T3, fitname = MLQ, data = adult2,  interactionterm = "MLQS_mean_1.GROUP1", new_scale_name = "Meaning in Life Questionnaire - S")                                                                                

#########################################
#################  Positive  #################
#########################################

   
results(modelname = modelPositive_interaction, fitname = fit, data = adult2,  interactionterm = "Positive_mean_1.GROUP1", current_scale_name = "Positive", new_scale_name = "Perma - Positive")
## lavaan (0.5-20) converged normally after  30 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               91.525
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -397.961
##   Loglikelihood unrestricted model (H1)       -397.961
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 821.921
##   Bayesian (BIC)                               854.273
##   Sample-size adjusted Bayesian (BIC)          813.248
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                       Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Positive ~                                             
##     GROUP1               0.345    0.176    1.962    0.050    0.345
##     GROUP2               0.615    0.500    1.231    0.218    0.615
##     SCALED_1_Postv       0.643    0.086    7.450    0.000    0.643
##     Pstv__1.GROUP1      -0.158    0.095   -1.672    0.094   -0.158
##   SCALED_3_Positive ~                                             
##     GROUP1               0.538    0.227    2.370    0.018    0.538
##     GROUP2               0.896    0.783    1.144    0.253    0.896
##     SCALED_1_Postv       0.665    0.135    4.936    0.000    0.665
##     Pstv__1.GROUP1      -0.158    0.153   -1.032    0.302   -0.158
##   Std.all
##          
##     0.175
##     0.130
##     0.648
##    -0.145
##          
##     0.249
##     0.172
##     0.610
##    -0.131
## 
## Covariances:
##                        Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Positive ~~                                             
##     SCALED_3_Postv        0.320    0.098    3.263    0.001    0.320
##   Std.all
##          
##     0.609
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Postv   -0.262    0.115   -2.270    0.023   -0.262   -0.266
##     SCALED_3_Postv   -0.467    0.153   -3.057    0.002   -0.467   -0.433
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Postv    0.470    0.090    5.198    0.000    0.470    0.488
##     SCALED_3_Postv    0.590    0.124    4.754    0.000    0.590    0.506
## 
## R-Square:
##                    Estimate
##     SCALED_2_Postv    0.512
##     SCALED_3_Postv    0.494
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.26 0.12 -2.27 0.02 -0.49, -0.04
## 2               GROUP1  0.34 0.18  1.96 0.05      0, 0.69
## 3               GROUP2  0.62 0.50  1.23 0.22  -0.36, 1.59
## 4     Perma - Positive  0.64 0.09  7.45 0.00   0.47, 0.81
## 5 Interaction w/ Group -0.16 0.09 -1.67 0.09  -0.34, 0.03
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.47 0.15 -3.06 0.00 -0.77, -0.17
## 2               GROUP1  0.54 0.23  2.37 0.02   0.09, 0.98
## 3               GROUP2  0.90 0.78  1.14 0.25  -0.64, 2.43
## 4     Perma - Positive  0.67 0.13  4.94 0.00    0.4, 0.93
## 5 Interaction w/ Group -0.16 0.15 -1.03 0.30  -0.46, 0.14
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.40      -0.90    -0.63      -1.13
## 2      0     0.08      -0.26    -0.12      -0.47
## 3      1     0.57       0.38     0.38       0.20
plots(modelname = modelPositive_interaction, fitname = fit, data = adult2,  interactionterm = "Positive_mean_1.GROUP1", new_scale_name = "Perma Positive Emotion") 

#Time 3 as a result of time 1 and 2
   
results(modelname = modelPositive_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Positive_mean_1.GROUP1", current_scale_name = "Positive", new_scale_name = "Perma - Positive")
## lavaan (0.5-20) converged normally after  30 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               91.525
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -397.961
##   Loglikelihood unrestricted model (H1)       -397.961
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 821.921
##   Bayesian (BIC)                               854.273
##   Sample-size adjusted Bayesian (BIC)          813.248
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                       Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Positive ~                                             
##     GROUP1               0.345    0.176    1.962    0.050    0.345
##     GROUP2               0.615    0.500    1.231    0.218    0.615
##     SCALED_1_Postv       0.643    0.086    7.450    0.000    0.643
##     Pstv__1.GROUP1      -0.158    0.095   -1.672    0.094   -0.158
##   SCALED_3_Positive ~                                             
##     GROUP1               0.303    0.214    1.415    0.157    0.303
##     GROUP2               0.477    0.854    0.559    0.576    0.477
##     SCALED_1_Postv       0.227    0.142    1.592    0.111    0.227
##     Pstv__1.GROUP1      -0.050    0.151   -0.329    0.742   -0.050
##     SCALED_2_Postv       0.682    0.150    4.532    0.000    0.682
##   Std.all
##          
##     0.175
##     0.130
##     0.648
##    -0.145
##          
##     0.140
##     0.092
##     0.208
##    -0.041
##     0.620
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Postv   -0.262    0.115   -2.270    0.023   -0.262   -0.266
##     SCALED_3_Postv   -0.289    0.145   -1.989    0.047   -0.289   -0.268
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Postv    0.470    0.090    5.198    0.000    0.470    0.488
##     SCALED_3_Postv    0.371    0.092    4.022    0.000    0.371    0.319
## 
## R-Square:
##                    Estimate
##     SCALED_2_Postv    0.512
##     SCALED_3_Postv    0.681
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.26 0.12 -2.27 0.02 -0.49, -0.04
## 2               GROUP1  0.34 0.18  1.96 0.05      0, 0.69
## 3               GROUP2  0.62 0.50  1.23 0.22  -0.36, 1.59
## 4     Perma - Positive  0.64 0.09  7.45 0.00   0.47, 0.81
## 5 Interaction w/ Group -0.16 0.09 -1.67 0.09  -0.34, 0.03
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.29 0.15 -1.99 0.05    -0.57, 0
## 2               GROUP1  0.30 0.21  1.41 0.16 -0.12, 0.72
## 3               GROUP2  0.48 0.85  0.56 0.58  -1.2, 2.15
## 4     Perma - Positive  0.23 0.14  1.59 0.11 -0.05, 0.51
## 5 Interaction w/ Group -0.05 0.15 -0.33 0.74 -0.35, 0.25
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.40      -0.90    -0.12      -0.52
## 2      0     0.08      -0.26     0.06      -0.29
## 3      1     0.57       0.38     0.23      -0.06
plots(modelname = modelPositive_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Positive_mean_1.GROUP1", new_scale_name = "Perma Positive Emotion")                                                                                        

#########################################
############### Achievement###############
#########################################
   
results(modelname = modelAcheivement_interaction, fitname = fit, data = adult2,  interactionterm = "Acheivement_mean_1.GROUP1", current_scale_name = "Acheivement", new_scale_name = "Perma - Acheivement")
## lavaan (0.5-20) converged normally after  28 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               68.912
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -406.748
##   Loglikelihood unrestricted model (H1)       -406.748
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 839.497
##   Bayesian (BIC)                               871.849
##   Sample-size adjusted Bayesian (BIC)          830.823
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                          Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Acheivement ~                                             
##     GROUP1                  0.400    0.193    2.073    0.038    0.400
##     GROUP2                  0.204    0.552    0.369    0.712    0.204
##     SCALED_1_Achvm          0.623    0.100    6.229    0.000    0.623
##     Achv__1.GROUP1         -0.294    0.115   -2.561    0.010   -0.294
##   SCALED_3_Acheivement ~                                             
##     GROUP1                  0.773    0.236    3.281    0.001    0.773
##     GROUP2                  1.039    0.792    1.313    0.189    1.039
##     SCALED_1_Achvm          0.692    0.134    5.147    0.000    0.692
##     Achv__1.GROUP1         -0.468    0.153   -3.054    0.002   -0.468
##   Std.all
##          
##     0.201
##     0.042
##     0.619
##    -0.257
##          
##     0.343
##     0.191
##     0.609
##    -0.362
## 
## Covariances:
##                           Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Acheivement ~~                                             
##     SCALED_3_Achvm           0.283    0.100    2.819    0.005    0.283
##   Std.all
##          
##     0.481
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Achvm   -0.288    0.129   -2.227    0.026   -0.288   -0.289
##     SCALED_3_Achvm   -0.598    0.170   -3.525    0.000   -0.598   -0.531
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Achvm    0.576    0.103    5.615    0.000    0.576    0.582
##     SCALED_3_Achvm    0.601    0.125    4.795    0.000    0.601    0.474
## 
## R-Square:
##                    Estimate
##     SCALED_2_Achvm    0.418
##     SCALED_3_Achvm    0.526
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.29 0.13 -2.23 0.03 -0.54, -0.03
## 2               GROUP1  0.40 0.19  2.07 0.04   0.02, 0.78
## 3               GROUP2  0.20 0.55  0.37 0.71  -0.88, 1.29
## 4  Perma - Acheivement  0.62 0.10  6.23 0.00   0.43, 0.82
## 5 Interaction w/ Group -0.29 0.11 -2.56 0.01 -0.52, -0.07
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.60 0.17 -3.52 0.00 -0.93, -0.27
## 2               GROUP1  0.77 0.24  3.28 0.00   0.31, 1.23
## 3               GROUP2  1.04 0.79  1.31 0.19  -0.51, 2.59
## 4  Perma - Acheivement  0.69 0.13  5.15 0.00   0.43, 0.96
## 5 Interaction w/ Group -0.47 0.15 -3.05 0.00 -0.77, -0.17
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.22      -0.91    -0.42      -1.29
## 2      0     0.11      -0.29    -0.20      -0.60
## 3      1     0.44       0.33     0.03       0.09
plots(modelname = modelAcheivement_interaction, fitname = fit, data = adult2,  interactionterm = "Acheivement_mean_1.GROUP1", new_scale_name = "Perma Acheivement") 

#Time 3 as a result of time 1 and 2
   
results(modelname = modelAcheivement_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Acheivement_mean_1.GROUP1", current_scale_name = "Acheivement", new_scale_name = "Perma - Acheivement")
## lavaan (0.5-20) converged normally after  26 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               68.912
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -406.748
##   Loglikelihood unrestricted model (H1)       -406.748
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 839.497
##   Bayesian (BIC)                               871.849
##   Sample-size adjusted Bayesian (BIC)          830.823
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                          Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Acheivement ~                                             
##     GROUP1                  0.400    0.193    2.073    0.038    0.400
##     GROUP2                  0.204    0.552    0.369    0.712    0.204
##     SCALED_1_Achvm          0.623    0.100    6.229    0.000    0.623
##     Achv__1.GROUP1         -0.294    0.115   -2.561    0.010   -0.294
##   SCALED_3_Acheivement ~                                             
##     GROUP1                  0.576    0.224    2.572    0.010    0.576
##     GROUP2                  0.939    0.834    1.127    0.260    0.939
##     SCALED_1_Achvm          0.386    0.158    2.440    0.015    0.386
##     Achv__1.GROUP1         -0.324    0.162   -2.002    0.045   -0.324
##     SCALED_2_Achvm          0.492    0.147    3.347    0.001    0.492
##   Std.all
##          
##     0.201
##     0.042
##     0.619
##    -0.257
##          
##     0.255
##     0.173
##     0.339
##    -0.251
##     0.435
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Achvm   -0.288    0.129   -2.227    0.026   -0.288   -0.289
##     SCALED_3_Achvm   -0.456    0.168   -2.719    0.007   -0.456   -0.405
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Achvm    0.576    0.103    5.615    0.000    0.576    0.582
##     SCALED_3_Achvm    0.462    0.101    4.562    0.000    0.462    0.364
## 
## R-Square:
##                    Estimate
##     SCALED_2_Achvm    0.418
##     SCALED_3_Achvm    0.636
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.29 0.13 -2.23 0.03 -0.54, -0.03
## 2               GROUP1  0.40 0.19  2.07 0.04   0.02, 0.78
## 3               GROUP2  0.20 0.55  0.37 0.71  -0.88, 1.29
## 4  Perma - Acheivement  0.62 0.10  6.23 0.00   0.43, 0.82
## 5 Interaction w/ Group -0.29 0.11 -2.56 0.01 -0.52, -0.07
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.46 0.17 -2.72 0.01 -0.78, -0.13
## 2               GROUP1  0.58 0.22  2.57 0.01   0.14, 1.02
## 3               GROUP2  0.94 0.83  1.13 0.26  -0.69, 2.57
## 4  Perma - Acheivement  0.39 0.16  2.44 0.01    0.08, 0.7
## 5 Interaction w/ Group -0.32 0.16 -2.00 0.05 -0.64, -0.01
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.22      -0.91    -0.12      -0.84
## 2      0     0.11      -0.29    -0.06      -0.46
## 3      1     0.44       0.33     0.01      -0.07
plots(modelname = modelAcheivement_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Acheivement_mean_1.GROUP1", new_scale_name = "Perma Acheivement")                                                                               

#########################################
################  Negative  ################
#########################################
 
results(modelname = modelNegative_interaction, fitname = fit, data = adult2,  interactionterm = "Negative_mean_1.GROUP1", current_scale_name = "Negative", new_scale_name = "Perma - Negative")
## lavaan (0.5-20) converged normally after  26 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               83.428
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -404.061
##   Loglikelihood unrestricted model (H1)       -404.061
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 834.122
##   Bayesian (BIC)                               866.474
##   Sample-size adjusted Bayesian (BIC)          825.448
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                       Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Nagative ~                                             
##     GROUP1              -0.273    0.193   -1.410    0.158   -0.273
##     GROUP2              -0.392    0.556   -0.705    0.481   -0.392
##     SCALED_1_Nagtv       0.639    0.100    6.385    0.000    0.639
##     Ngtv__1.GROUP1       0.030    0.108    0.283    0.777    0.030
##   SCALED_3_Nagative ~                                             
##     GROUP1              -0.306    0.195   -1.569    0.117   -0.306
##     GROUP2              -0.710    0.698   -1.017    0.309   -0.710
##     SCALED_1_Nagtv       0.665    0.097    6.851    0.000    0.665
##     Ngtv__1.GROUP1      -0.136    0.105   -1.302    0.193   -0.136
##   Std.all
##          
##    -0.135
##    -0.080
##     0.627
##     0.028
##          
##    -0.156
##    -0.150
##     0.672
##    -0.127
## 
## Covariances:
##                        Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Nagative ~~                                             
##     SCALED_3_Nagtv        0.273    0.087    3.132    0.002    0.273
##   Std.all
##          
##     0.529
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Nagtv    0.203    0.128    1.586    0.113    0.203    0.201
##     SCALED_3_Nagtv    0.184    0.131    1.400    0.161    0.184    0.188
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Nagtv    0.581    0.103    5.647    0.000    0.581    0.569
##     SCALED_3_Nagtv    0.459    0.097    4.720    0.000    0.459    0.477
## 
## R-Square:
##                    Estimate
##     SCALED_2_Nagtv    0.431
##     SCALED_3_Nagtv    0.523
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.20 0.13  1.59 0.11 -0.05, 0.45
## 2               GROUP1 -0.27 0.19 -1.41 0.16 -0.65, 0.11
## 3               GROUP2 -0.39 0.56 -0.71 0.48  -1.48, 0.7
## 4             Nagative  0.64 0.10  6.39 0.00  0.44, 0.84
## 5 Interaction w/ Group  0.03 0.11  0.28 0.78 -0.18, 0.24
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.18 0.13  1.40 0.16 -0.07, 0.44
## 2               GROUP1 -0.31 0.20 -1.57 0.12 -0.69, 0.08
## 3               GROUP2 -0.71 0.70 -1.02 0.31 -2.08, 0.66
## 4             Nagative  0.67 0.10  6.85 0.00  0.47, 0.86
## 5 Interaction w/ Group -0.14 0.10 -1.30 0.19 -0.34, 0.07
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.74      -0.44    -0.62      -0.48
## 2      0    -0.07       0.20    -0.09       0.18
## 3      1     0.60       0.84     0.44       0.85
plots(modelname = modelNegative_interaction, fitname = fit, data = adult2,  interactionterm = "Negative_mean_1.GROUP1", new_scale_name = "Perma Negative") 

#Time 3 as a result of time 1 and 2
   
results(modelname = modelNegative_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Negative_mean_1.GROUP1", current_scale_name = "Negative", new_scale_name = "Perma - Negative")
## lavaan (0.5-20) converged normally after  28 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               83.428
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -404.061
##   Loglikelihood unrestricted model (H1)       -404.061
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 834.122
##   Bayesian (BIC)                               866.474
##   Sample-size adjusted Bayesian (BIC)          825.448
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                       Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Nagative ~                                             
##     GROUP1              -0.273    0.193   -1.410    0.158   -0.273
##     GROUP2              -0.392    0.556   -0.705    0.481   -0.392
##     SCALED_1_Nagtv       0.639    0.100    6.385    0.000    0.639
##     Ngtv__1.GROUP1       0.030    0.108    0.283    0.777    0.030
##   SCALED_3_Nagative ~                                             
##     GROUP1              -0.178    0.179   -0.997    0.319   -0.178
##     GROUP2              -0.526    0.743   -0.708    0.479   -0.526
##     SCALED_1_Nagtv       0.365    0.121    3.024    0.002    0.365
##     Ngtv__1.GROUP1      -0.150    0.097   -1.555    0.120   -0.150
##     SCALED_2_Nagtv       0.470    0.124    3.775    0.000    0.470
##   Std.all
##          
##    -0.135
##    -0.080
##     0.627
##     0.028
##          
##    -0.091
##    -0.111
##     0.369
##    -0.140
##     0.484
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Nagtv    0.203    0.128    1.586    0.113    0.203    0.201
##     SCALED_3_Nagtv    0.089    0.123    0.720    0.471    0.089    0.090
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Nagtv    0.581    0.103    5.647    0.000    0.581    0.569
##     SCALED_3_Nagtv    0.331    0.072    4.602    0.000    0.331    0.344
## 
## R-Square:
##                    Estimate
##     SCALED_2_Nagtv    0.431
##     SCALED_3_Nagtv    0.656
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.20 0.13  1.59 0.11 -0.05, 0.45
## 2               GROUP1 -0.27 0.19 -1.41 0.16 -0.65, 0.11
## 3               GROUP2 -0.39 0.56 -0.71 0.48  -1.48, 0.7
## 4             Nagative  0.64 0.10  6.39 0.00  0.44, 0.84
## 5 Interaction w/ Group  0.03 0.11  0.28 0.78 -0.18, 0.24
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.09 0.12  0.72 0.47 -0.15, 0.33
## 2               GROUP1 -0.18 0.18 -1.00 0.32 -0.53, 0.17
## 3               GROUP2 -0.53 0.74 -0.71 0.48 -1.98, 0.93
## 4             Nagative  0.36 0.12  3.02 0.00   0.13, 0.6
## 5 Interaction w/ Group -0.15 0.10 -1.55 0.12 -0.34, 0.04
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.74      -0.44    -0.40      -0.28
## 2      0    -0.07       0.20    -0.18       0.09
## 3      1     0.60       0.84     0.03       0.45
plots(modelname = modelNegative_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Negative_mean_1.GROUP1", new_scale_name = "Perma Negative")

#########################################
############### Relationships ##############
#########################################
                                                       
 results(modelname = modelRelationships_interaction, fitname = fit, data = adult2,  interactionterm = "Relationships_mean_1.GROUP1", current_scale_name = "Relationships", new_scale_name = "Perma - Relationships")
## lavaan (0.5-20) converged normally after  32 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               68.571
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -417.315
##   Loglikelihood unrestricted model (H1)       -417.315
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 860.630
##   Bayesian (BIC)                               892.982
##   Sample-size adjusted Bayesian (BIC)          851.956
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                             Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Rrealtionships ~                                             
##     GROUP1                     0.224    0.198    1.132    0.258    0.224
##     GROUP2                     0.811    0.583    1.391    0.164    0.811
##     SCALED_1_Rrltn             0.572    0.100    5.706    0.000    0.572
##     Rltn__1.GROUP1             0.065    0.101    0.649    0.516    0.065
##   SCALED_3_Rrealtionships ~                                             
##     GROUP1                     0.468    0.254    1.846    0.065    0.468
##     GROUP2                     0.986    0.950    1.038    0.299    0.986
##     SCALED_1_Rrltn             0.429    0.141    3.035    0.002    0.429
##     Rltn__1.GROUP1            -0.075    0.140   -0.537    0.591   -0.075
##   Std.all
##          
##     0.111
##     0.167
##     0.564
##     0.064
##          
##     0.217
##     0.190
##     0.396
##    -0.069
## 
## Covariances:
##                              Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Rrealtionships ~~                                             
##     SCALED_3_Rrltn              0.539    0.122    4.433    0.000    0.539
##   Std.all
##          
##     0.737
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Rrltn   -0.196    0.131   -1.495    0.135   -0.196   -0.194
##     SCALED_3_Rrltn   -0.325    0.173   -1.884    0.060   -0.325   -0.302
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Rrltn    0.624    0.110    5.689    0.000    0.624    0.616
##     SCALED_3_Rrltn    0.857    0.177    4.836    0.000    0.857    0.739
## 
## R-Square:
##                    Estimate
##     SCALED_2_Rrltn    0.384
##     SCALED_3_Rrltn    0.261
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.20 0.13 -1.49 0.13 -0.45, 0.06
## 2               GROUP1  0.22 0.20  1.13 0.26 -0.16, 0.61
## 3               GROUP2  0.81 0.58  1.39 0.16 -0.33, 1.95
## 4       Rrealtionships  0.57 0.10  5.71 0.00  0.38, 0.77
## 5 Interaction w/ Group  0.07 0.10  0.65 0.52 -0.13, 0.26
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.32 0.17 -1.88 0.06 -0.66, 0.01
## 2               GROUP1  0.47 0.25  1.85 0.06 -0.03, 0.97
## 3               GROUP2  0.99 0.95  1.04 0.30 -0.88, 2.85
## 4       Rrealtionships  0.43 0.14  3.04 0.00  0.15, 0.71
## 5 Interaction w/ Group -0.08 0.14 -0.54 0.59  -0.35, 0.2
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.61      -0.77    -0.45      -0.75
## 2      0     0.03      -0.20    -0.10      -0.32
## 3      1     0.67       0.38     0.25       0.10
plots(modelname = modelRelationships_interaction, fitname = fit, data = adult2,  interactionterm = "Relationships_mean_1.GROUP1", new_scale_name = "Perma Relationships") 

#Time 3 as a result of time 1 and 2
   
 results(modelname = modelRelationships_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Relationships_mean_1.GROUP1", current_scale_name = "Relationships", new_scale_name = "Perma - Relationships")
## lavaan (0.5-20) converged normally after  28 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               68.571
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -417.315
##   Loglikelihood unrestricted model (H1)       -417.315
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 860.630
##   Bayesian (BIC)                               892.982
##   Sample-size adjusted Bayesian (BIC)          851.956
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                             Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Rrealtionships ~                                             
##     GROUP1                     0.224    0.198    1.132    0.258    0.224
##     GROUP2                     0.811    0.583    1.391    0.164    0.811
##     SCALED_1_Rrltn             0.572    0.100    5.706    0.000    0.572
##     Rltn__1.GROUP1             0.065    0.101    0.649    0.516    0.065
##   SCALED_3_Rrealtionships ~                                             
##     GROUP1                     0.274    0.196    1.403    0.161    0.274
##     GROUP2                     0.285    1.073    0.266    0.790    0.285
##     SCALED_1_Rrltn            -0.064    0.147   -0.437    0.662   -0.064
##     Rltn__1.GROUP1            -0.132    0.118   -1.118    0.263   -0.132
##     SCALED_2_Rrltn             0.864    0.132    6.569    0.000    0.864
##   Std.all
##          
##     0.111
##     0.167
##     0.564
##     0.064
##          
##     0.127
##     0.055
##    -0.059
##    -0.121
##     0.808
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Rrltn   -0.196    0.131   -1.495    0.135   -0.196   -0.194
##     SCALED_3_Rrltn   -0.156    0.137   -1.135    0.256   -0.156   -0.145
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Rrltn    0.624    0.110    5.689    0.000    0.624    0.616
##     SCALED_3_Rrltn    0.391    0.086    4.536    0.000    0.391    0.338
## 
## R-Square:
##                    Estimate
##     SCALED_2_Rrltn    0.384
##     SCALED_3_Rrltn    0.662
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.20 0.13 -1.49 0.13 -0.45, 0.06
## 2               GROUP1  0.22 0.20  1.13 0.26 -0.16, 0.61
## 3               GROUP2  0.81 0.58  1.39 0.16 -0.33, 1.95
## 4       Rrealtionships  0.57 0.10  5.71 0.00  0.38, 0.77
## 5 Interaction w/ Group  0.07 0.10  0.65 0.52 -0.13, 0.26
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.16 0.14 -1.13 0.26 -0.43, 0.11
## 2               GROUP1  0.27 0.20  1.40 0.16 -0.11, 0.66
## 3               GROUP2  0.29 1.07  0.27 0.79 -1.82, 2.39
## 4       Rrealtionships -0.06 0.15 -0.44 0.66 -0.35, 0.22
## 5 Interaction w/ Group -0.13 0.12 -1.12 0.26  -0.36, 0.1
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.61      -0.77     0.26      -0.09
## 2      0     0.03      -0.20     0.07      -0.16
## 3      1     0.67       0.38    -0.13      -0.22
plots(modelname = modelRelationships_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Relationships_mean_1.GROUP1", new_scale_name = "Perma Relationships") 

#########################################
#################  LET  #################
#########################################
   
results(modelname = modelLET_interaction, fitname = fit, data = adult2,  interactionterm = "LifeEngagement_mean_1.GROUP1", current_scale_name = "Relationships", new_scale_name = "LET")
## lavaan (0.5-20) converged normally after  35 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic              110.790
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -314.097
##   Loglikelihood unrestricted model (H1)       -314.097
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 654.194
##   Bayesian (BIC)                               686.546
##   Sample-size adjusted Bayesian (BIC)          645.521
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_LET ~                                                        
##     GROUP1            0.278    0.149    1.872    0.061    0.278    0.140
##     GROUP2            0.591    0.435    1.357    0.175    0.591    0.123
##     SCALED_1_LET      0.830    0.075   11.024    0.000    0.830    0.826
##     LfEn__1.GROUP1   -0.039    0.188   -0.207    0.836   -0.039   -0.016
##   SCALED_3_LET ~                                                        
##     GROUP1            0.564    0.227    2.481    0.013    0.564    0.268
##     GROUP2            1.632    0.807    2.023    0.043    1.632    0.321
##     SCALED_1_LET      0.684    0.119    5.753    0.000    0.684    0.642
##     LfEn__1.GROUP1   -0.077    0.297   -0.259    0.795   -0.077   -0.029
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_LET ~~                                                       
##     SCALED_3_LET      0.272    0.086    3.145    0.002    0.272    0.600
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LET     -0.244    0.100   -2.440    0.015   -0.244   -0.246
##     SCALED_3_LET     -0.443    0.163   -2.723    0.006   -0.443   -0.421
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LET      0.337    0.061    5.556    0.000    0.337    0.343
##     SCALED_3_LET      0.608    0.139    4.368    0.000    0.608    0.549
## 
## R-Square:
##                    Estimate
##     SCALED_2_LET      0.657
##     SCALED_3_LET      0.451
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.24 0.10 -2.44 0.01 -0.44, -0.05
## 2               GROUP1  0.28 0.15  1.87 0.06  -0.01, 0.57
## 3               GROUP2  0.59 0.44  1.36 0.17  -0.26, 1.44
## 4                  LET  0.83 0.08 11.02 0.00   0.68, 0.98
## 5 Interaction w/ Group -0.04 0.19 -0.21 0.84  -0.41, 0.33
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.44 0.16 -2.72 0.01 -0.76, -0.12
## 2               GROUP1  0.56 0.23  2.48 0.01   0.12, 1.01
## 3               GROUP2  1.63 0.81  2.02 0.04   0.05, 3.21
## 4                  LET  0.68 0.12  5.75 0.00   0.45, 0.92
## 5 Interaction w/ Group -0.08 0.30 -0.26 0.80  -0.66, 0.51
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.76      -1.07    -0.77      -1.13
## 2      0     0.03      -0.24    -0.17      -0.44
## 3      1     0.83       0.59     0.44       0.24
plots(modelname = modelLET_interaction, fitname = fit, data = adult2,  interactionterm = "LifeEngagement_mean_1.GROUP1", new_scale_name = "Life Engagement Scale") 

#Time 3 as a result of time 1 and 2
   
results(modelname = modelLET_interaction_T3, fitname = fit, data = adult2,  interactionterm = "LifeEngagement_mean_1.GROUP1", current_scale_name = "Relationships", new_scale_name = "LET")
## lavaan (0.5-20) converged normally after  34 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic              110.790
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -314.097
##   Loglikelihood unrestricted model (H1)       -314.097
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 654.194
##   Bayesian (BIC)                               686.546
##   Sample-size adjusted Bayesian (BIC)          645.521
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_LET ~                                                        
##     GROUP1            0.278    0.149    1.872    0.061    0.278    0.140
##     GROUP2            0.591    0.435    1.357    0.175    0.591    0.123
##     SCALED_1_LET      0.830    0.075   11.024    0.000    0.830    0.826
##     LfEn__1.GROUP1   -0.039    0.188   -0.207    0.836   -0.039   -0.016
##   SCALED_3_LET ~                                                        
##     GROUP1            0.340    0.215    1.579    0.114    0.340    0.161
##     GROUP2            1.156    0.881    1.313    0.189    1.156    0.228
##     SCALED_1_LET      0.016    0.207    0.077    0.939    0.016    0.015
##     LfEn__1.GROUP1   -0.046    0.265   -0.172    0.863   -0.046   -0.017
##     SCALED_2_LET      0.806    0.208    3.868    0.000    0.806    0.759
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LET     -0.244    0.100   -2.440    0.015   -0.244   -0.246
##     SCALED_3_LET     -0.247    0.162   -1.520    0.129   -0.247   -0.235
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LET      0.337    0.061    5.556    0.000    0.337    0.343
##     SCALED_3_LET      0.389    0.087    4.467    0.000    0.389    0.351
## 
## R-Square:
##                    Estimate
##     SCALED_2_LET      0.657
##     SCALED_3_LET      0.649
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.24 0.10 -2.44 0.01 -0.44, -0.05
## 2               GROUP1  0.28 0.15  1.87 0.06  -0.01, 0.57
## 3               GROUP2  0.59 0.44  1.36 0.17  -0.26, 1.44
## 4                  LET  0.83 0.08 11.02 0.00   0.68, 0.98
## 5 Interaction w/ Group -0.04 0.19 -0.21 0.84  -0.41, 0.33
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.25 0.16 -1.52 0.13 -0.57, 0.07
## 2               GROUP1  0.34 0.22  1.58 0.11 -0.08, 0.76
## 3               GROUP2  1.16 0.88  1.31 0.19 -0.57, 2.88
## 4                  LET  0.02 0.21  0.08 0.94 -0.39, 0.42
## 5 Interaction w/ Group -0.05 0.27 -0.17 0.86 -0.57, 0.47
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.76      -1.07     0.06      -0.26
## 2      0     0.03      -0.24     0.03      -0.25
## 3      1     0.83       0.59     0.00      -0.23
plots(modelname = modelLET_interaction_T3, fitname = fit, data = adult2,  interactionterm = "LifeEngagement_mean_1.GROUP1", new_scale_name = "Life Engagement Scale")                                                              

#########################################
################### LS  ###################
#########################################
                                                                    
results(modelname = modelLS_interaction, fitname = fit, data = adult2,  interactionterm = "LifeSatisfaction_mean_1.GROUP1", current_scale_name = "LS", new_scale_name = "Life Satisfaction")
## lavaan (0.5-20) converged normally after  29 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic              110.769
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -362.827
##   Loglikelihood unrestricted model (H1)       -362.827
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 751.654
##   Bayesian (BIC)                               784.007
##   Sample-size adjusted Bayesian (BIC)          742.981
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_LS ~                                                         
##     GROUP1            0.593    0.151    3.919    0.000    0.593    0.309
##     GROUP2            0.934    0.428    2.179    0.029    0.934    0.202
##     SCALED_1_LS       0.605    0.073    8.275    0.000    0.605    0.627
##     LfSt__1.GROUP1   -0.519    0.110   -4.704    0.000   -0.519   -0.360
##   SCALED_3_LS ~                                                         
##     GROUP1            0.566    0.220    2.580    0.010    0.566    0.271
##     GROUP2            0.532    0.782    0.680    0.496    0.532    0.106
##     SCALED_1_LS       0.581    0.112    5.192    0.000    0.581    0.552
##     LfSt__1.GROUP1   -0.506    0.169   -3.002    0.003   -0.506   -0.322
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_LS ~~                                                        
##     SCALED_3_LS       0.266    0.078    3.425    0.001    0.266    0.593
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LS      -0.297    0.099   -3.014    0.003   -0.297   -0.311
##     SCALED_3_LS      -0.374    0.148   -2.525    0.012   -0.374   -0.358
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LS       0.347    0.063    5.487    0.000    0.347    0.379
##     SCALED_3_LS       0.581    0.122    4.753    0.000    0.581    0.534
## 
## R-Square:
##                    Estimate
##     SCALED_2_LS       0.621
##     SCALED_3_LS       0.466
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.30 0.10 -3.01 0.00 -0.49, -0.1
## 2               GROUP1  0.59 0.15  3.92 0.00   0.3, 0.89
## 3               GROUP2  0.93 0.43  2.18 0.03  0.09, 1.77
## 4    Life Satisfaction  0.61 0.07  8.27 0.00  0.46, 0.75
## 5 Interaction w/ Group -0.52 0.11 -4.70 0.00 -0.74, -0.3
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.37 0.15 -2.53 0.01 -0.66, -0.08
## 2               GROUP1  0.57 0.22  2.58 0.01      0.14, 1
## 3               GROUP2  0.53 0.78  0.68 0.50     -1, 2.07
## 4    Life Satisfaction  0.58 0.11  5.19 0.00    0.36, 0.8
## 5 Interaction w/ Group -0.51 0.17 -3.00 0.00 -0.84, -0.18
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1     0.21      -0.90     0.14      -0.95
## 2      0     0.30      -0.30     0.22      -0.37
## 3      1     0.38       0.31     0.29       0.21
plots(modelname = modelLS_interaction, fitname = fit, data = adult2,  interactionterm = "LifeSatisfaction_mean_1.GROUP1", new_scale_name = "Life Satisfaction Scale")  

#Time 3 as a result of time 1 and 2
 
results(modelname = modelLS_interaction_T3, fitname = fit, data = adult2,  interactionterm = "LifeSatisfaction_mean_1.GROUP1", current_scale_name = "LS", new_scale_name = "Life Satisfaction")
## lavaan (0.5-20) converged normally after  29 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic              110.769
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -362.827
##   Loglikelihood unrestricted model (H1)       -362.827
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 751.654
##   Bayesian (BIC)                               784.007
##   Sample-size adjusted Bayesian (BIC)          742.981
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_LS ~                                                         
##     GROUP1            0.593    0.151    3.919    0.000    0.593    0.309
##     GROUP2            0.934    0.428    2.179    0.029    0.934    0.202
##     SCALED_1_LS       0.605    0.073    8.275    0.000    0.605    0.627
##     LfSt__1.GROUP1   -0.519    0.110   -4.704    0.000   -0.519   -0.360
##   SCALED_3_LS ~                                                         
##     GROUP1            0.112    0.213    0.525    0.600    0.112    0.054
##     GROUP2           -0.184    0.859   -0.214    0.831   -0.184   -0.036
##     SCALED_1_LS       0.117    0.142    0.824    0.410    0.117    0.111
##     LfSt__1.GROUP1   -0.108    0.177   -0.607    0.544   -0.108   -0.069
##     SCALED_2_LS       0.767    0.172    4.450    0.000    0.767    0.704
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LS      -0.297    0.099   -3.014    0.003   -0.297   -0.311
##     SCALED_3_LS      -0.145    0.141   -1.028    0.304   -0.145   -0.139
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LS       0.347    0.063    5.487    0.000    0.347    0.379
##     SCALED_3_LS       0.377    0.086    4.396    0.000    0.377    0.347
## 
## R-Square:
##                    Estimate
##     SCALED_2_LS       0.621
##     SCALED_3_LS       0.653
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.30 0.10 -3.01 0.00 -0.49, -0.1
## 2               GROUP1  0.59 0.15  3.92 0.00   0.3, 0.89
## 3               GROUP2  0.93 0.43  2.18 0.03  0.09, 1.77
## 4    Life Satisfaction  0.61 0.07  8.27 0.00  0.46, 0.75
## 5 Interaction w/ Group -0.52 0.11 -4.70 0.00 -0.74, -0.3
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.15 0.14 -1.03 0.30 -0.42, 0.13
## 2               GROUP1  0.11 0.21  0.52 0.60 -0.31, 0.53
## 3               GROUP2 -0.18 0.86 -0.21 0.83  -1.87, 1.5
## 4    Life Satisfaction  0.12 0.14  0.82 0.41  -0.16, 0.4
## 5 Interaction w/ Group -0.11 0.18 -0.61 0.54 -0.46, 0.24
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1     0.21      -0.90     0.44      -0.26
## 2      0     0.30      -0.30     0.45      -0.15
## 3      1     0.38       0.31     0.46      -0.03
plots(modelname = modelLS_interaction_T3, fitname = fit, data = adult2,  interactionterm = "LifeSatisfaction_mean_1.GROUP1", new_scale_name = "Life Satisfaction Scale")                                                                

#########################################
############### Engagement ##############
#########################################
 
results(modelname = modelEngagement_interaction, fitname = fit, data = adult2,  interactionterm = "Engagement_mean_1.GROUP1", current_scale_name = "Engagament", new_scale_name = "Perma Engagament")
## lavaan (0.5-20) converged normally after  33 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               36.618
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -425.877
##   Loglikelihood unrestricted model (H1)       -425.877
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 877.754
##   Bayesian (BIC)                               910.107
##   Sample-size adjusted Bayesian (BIC)          869.081
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                         Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Engagement ~                                             
##     GROUP1                 0.174    0.215    0.807    0.419    0.174
##     GROUP2                 0.759    0.630    1.204    0.229    0.759
##     SCALED_1_Enggm         0.531    0.111    4.776    0.000    0.531
##     Engg__1.GROUP1        -0.129    0.121   -1.070    0.285   -0.129
##   SCALED_3_Engagement ~                                             
##     GROUP1                 0.502    0.286    1.754    0.079    0.502
##     GROUP2                 0.889    0.991    0.897    0.370    0.889
##     SCALED_1_Enggm         0.406    0.195    2.080    0.038    0.406
##     Engg__1.GROUP1        -0.221    0.210   -1.054    0.292   -0.221
##   Std.all
##          
##     0.087
##     0.157
##     0.527
##    -0.118
##          
##     0.233
##     0.171
##     0.373
##    -0.188
## 
## Covariances:
##                          Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Engagement ~~                                             
##     SCALED_3_Enggm          0.402    0.150    2.677    0.007    0.402
##   Std.all
##          
##     0.498
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Enggm   -0.172    0.145   -1.184    0.237   -0.172   -0.172
##     SCALED_3_Enggm   -0.374    0.206   -1.816    0.069   -0.374   -0.347
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Enggm    0.708    0.130    5.452    0.000    0.708    0.708
##     SCALED_3_Enggm    0.917    0.195    4.708    0.000    0.917    0.790
## 
## R-Square:
##                    Estimate
##     SCALED_2_Enggm    0.292
##     SCALED_3_Enggm    0.210
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.17 0.15 -1.18 0.24 -0.46, 0.11
## 2               GROUP1  0.17 0.21  0.81 0.42 -0.25, 0.59
## 3               GROUP2  0.76 0.63  1.20 0.23 -0.48, 1.99
## 4           Engagement  0.53 0.11  4.78 0.00  0.31, 0.75
## 5 Interaction w/ Group -0.13 0.12 -1.07 0.28 -0.37, 0.11
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.37 0.21 -1.82 0.07 -0.78, 0.03
## 2               GROUP1  0.50 0.29  1.75 0.08 -0.06, 1.06
## 3               GROUP2  0.89 0.99  0.90 0.37 -1.05, 2.83
## 4           Engagement  0.41 0.20  2.08 0.04  0.02, 0.79
## 5 Interaction w/ Group -0.22 0.21 -1.05 0.29 -0.63, 0.19
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1     -0.4      -0.70    -0.39      -0.78
## 2      0      0.0      -0.17    -0.20      -0.37
## 3      1      0.4       0.36    -0.02       0.03
plots(modelname = modelEngagement_interaction, fitname = fit, data = adult2,  interactionterm = "Engagement_mean_1.GROUP1", new_scale_name = "Perma Engagament")  

#Time 3 as a result of time 1 and 2
 
results(modelname = modelEngagement_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Engagement_mean_1.GROUP1", current_scale_name = "Engagament", new_scale_name = "Perma Engagament")
## lavaan (0.5-20) converged normally after  34 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               36.618
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -425.877
##   Loglikelihood unrestricted model (H1)       -425.877
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 877.754
##   Bayesian (BIC)                               910.107
##   Sample-size adjusted Bayesian (BIC)          869.081
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                         Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Engagement ~                                             
##     GROUP1                 0.174    0.215    0.807    0.419    0.174
##     GROUP2                 0.759    0.630    1.204    0.229    0.759
##     SCALED_1_Enggm         0.531    0.111    4.776    0.000    0.531
##     Engg__1.GROUP1        -0.129    0.121   -1.070    0.285   -0.129
##   SCALED_3_Engagement ~                                             
##     GROUP1                 0.404    0.264    1.532    0.125    0.404
##     GROUP2                 0.458    1.053    0.435    0.664    0.458
##     SCALED_1_Enggm         0.104    0.203    0.515    0.607    0.104
##     Engg__1.GROUP1        -0.148    0.208   -0.711    0.477   -0.148
##     SCALED_2_Enggm         0.567    0.175    3.233    0.001    0.567
##   Std.all
##          
##     0.087
##     0.157
##     0.527
##    -0.118
##          
##     0.187
##     0.088
##     0.096
##    -0.125
##     0.527
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Enggm   -0.172    0.145   -1.184    0.237   -0.172   -0.172
##     SCALED_3_Enggm   -0.277    0.195   -1.422    0.155   -0.277   -0.257
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Enggm    0.708    0.130    5.452    0.000    0.708    0.708
##     SCALED_3_Enggm    0.690    0.158    4.353    0.000    0.690    0.594
## 
## R-Square:
##                    Estimate
##     SCALED_2_Enggm    0.292
##     SCALED_3_Enggm    0.406
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.17 0.15 -1.18 0.24 -0.46, 0.11
## 2               GROUP1  0.17 0.21  0.81 0.42 -0.25, 0.59
## 3               GROUP2  0.76 0.63  1.20 0.23 -0.48, 1.99
## 4           Engagement  0.53 0.11  4.78 0.00  0.31, 0.75
## 5 Interaction w/ Group -0.13 0.12 -1.07 0.28 -0.37, 0.11
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.28 0.19 -1.42 0.15  -0.66, 0.1
## 2               GROUP1  0.40 0.26  1.53 0.13 -0.11, 0.92
## 3               GROUP2  0.46 1.05  0.44 0.66 -1.61, 2.52
## 4           Engagement  0.10 0.20  0.51 0.61  -0.29, 0.5
## 5 Interaction w/ Group -0.15 0.21 -0.71 0.48 -0.56, 0.26
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1     -0.4      -0.70    -0.06      -0.38
## 2      0      0.0      -0.17    -0.10      -0.28
## 3      1      0.4       0.36    -0.15      -0.17
plots(modelname = modelEngagement_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Engagement_mean_1.GROUP1", new_scale_name = "Perma Engagament")                                                                                                 

#########################################
############### Optimism #################
#########################################
                                                                                                                            
results(modelname = modelOPTIMISM_interaction, fitname = fit, data = adult2,  interactionterm = "Optimism_mean_1.GROUP1", current_scale_name = "Optimism", new_scale_name = "Optimism Scale")
## lavaan (0.5-20) converged normally after  34 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               39.897
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -348.279
##   Loglikelihood unrestricted model (H1)       -348.279
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 722.557
##   Bayesian (BIC)                               754.909
##   Sample-size adjusted Bayesian (BIC)          713.883
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                       Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Optimism ~                                             
##     GROUP1              -0.285    0.233   -1.227    0.220   -0.285
##     GROUP2              -0.182    0.661   -0.276    0.783   -0.182
##     SCALED_1_Optms       0.356    0.113    3.161    0.002    0.356
##     Optm__1.GROUP1      -0.334    0.301   -1.107    0.268   -0.334
##   SCALED_3_Optimism ~                                             
##     GROUP1              -0.645    0.234   -2.762    0.006   -0.645
##     GROUP2              -0.234    0.796   -0.294    0.768   -0.234
##     SCALED_1_Optms       0.438    0.119    3.683    0.000    0.438
##     Optm__1.GROUP1      -0.707    0.317   -2.233    0.026   -0.707
##   Std.all
##          
##    -0.143
##    -0.038
##     0.356
##    -0.125
##          
##    -0.322
##    -0.049
##     0.435
##    -0.264
## 
## Covariances:
##                        Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Optimism ~~                                             
##     SCALED_3_Optms        0.247    0.116    2.136    0.033    0.247
##   Std.all
##          
##     0.350
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Optms    0.191    0.153    1.248    0.212    0.191    0.193
##     SCALED_3_Optms    0.402    0.161    2.498    0.012    0.402    0.402
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Optms    0.815    0.144    5.668    0.000    0.815    0.826
##     SCALED_3_Optms    0.609    0.126    4.847    0.000    0.609    0.610
## 
## R-Square:
##                    Estimate
##     SCALED_2_Optms    0.174
##     SCALED_3_Optms    0.390
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.19 0.15  1.25 0.21 -0.11, 0.49
## 2               GROUP1 -0.29 0.23 -1.23 0.22 -0.74, 0.17
## 3               GROUP2 -0.18 0.66 -0.28 0.78 -1.48, 1.11
## 4       Optimism Scale  0.36 0.11  3.16 0.00  0.14, 0.58
## 5 Interaction w/ Group -0.33 0.30 -1.11 0.27 -0.92, 0.26
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept  0.40 0.16  2.50 0.01   0.09, 0.72
## 2               GROUP1 -0.65 0.23 -2.76 0.01  -1.1, -0.19
## 3               GROUP2 -0.23 0.80 -0.29 0.77  -1.79, 1.33
## 4       Optimism Scale  0.44 0.12  3.68 0.00   0.21, 0.67
## 5 Interaction w/ Group -0.71 0.32 -2.23 0.03 -1.33, -0.09
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.12      -0.16     0.39      -0.04
## 2      0    -0.09       0.19     0.12       0.40
## 3      1    -0.07       0.55    -0.15       0.84
plots(modelname = modelOPTIMISM_interaction, fitname = fit, data = adult2,  interactionterm = "Optimism_mean_1.GROUP1", new_scale_name = "Optimism Scale")  

#Time 3 as a result of time 1 and 2
 
results(modelname = modelOPTIMISM_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Optimism_mean_1.GROUP1", current_scale_name = "Optimism", new_scale_name = "Optimism Scale")
## lavaan (0.5-20) converged normally after  33 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               39.897
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -348.279
##   Loglikelihood unrestricted model (H1)       -348.279
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 722.557
##   Bayesian (BIC)                               754.909
##   Sample-size adjusted Bayesian (BIC)          713.883
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                       Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Optimism ~                                             
##     GROUP1              -0.285    0.233   -1.227    0.220   -0.285
##     GROUP2              -0.182    0.661   -0.276    0.783   -0.182
##     SCALED_1_Optms       0.356    0.113    3.161    0.002    0.356
##     Optm__1.GROUP1      -0.334    0.301   -1.107    0.268   -0.334
##   SCALED_3_Optimism ~                                             
##     GROUP1              -0.559    0.230   -2.430    0.015   -0.559
##     GROUP2              -0.179    0.820   -0.219    0.827   -0.179
##     SCALED_1_Optms       0.331    0.128    2.578    0.010    0.331
##     Optm__1.GROUP1      -0.606    0.314   -1.932    0.053   -0.606
##     SCALED_2_Optms       0.303    0.129    2.352    0.019    0.303
##   Std.all
##          
##    -0.143
##    -0.038
##     0.356
##    -0.125
##          
##    -0.279
##    -0.037
##     0.328
##    -0.226
##     0.301
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Optms    0.191    0.153    1.248    0.212    0.191    0.193
##     SCALED_3_Optms    0.344    0.162    2.128    0.033    0.344    0.344
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Optms    0.815    0.144    5.668    0.000    0.815    0.826
##     SCALED_3_Optms    0.534    0.114    4.671    0.000    0.534    0.535
## 
## R-Square:
##                    Estimate
##     SCALED_2_Optms    0.174
##     SCALED_3_Optms    0.465
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.19 0.15  1.25 0.21 -0.11, 0.49
## 2               GROUP1 -0.29 0.23 -1.23 0.22 -0.74, 0.17
## 3               GROUP2 -0.18 0.66 -0.28 0.78 -1.48, 1.11
## 4       Optimism Scale  0.36 0.11  3.16 0.00  0.14, 0.58
## 5 Interaction w/ Group -0.33 0.30 -1.11 0.27 -0.92, 0.26
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept  0.34 0.16  2.13 0.03   0.03, 0.66
## 2               GROUP1 -0.56 0.23 -2.43 0.02 -1.01, -0.11
## 3               GROUP2 -0.18 0.82 -0.22 0.83  -1.79, 1.43
## 4       Optimism Scale  0.33 0.13  2.58 0.01   0.08, 0.58
## 5 Interaction w/ Group -0.61 0.31 -1.93 0.05  -1.22, 0.01
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.12      -0.16     0.33       0.01
## 2      0    -0.09       0.19     0.06       0.34
## 3      1    -0.07       0.55    -0.22       0.67
plots(modelname = modelOPTIMISM_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Optimism_mean_1.GROUP1", new_scale_name = "Optimism Scale")                                                                                         

#########################################
#################  PWB ###################
#########################################

results(modelname = modelPWB_interaction, fitname = fit, data = adult2,  interactionterm = "PurposePWB_mean_1.GROUP1", current_scale_name = "PWB", new_scale_name = "RPWB")
## lavaan (0.5-20) converged normally after  35 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               81.933
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -346.369
##   Loglikelihood unrestricted model (H1)       -346.369
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 718.738
##   Bayesian (BIC)                               751.090
##   Sample-size adjusted Bayesian (BIC)          710.064
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_PWB ~                                                        
##     GROUP1            0.424    0.181    2.349    0.019    0.424    0.206
##     GROUP2            1.052    0.524    2.006    0.045    1.052    0.212
##     SCALED_1_PWB      0.735    0.101    7.287    0.000    0.735    0.714
##     PPWB__1.GROUP1   -0.316    0.215   -1.474    0.141   -0.316   -0.147
##   SCALED_3_PWB ~                                                        
##     GROUP1            0.706    0.224    3.147    0.002    0.706    0.329
##     GROUP2            0.911    0.788    1.156    0.248    0.911    0.176
##     SCALED_1_PWB      0.662    0.132    5.006    0.000    0.662    0.617
##     PPWB__1.GROUP1   -0.543    0.278   -1.952    0.051   -0.543   -0.242
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_PWB ~~                                                       
##     SCALED_3_PWB      0.283    0.093    3.043    0.002    0.283    0.530
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PWB     -0.382    0.125   -3.065    0.002   -0.382   -0.373
##     SCALED_3_PWB     -0.575    0.162   -3.561    0.000   -0.575   -0.538
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PWB      0.491    0.089    5.544    0.000    0.491    0.466
##     SCALED_3_PWB      0.581    0.123    4.719    0.000    0.581    0.508
## 
## R-Square:
##                    Estimate
##     SCALED_2_PWB      0.534
##     SCALED_3_PWB      0.492
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.38 0.12 -3.06 0.00 -0.63, -0.14
## 2               GROUP1  0.42 0.18  2.35 0.02   0.07, 0.78
## 3               GROUP2  1.05 0.52  2.01 0.04   0.02, 2.08
## 4                 RPWB  0.74 0.10  7.29 0.00   0.54, 0.93
## 5 Interaction w/ Group -0.32 0.21 -1.47 0.14   -0.74, 0.1
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.58 0.16 -3.56 0.00 -0.89, -0.26
## 2               GROUP1  0.71 0.22  3.15 0.00   0.27, 1.15
## 3               GROUP2  0.91 0.79  1.16 0.25  -0.63, 2.46
## 4                 RPWB  0.66 0.13  5.01 0.00    0.4, 0.92
## 5 Interaction w/ Group -0.54 0.28 -1.95 0.05     -1.09, 0
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.38      -1.12    -0.27      -1.24
## 2      0     0.04      -0.38    -0.15      -0.58
## 3      1     0.46       0.35    -0.03       0.09
plots(modelname = modelPWB_interaction, fitname = fit, data = adult2,  interactionterm = "PurposePWB_mean_1.GROUP1", new_scale_name = "Ryff Purpose Subscale")  

#Time 3 as a result of time 1 and 2
 
results(modelname = modelPWB_interaction_T3, fitname = fit, data = adult2,  interactionterm = "PurposePWB_mean_1.GROUP1", current_scale_name = "PWB", new_scale_name = "RPWB")
## lavaan (0.5-20) converged normally after  31 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               81.933
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -346.369
##   Loglikelihood unrestricted model (H1)       -346.369
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 718.738
##   Bayesian (BIC)                               751.090
##   Sample-size adjusted Bayesian (BIC)          710.064
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_PWB ~                                                        
##     GROUP1            0.424    0.180    2.349    0.019    0.424    0.206
##     GROUP2            1.052    0.524    2.006    0.045    1.052    0.212
##     SCALED_1_PWB      0.735    0.101    7.287    0.000    0.735    0.714
##     PPWB__1.GROUP1   -0.316    0.215   -1.474    0.141   -0.316   -0.147
##   SCALED_3_PWB ~                                                        
##     GROUP1            0.462    0.214    2.161    0.031    0.462    0.215
##     GROUP2            0.305    0.852    0.358    0.720    0.305    0.059
##     SCALED_1_PWB      0.239    0.169    1.408    0.159    0.239    0.222
##     PPWB__1.GROUP1   -0.361    0.265   -1.364    0.172   -0.361   -0.161
##     SCALED_2_PWB      0.576    0.155    3.724    0.000    0.576    0.553
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PWB     -0.382    0.125   -3.065    0.002   -0.382   -0.373
##     SCALED_3_PWB     -0.355    0.160   -2.220    0.026   -0.355   -0.332
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PWB      0.491    0.089    5.544    0.000    0.491    0.466
##     SCALED_3_PWB      0.418    0.092    4.564    0.000    0.418    0.365
## 
## R-Square:
##                    Estimate
##     SCALED_2_PWB      0.534
##     SCALED_3_PWB      0.635
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.38 0.12 -3.06 0.00 -0.63, -0.14
## 2               GROUP1  0.42 0.18  2.35 0.02   0.07, 0.78
## 3               GROUP2  1.05 0.52  2.01 0.04   0.02, 2.08
## 4                 RPWB  0.74 0.10  7.29 0.00   0.54, 0.93
## 5 Interaction w/ Group -0.32 0.21 -1.47 0.14   -0.74, 0.1
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.36 0.16 -2.22 0.03 -0.67, -0.04
## 2               GROUP1  0.46 0.21  2.16 0.03   0.04, 0.88
## 3               GROUP2  0.31 0.85  0.36 0.72  -1.36, 1.97
## 4                 RPWB  0.24 0.17  1.41 0.16  -0.09, 0.57
## 5 Interaction w/ Group -0.36 0.26 -1.36 0.17  -0.88, 0.16
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.38      -1.12     0.19      -0.59
## 2      0     0.04      -0.38     0.07      -0.36
## 3      1     0.46       0.35    -0.05      -0.12
plots(modelname = modelPWB_interaction_T3, fitname = fit, data = adult2,  interactionterm = "PurposePWB_mean_1.GROUP1", new_scale_name = "Ryff Purpose Subscale")                                                                         

#########################################
#################  APSI  ###################
#########################################

results(modelname = modelAPSI_interaction, fitname = fit, data = adult2,  interactionterm = "PurposeAPSI_mean_1.GROUP1", current_scale_name = "APSI", new_scale_name = "APSI")
## lavaan (0.5-20) converged normally after  35 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic              110.256
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -305.729
##   Loglikelihood unrestricted model (H1)       -305.729
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 637.459
##   Bayesian (BIC)                               669.811
##   Sample-size adjusted Bayesian (BIC)          628.785
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_APSI ~                                                       
##     GROUP1            0.779    0.142    5.479    0.000    0.779    0.392
##     GROUP2            0.790    0.407    1.939    0.052    0.790    0.165
##     SCALED_1_APSI     0.816    0.072   11.347    0.000    0.816    0.815
##     PAPSI__1.GROUP   -0.720    0.198   -3.634    0.000   -0.720   -0.262
##   SCALED_3_APSI ~                                                       
##     GROUP1            0.682    0.234    2.913    0.004    0.682    0.325
##     GROUP2            0.370    0.802    0.461    0.645    0.370    0.073
##     SCALED_1_APSI     0.671    0.127    5.291    0.000    0.671    0.634
##     PAPSI__1.GROUP   -0.906    0.351   -2.584    0.010   -0.906   -0.311
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_APSI ~~                                                      
##     SCALED_3_APSI     0.212    0.078    2.707    0.007    0.212    0.495
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_APSI    -0.509    0.096   -5.274    0.000   -0.509   -0.513
##     SCALED_3_APSI    -0.542    0.174   -3.112    0.002   -0.542   -0.517
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_APSI     0.305    0.055    5.556    0.000    0.305    0.310
##     SCALED_3_APSI     0.600    0.129    4.639    0.000    0.600    0.546
## 
## R-Square:
##                    Estimate
##     SCALED_2_APSI     0.690
##     SCALED_3_APSI     0.454
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.51 0.10 -5.27 0.00  -0.7, -0.32
## 2               GROUP1  0.78 0.14  5.48 0.00    0.5, 1.06
## 3               GROUP2  0.79 0.41  1.94 0.05  -0.01, 1.59
## 4                 APSI  0.82 0.07 11.35 0.00   0.67, 0.96
## 5 Interaction w/ Group -0.72 0.20 -3.63 0.00 -1.11, -0.33
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.54 0.17 -3.11 0.00  -0.88, -0.2
## 2               GROUP1  0.68 0.23  2.91 0.00   0.22, 1.14
## 3               GROUP2  0.37 0.80  0.46 0.65   -1.2, 1.94
## 4                 APSI  0.67 0.13  5.29 0.00   0.42, 0.92
## 5 Interaction w/ Group -0.91 0.35 -2.58 0.01 -1.59, -0.22
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1     0.17      -1.32     0.47      -1.21
## 2      0     0.27      -0.51     0.24      -0.54
## 3      1     0.37       0.31     0.00       0.13
plots(modelname = modelAPSI_interaction, fitname = fit, data = adult2,  interactionterm = "PurposeAPSI_mean_1.GROUP1", new_scale_name = "APSI Sense of Identity")  

#Time 3 as a result of time 1 and 2
 
results(modelname = modelAPSI_interaction_T3, fitname = fit, data = adult2,  interactionterm = "PurposeAPSI_mean_1.GROUP1", current_scale_name = "APSI", new_scale_name = "APSI")
## lavaan (0.5-20) converged normally after  35 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic              110.256
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -305.729
##   Loglikelihood unrestricted model (H1)       -305.729
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 637.459
##   Bayesian (BIC)                               669.811
##   Sample-size adjusted Bayesian (BIC)          628.785
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_APSI ~                                                       
##     GROUP1            0.779    0.142    5.479    0.000    0.779    0.392
##     GROUP2            0.790    0.407    1.939    0.052    0.790    0.165
##     SCALED_1_APSI     0.816    0.072   11.347    0.000    0.816    0.815
##     PAPSI__1.GROUP   -0.720    0.198   -3.634    0.000   -0.720   -0.262
##   SCALED_3_APSI ~                                                       
##     GROUP1            0.141    0.279    0.505    0.614    0.141    0.067
##     GROUP2           -0.179    0.865   -0.207    0.836   -0.179   -0.035
##     SCALED_1_APSI     0.104    0.223    0.469    0.639    0.104    0.099
##     PAPSI__1.GROUP   -0.406    0.358   -1.135    0.256   -0.406   -0.140
##     SCALED_2_APSI     0.695    0.216    3.209    0.001    0.695    0.657
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_APSI    -0.509    0.096   -5.274    0.000   -0.509   -0.513
##     SCALED_3_APSI    -0.189    0.206   -0.916    0.360   -0.189   -0.180
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_APSI     0.305    0.055    5.556    0.000    0.305    0.310
##     SCALED_3_APSI     0.453    0.100    4.540    0.000    0.453    0.412
## 
## R-Square:
##                    Estimate
##     SCALED_2_APSI     0.690
##     SCALED_3_APSI     0.588
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.51 0.10 -5.27 0.00  -0.7, -0.32
## 2               GROUP1  0.78 0.14  5.48 0.00    0.5, 1.06
## 3               GROUP2  0.79 0.41  1.94 0.05  -0.01, 1.59
## 4                 APSI  0.82 0.07 11.35 0.00   0.67, 0.96
## 5 Interaction w/ Group -0.72 0.20 -3.63 0.00 -1.11, -0.33
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.19 0.21 -0.92 0.36 -0.59, 0.22
## 2               GROUP1  0.14 0.28  0.50 0.61 -0.41, 0.69
## 3               GROUP2 -0.18 0.87 -0.21 0.84 -1.87, 1.52
## 4                 APSI  0.10 0.22  0.47 0.64 -0.33, 0.54
## 5 Interaction w/ Group -0.41 0.36 -1.13 0.26  -1.11, 0.3
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1     0.17      -1.32     0.89      -0.29
## 2      0     0.27      -0.51     0.59      -0.19
## 3      1     0.37       0.31     0.29      -0.08
plots(modelname = modelAPSI_interaction_T3, fitname = fit, data = adult2,  interactionterm = "PurposeAPSI_mean_1.GROUP1", new_scale_name = "APSI Sense of Identity") 

#########################################
#################  Res       #################
#########################################
   
results(modelname = modelRes_interaction, fitname = fit, data = adult2,  interactionterm = "Res_mean_1.GROUP1", current_scale_name = "Res", new_scale_name = "Resiliance")
## lavaan (0.5-20) converged normally after  31 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic              110.540
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -388.563
##   Loglikelihood unrestricted model (H1)       -388.563
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 803.126
##   Bayesian (BIC)                               835.478
##   Sample-size adjusted Bayesian (BIC)          794.453
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_Res ~                                                        
##     GROUP1           -0.086    0.150   -0.576    0.564   -0.086   -0.040
##     GROUP2           -0.227    0.419   -0.541    0.589   -0.227   -0.044
##     SCALED_1_Res      0.943    0.084   11.190    0.000    0.943    0.865
##     Rs_mn_1.GROUP1    0.236    0.093    2.548    0.011    0.236    0.198
##   SCALED_3_Res ~                                                        
##     GROUP1            0.143    0.204    0.702    0.483    0.143    0.069
##     GROUP2            0.366    0.683    0.537    0.592    0.366    0.073
##     SCALED_1_Res      0.773    0.135    5.727    0.000    0.773    0.738
##     Rs_mn_1.GROUP1   -0.077    0.150   -0.516    0.606   -0.077   -0.068
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_Res ~~                                                       
##     SCALED_3_Res      0.104    0.069    1.500    0.134    0.104    0.271
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Res     -0.109    0.097   -1.125    0.261   -0.109   -0.101
##     SCALED_3_Res     -0.192    0.135   -1.419    0.156   -0.192   -0.186
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Res      0.329    0.058    5.701    0.000    0.329    0.284
##     SCALED_3_Res      0.448    0.095    4.699    0.000    0.448    0.417
## 
## R-Square:
##                    Estimate
##     SCALED_2_Res      0.716
##     SCALED_3_Res      0.583
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.11 0.10 -1.12 0.26  -0.3, 0.08
## 2               GROUP1 -0.09 0.15 -0.58 0.56 -0.38, 0.21
## 3               GROUP2 -0.23 0.42 -0.54 0.59 -1.05, 0.59
## 4           Resiliance  0.94 0.08 11.19 0.00  0.78, 1.11
## 5 Interaction w/ Group  0.24 0.09  2.55 0.01  0.05, 0.42
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.19 0.14 -1.42 0.16 -0.46, 0.07
## 2               GROUP1  0.14 0.20  0.70 0.48 -0.26, 0.54
## 3               GROUP2  0.37 0.68  0.54 0.59  -0.97, 1.7
## 4           Resiliance  0.77 0.14  5.73 0.00  0.51, 1.04
## 5 Interaction w/ Group -0.08 0.15 -0.52 0.61 -0.37, 0.22
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -1.37      -1.05    -0.97      -0.97
## 2      0    -0.20      -0.11    -0.28      -0.19
## 3      1     0.98       0.83     0.42       0.58
plots(modelname = modelRes_interaction, fitname = fit, data = adult2,  interactionterm = "Res_mean_1.GROUP1", new_scale_name = "Resiliance")  

#Time 3 as a result of time 1 and 2
 
results(modelname = modelRes_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Res_mean_1.GROUP1", current_scale_name = "Res", new_scale_name = "Resiliance")
## lavaan (0.5-20) converged normally after  31 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic              110.540
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -388.563
##   Loglikelihood unrestricted model (H1)       -388.563
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 803.126
##   Bayesian (BIC)                               835.478
##   Sample-size adjusted Bayesian (BIC)          794.453
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_Res ~                                                        
##     GROUP1           -0.086    0.150   -0.576    0.564   -0.086   -0.040
##     GROUP2           -0.227    0.419   -0.541    0.589   -0.227   -0.044
##     SCALED_1_Res      0.943    0.084   11.190    0.000    0.943    0.865
##     Rs_mn_1.GROUP1    0.236    0.093    2.548    0.011    0.236    0.198
##   SCALED_3_Res ~                                                        
##     GROUP1            0.171    0.200    0.853    0.394    0.171    0.082
##     GROUP2            0.438    0.696    0.630    0.529    0.438    0.088
##     SCALED_1_Res      0.475    0.241    1.972    0.049    0.475    0.453
##     Rs_mn_1.GROUP1   -0.152    0.150   -1.017    0.309   -0.152   -0.133
##     SCALED_2_Res      0.316    0.203    1.556    0.120    0.316    0.329
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Res     -0.109    0.097   -1.125    0.261   -0.109   -0.101
##     SCALED_3_Res     -0.158    0.136   -1.164    0.244   -0.158   -0.152
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Res      0.329    0.058    5.701    0.000    0.329    0.284
##     SCALED_3_Res      0.415    0.087    4.794    0.000    0.415    0.387
## 
## R-Square:
##                    Estimate
##     SCALED_2_Res      0.716
##     SCALED_3_Res      0.613
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.11 0.10 -1.12 0.26  -0.3, 0.08
## 2               GROUP1 -0.09 0.15 -0.58 0.56 -0.38, 0.21
## 3               GROUP2 -0.23 0.42 -0.54 0.59 -1.05, 0.59
## 4           Resiliance  0.94 0.08 11.19 0.00  0.78, 1.11
## 5 Interaction w/ Group  0.24 0.09  2.55 0.01  0.05, 0.42
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.16 0.14 -1.16 0.24 -0.42, 0.11
## 2               GROUP1  0.17 0.20  0.85 0.39 -0.22, 0.56
## 3               GROUP2  0.44 0.70  0.63 0.53  -0.93, 1.8
## 4           Resiliance  0.47 0.24  1.97 0.05     0, 0.95
## 5 Interaction w/ Group -0.15 0.15 -1.02 0.31 -0.45, 0.14
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -1.37      -1.05    -0.57      -0.63
## 2      0    -0.20      -0.11    -0.24      -0.16
## 3      1     0.98       0.83     0.08       0.32
plots(modelname = modelRes_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Res_mean_1.GROUP1", new_scale_name = "Resiliance")                                                                          

#########################################
#################  GRIT  #################
#########################################

results(modelname = modelGRIT_interaction, fitname = fit, data = adult2,  interactionterm = "GRIT_mean_1.GROUP1", current_scale_name = "GRIT", new_scale_name = "Grit")
## lavaan (0.5-20) converged normally after  44 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               28.559
##   Degrees of freedom                                 9
##   P-value                                        0.001
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -261.689
##   Loglikelihood unrestricted model (H1)       -261.689
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 549.379
##   Bayesian (BIC)                               581.731
##   Sample-size adjusted Bayesian (BIC)          540.705
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_GRIT ~                                                       
##     GROUP1           -0.433    0.203   -2.130    0.033   -0.433   -0.214
##     GROUP2            0.171    0.610    0.280    0.779    0.171    0.035
##     SCALED_1_GRIT     0.545    0.109    4.980    0.000    0.545    0.543
##     GRIT__1.GROUP1   -0.418    0.801   -0.521    0.602   -0.418   -0.059
##   SCALED_3_GRIT ~                                                       
##     GROUP1            0.048    0.295    0.164    0.870    0.048    0.024
##     GROUP2           -0.589    0.988   -0.596    0.551   -0.589   -0.123
##     SCALED_1_GRIT     0.200    0.171    1.164    0.244    0.200    0.202
##     GRIT__1.GROUP1    0.431    1.199    0.360    0.719    0.431    0.062
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_GRIT ~~                                                      
##     SCALED_3_GRIT     0.034    0.121    0.281    0.779    0.034    0.044
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_GRIT     0.168    0.135    1.242    0.214    0.168    0.167
##     SCALED_3_GRIT    -0.044    0.198   -0.222    0.824   -0.044   -0.044
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_GRIT     0.633    0.114    5.554    0.000    0.633    0.623
##     SCALED_3_GRIT     0.936    0.193    4.847    0.000    0.936    0.954
## 
## R-Square:
##                    Estimate
##     SCALED_2_GRIT     0.377
##     SCALED_3_GRIT     0.046
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept  0.17 0.14  1.24 0.21   -0.1, 0.43
## 2               GROUP1 -0.43 0.20 -2.13 0.03 -0.83, -0.03
## 3               GROUP2  0.17 0.61  0.28 0.78  -1.03, 1.37
## 4                 Grit  0.54 0.11  4.98 0.00   0.33, 0.76
## 5 Interaction w/ Group -0.42 0.80 -0.52 0.60  -1.99, 1.15
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.04 0.20 -0.22 0.82 -0.43, 0.34
## 2               GROUP1  0.05 0.30  0.16 0.87 -0.53, 0.63
## 3               GROUP2 -0.59 0.99 -0.60 0.55 -2.53, 1.35
## 4                 Grit  0.20 0.17  1.16 0.24 -0.14, 0.54
## 5 Interaction w/ Group  0.43 1.20  0.36 0.72 -1.92, 2.78
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.39      -0.38    -1.11      -0.24
## 2      0    -0.26       0.17    -0.48      -0.04
## 3      1    -0.14       0.71     0.15       0.16
plots(modelname = modelGRIT_interaction, fitname = fit, data = adult2,  interactionterm = "GRIT_mean_1.GROUP1", new_scale_name = "Grit Scale (Duckworth)")  

#Time 3 as a result of time 1 and 2
  
results(modelname = modelGRIT_interaction_T3, fitname = fit, data = adult2,  interactionterm = "GRIT_mean_1.GROUP1", current_scale_name = "GRIT", new_scale_name = "Grit")
## lavaan (0.5-20) converged normally after  45 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               28.559
##   Degrees of freedom                                 9
##   P-value                                        0.001
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -261.689
##   Loglikelihood unrestricted model (H1)       -261.689
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 549.379
##   Bayesian (BIC)                               581.731
##   Sample-size adjusted Bayesian (BIC)          540.705
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_GRIT ~                                                       
##     GROUP1           -0.433    0.203   -2.130    0.033   -0.433   -0.214
##     GROUP2            0.171    0.610    0.280    0.779    0.171    0.035
##     SCALED_1_GRIT     0.545    0.109    4.980    0.000    0.545    0.543
##     GRIT__1.GROUP1   -0.418    0.801   -0.521    0.602   -0.418   -0.059
##   SCALED_3_GRIT ~                                                       
##     GROUP1            0.072    0.299    0.239    0.811    0.072    0.036
##     GROUP2           -0.598    0.990   -0.604    0.546   -0.598   -0.125
##     SCALED_1_GRIT     0.170    0.210    0.810    0.418    0.170    0.173
##     GRIT__1.GROUP1    0.454    1.204    0.377    0.706    0.454    0.065
##     SCALED_2_GRIT     0.054    0.191    0.281    0.779    0.054    0.055
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_GRIT     0.168    0.135    1.242    0.214    0.168    0.167
##     SCALED_3_GRIT    -0.053    0.198   -0.268    0.789   -0.053   -0.054
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_GRIT     0.633    0.114    5.554    0.000    0.633    0.623
##     SCALED_3_GRIT     0.934    0.193    4.845    0.000    0.934    0.952
## 
## R-Square:
##                    Estimate
##     SCALED_2_GRIT     0.377
##     SCALED_3_GRIT     0.048
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept  0.17 0.14  1.24 0.21   -0.1, 0.43
## 2               GROUP1 -0.43 0.20 -2.13 0.03 -0.83, -0.03
## 3               GROUP2  0.17 0.61  0.28 0.78  -1.03, 1.37
## 4                 Grit  0.54 0.11  4.98 0.00   0.33, 0.76
## 5 Interaction w/ Group -0.42 0.80 -0.52 0.60  -1.99, 1.15
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.05 0.20 -0.27 0.79 -0.44, 0.34
## 2               GROUP1  0.07 0.30  0.24 0.81 -0.51, 0.66
## 3               GROUP2 -0.60 0.99 -0.60 0.55 -2.54, 1.34
## 4                 Grit  0.17 0.21  0.81 0.42 -0.24, 0.58
## 5 Interaction w/ Group  0.45 1.20  0.38 0.71 -1.91, 2.81
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.39      -0.38    -1.11      -0.22
## 2      0    -0.26       0.17    -0.49      -0.05
## 3      1    -0.14       0.71     0.14       0.12
plots(modelname = modelGRIT_interaction_T3, fitname = fit, data = adult2,  interactionterm = "GRIT_mean_1.GROUP1", new_scale_name = "Grit Scale (Duckworth)")  

#########################################
#################  Lonely  #################
#########################################
 
results(modelname = modelPERMA_Lonely_interaction, fitname = fit, data = adult2,  interactionterm = "PERMA_Lonely_mean_1.GROUP1", current_scale_name = "PERMA_Lonely", new_scale_name = "Perma Lonely")
## lavaan (0.5-20) converged normally after  30 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               62.164
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -447.296
##   Loglikelihood unrestricted model (H1)       -447.296
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 920.593
##   Bayesian (BIC)                               952.945
##   Sample-size adjusted Bayesian (BIC)          911.919
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                           Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_PERMA_Lonely ~                                             
##     GROUP1                  -0.154    0.208   -0.743    0.457   -0.154
##     GROUP2                  -0.303    0.596   -0.508    0.611   -0.303
##     SCALED_1_PERMA           0.568    0.106    5.384    0.000    0.568
##     PERMA_L__1.GRO           0.088    0.081    1.090    0.276    0.088
##   SCALED_3_PERMA_Lonely ~                                             
##     GROUP1                  -0.254    0.218   -1.164    0.244   -0.254
##     GROUP2                  -1.497    0.765   -1.956    0.050   -1.497
##     SCALED_1_PERMA           0.666    0.115    5.775    0.000    0.666
##     PERMA_L__1.GRO          -0.172    0.090   -1.904    0.057   -0.172
##   Std.all
##          
##    -0.077
##    -0.063
##     0.567
##     0.116
##          
##    -0.121
##    -0.296
##     0.634
##    -0.216
## 
## Covariances:
##                            Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_PERMA_Lonely ~~                                             
##     SCALED_3_PERMA            0.257    0.088    2.915    0.004    0.257
##   Std.all
##          
##     0.437
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA    0.141    0.137    1.031    0.302    0.141    0.141
##     SCALED_3_PERMA    0.225    0.147    1.533    0.125    0.225    0.214
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA    0.660    0.116    5.687    0.000    0.660    0.659
##     SCALED_3_PERMA    0.525    0.108    4.874    0.000    0.525    0.477
## 
## R-Square:
##                    Estimate
##     SCALED_2_PERMA    0.341
##     SCALED_3_PERMA    0.523
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.14 0.14  1.03 0.30 -0.13, 0.41
## 2               GROUP1 -0.15 0.21 -0.74 0.46 -0.56, 0.25
## 3               GROUP2 -0.30 0.60 -0.51 0.61 -1.47, 0.87
## 4         Perma Lonely  0.57 0.11  5.38 0.00  0.36, 0.78
## 5 Interaction w/ Group  0.09 0.08  1.09 0.28 -0.07, 0.25
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.22 0.15  1.53 0.13 -0.06, 0.51
## 2               GROUP1 -0.25 0.22 -1.16 0.24 -0.68, 0.17
## 3               GROUP2 -1.50 0.77 -1.96 0.05       -3, 0
## 4         Perma Lonely  0.67 0.12  5.78 0.00  0.44, 0.89
## 5 Interaction w/ Group -0.17 0.09 -1.90 0.06 -0.35, 0.01
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.67      -0.43    -0.42      -0.44
## 2      0    -0.01       0.14     0.07       0.22
## 3      1     0.64       0.71     0.56       0.89
plots(modelname = modelPERMA_Lonely_interaction, fitname = fit, data = adult2,  interactionterm = "PERMA_Lonely_mean_1.GROUP1", new_scale_name = "Perma Lonely")  

#Time 3 as a result of time 1 and 2
  
results(modelname = modelPERMA_Lonely_interaction_T3, fitname = fit, data = adult2,  interactionterm = "PERMA_Lonely_mean_1.GROUP1", current_scale_name = "PERMA_Lonely", new_scale_name = "Perma Lonely")
## lavaan (0.5-20) converged normally after  26 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               62.164
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -447.296
##   Loglikelihood unrestricted model (H1)       -447.296
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 920.593
##   Bayesian (BIC)                               952.945
##   Sample-size adjusted Bayesian (BIC)          911.919
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                           Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_PERMA_Lonely ~                                             
##     GROUP1                  -0.154    0.208   -0.743    0.457   -0.154
##     GROUP2                  -0.303    0.596   -0.508    0.611   -0.303
##     SCALED_1_PERMA           0.568    0.106    5.384    0.000    0.568
##     PERMA_L__1.GRO           0.088    0.081    1.090    0.276    0.088
##   SCALED_3_PERMA_Lonely ~                                             
##     GROUP1                  -0.194    0.209   -0.925    0.355   -0.194
##     GROUP2                  -1.379    0.797   -1.730    0.084   -1.379
##     SCALED_1_PERMA           0.445    0.125    3.542    0.000    0.445
##     PERMA_L__1.GRO          -0.206    0.084   -2.443    0.015   -0.206
##     SCALED_2_PERMA           0.390    0.114    3.429    0.001    0.390
##   Std.all
##          
##    -0.077
##    -0.063
##     0.567
##     0.116
##          
##    -0.092
##    -0.272
##     0.423
##    -0.260
##     0.372
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA    0.141    0.137    1.031    0.302    0.141    0.141
##     SCALED_3_PERMA    0.170    0.142    1.194    0.233    0.170    0.162
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA    0.660    0.116    5.687    0.000    0.660    0.659
##     SCALED_3_PERMA    0.425    0.092    4.637    0.000    0.425    0.386
## 
## R-Square:
##                    Estimate
##     SCALED_2_PERMA    0.341
##     SCALED_3_PERMA    0.614
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.14 0.14  1.03 0.30 -0.13, 0.41
## 2               GROUP1 -0.15 0.21 -0.74 0.46 -0.56, 0.25
## 3               GROUP2 -0.30 0.60 -0.51 0.61 -1.47, 0.87
## 4         Perma Lonely  0.57 0.11  5.38 0.00  0.36, 0.78
## 5 Interaction w/ Group  0.09 0.08  1.09 0.28 -0.07, 0.25
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept  0.17 0.14  1.19 0.23  -0.11, 0.45
## 2               GROUP1 -0.19 0.21 -0.92 0.36   -0.6, 0.22
## 3               GROUP2 -1.38 0.80 -1.73 0.08  -2.94, 0.18
## 4         Perma Lonely  0.44 0.13  3.54 0.00    0.2, 0.69
## 5 Interaction w/ Group -0.21 0.08 -2.44 0.01 -0.37, -0.04
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.67      -0.43    -0.22      -0.27
## 2      0    -0.01       0.14     0.02       0.17
## 3      1     0.64       0.71     0.25       0.61
plots(modelname = modelPERMA_Lonely_interaction_T3, fitname = fit, data = adult2,  interactionterm = "PERMA_Lonely_mean_1.GROUP1", new_scale_name = "Perma Lonely")                                                                                                      

#########################################
#################  Happy  #################
#########################################                                                               

results(modelname = modelPERMA_Happy_interaction, fitname = fit, data = adult2,  interactionterm = "PERMA_Happy_mean_1.GROUP1", current_scale_name = "PERMA_Happy", new_scale_name = "Perma Happy")
## lavaan (0.5-20) converged normally after  28 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               82.370
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -409.124
##   Loglikelihood unrestricted model (H1)       -409.124
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 844.249
##   Bayesian (BIC)                               876.601
##   Sample-size adjusted Bayesian (BIC)          835.575
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                          Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_PERMA_Happy ~                                             
##     GROUP1                  0.496    0.186    2.657    0.008    0.496
##     GROUP2                  0.942    0.537    1.752    0.080    0.942
##     SCALED_1_PERMA          0.618    0.100    6.210    0.000    0.618
##     PERMA_H__1.GRO         -0.174    0.103   -1.692    0.091   -0.174
##   SCALED_3_PERMA_Happy ~                                             
##     GROUP1                  0.479    0.221    2.166    0.030    0.479
##     GROUP2                  0.546    0.786    0.694    0.488    0.546
##     SCALED_1_PERMA          0.535    0.124    4.306    0.000    0.535
##     PERMA_H__1.GRO         -0.282    0.132   -2.141    0.032   -0.282
##   Std.all
##          
##     0.248
##     0.196
##     0.613
##    -0.167
##          
##     0.239
##     0.113
##     0.530
##    -0.270
## 
## Covariances:
##                           Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_PERMA_Happy ~~                                             
##     SCALED_3_PERMA           0.337    0.097    3.494    0.000    0.337
##   Std.all
##          
##     0.599
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA   -0.333    0.123   -2.719    0.007   -0.333   -0.334
##     SCALED_3_PERMA   -0.374    0.152   -2.467    0.014   -0.374   -0.375
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA    0.531    0.099    5.372    0.000    0.531    0.533
##     SCALED_3_PERMA    0.596    0.122    4.897    0.000    0.596    0.597
## 
## R-Square:
##                    Estimate
##     SCALED_2_PERMA    0.467
##     SCALED_3_PERMA    0.403
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.33 0.12 -2.72 0.01 -0.57, -0.09
## 2               GROUP1  0.50 0.19  2.66 0.01   0.13, 0.86
## 3               GROUP2  0.94 0.54  1.75 0.08     -0.11, 2
## 4          Perma Happy  0.62 0.10  6.21 0.00   0.42, 0.81
## 5 Interaction w/ Group -0.17 0.10 -1.69 0.09  -0.38, 0.03
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.37 0.15 -2.47 0.01 -0.67, -0.08
## 2               GROUP1  0.48 0.22  2.17 0.03   0.05, 0.91
## 3               GROUP2  0.55 0.79  0.69 0.49     -1, 2.09
## 4          Perma Happy  0.53 0.12  4.31 0.00   0.29, 0.78
## 5 Interaction w/ Group -0.28 0.13 -2.14 0.03 -0.54, -0.02
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.28      -0.95    -0.13      -0.91
## 2      0     0.16      -0.33     0.12      -0.37
## 3      1     0.61       0.29     0.37       0.16
plots(modelname = modelPERMA_Happy_interaction, fitname = fit, data = adult2,  interactionterm = "PERMA_Happy_mean_1.GROUP1", new_scale_name = "Perma Happy")  

#Time 3 as a result of time 1 and 2
  
results(modelname = modelPERMA_Happy_interaction_T3, fitname = fit, data = adult2,  interactionterm = "PERMA_Happy_mean_1.GROUP1", current_scale_name = "PERMA_Happy", new_scale_name = "Perma Happy")
## lavaan (0.5-20) converged normally after  26 iterations
## 
##   Number of observations                            89
## 
##   Number of missing patterns                         5
## 
##   Estimator                                         ML
##   Minimum Function Test Statistic                0.000
##   Degrees of freedom                                 0
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic               82.370
##   Degrees of freedom                                 9
##   P-value                                        0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    1.000
##   Tucker-Lewis Index (TLI)                       1.000
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)               -409.124
##   Loglikelihood unrestricted model (H1)       -409.124
## 
##   Number of free parameters                         13
##   Akaike (AIC)                                 844.249
##   Bayesian (BIC)                               876.601
##   Sample-size adjusted Bayesian (BIC)          835.575
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.000
##   90 Percent Confidence Interval          0.000  0.000
##   P-value RMSEA <= 0.05                          1.000
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.000
## 
## Parameter Estimates:
## 
##   Information                                 Observed
##   Standard Errors                             Standard
## 
## Regressions:
##                          Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_PERMA_Happy ~                                             
##     GROUP1                  0.496    0.186    2.657    0.008    0.496
##     GROUP2                  0.942    0.537    1.752    0.080    0.942
##     SCALED_1_PERMA          0.618    0.100    6.210    0.000    0.618
##     PERMA_H__1.GRO         -0.174    0.103   -1.692    0.091   -0.174
##   SCALED_3_PERMA_Happy ~                                             
##     GROUP1                  0.165    0.208    0.794    0.427    0.165
##     GROUP2                 -0.052    0.860   -0.061    0.952   -0.052
##     SCALED_1_PERMA          0.142    0.140    1.017    0.309    0.142
##     PERMA_H__1.GRO         -0.172    0.135   -1.274    0.203   -0.172
##     SCALED_2_PERMA          0.635    0.132    4.801    0.000    0.635
##   Std.all
##          
##     0.248
##     0.196
##     0.613
##    -0.167
##          
##     0.082
##    -0.011
##     0.141
##    -0.164
##     0.634
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA   -0.333    0.123   -2.719    0.007   -0.333   -0.334
##     SCALED_3_PERMA   -0.163    0.142   -1.143    0.253   -0.163   -0.163
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA    0.531    0.099    5.372    0.000    0.531    0.533
##     SCALED_3_PERMA    0.382    0.090    4.231    0.000    0.382    0.382
## 
## R-Square:
##                    Estimate
##     SCALED_2_PERMA    0.467
##     SCALED_3_PERMA    0.618
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.33 0.12 -2.72 0.01 -0.57, -0.09
## 2               GROUP1  0.50 0.19  2.66 0.01   0.13, 0.86
## 3               GROUP2  0.94 0.54  1.75 0.08     -0.11, 2
## 4          Perma Happy  0.62 0.10  6.21 0.00   0.42, 0.81
## 5 Interaction w/ Group -0.17 0.10 -1.69 0.09  -0.38, 0.03
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.16 0.14 -1.14 0.25 -0.44, 0.12
## 2               GROUP1  0.16 0.21  0.79 0.43 -0.24, 0.57
## 3               GROUP2 -0.05 0.86 -0.06 0.95 -1.74, 1.63
## 4          Perma Happy  0.14 0.14  1.02 0.31 -0.13, 0.42
## 5 Interaction w/ Group -0.17 0.13 -1.27 0.20 -0.44, 0.09
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.28      -0.95     0.36      -0.31
## 2      0     0.16      -0.33     0.33      -0.16
## 3      1     0.61       0.29     0.30      -0.02
plots(modelname = modelPERMA_Happy_interaction_T3, fitname = fit, data = adult2,  interactionterm = "PERMA_Happy_mean_1.GROUP1", new_scale_name = "Perma Happy")