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 object is masked from 'package:dplyr':

    tbl_df

Read-in the dataset

Read data

setwd("~/Documents/stats_march_2016/Adult_study Data_Analysis")
  adult2<-read.csv("adult2withscaled_W-OI-TT.csv")
#  View(adult2)
#dim(adult2)

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 + SCALED_1_NewPurpose + NewPurpose_mean_1.GROUP1
SCALED_3_NewPurpose ~ GROUP1 + 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 +  SCALED_1_NewPurpose + NewPurpose_mean_1.GROUP1
SCALED_3_NewPurpose ~ GROUP1 +  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 +  SCALED_1_MLQP + MLQ_mean_1.GROUP1
SCALED_3_MLQP ~ GROUP1 +  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 + SCALED_1_MLQP+ MLQ_mean_1.GROUP1
SCALED_3_MLQP ~ GROUP1 + 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 + SCALED_1_MLQS + MLQS_mean_1.GROUP1
SCALED_3_MLQS ~ GROUP1 + 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 +  SCALED_1_MLQS+ MLQS_mean_1.GROUP1
SCALED_3_MLQS ~ GROUP1 + 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 +  SCALED_1_PERMA_Happy + PERMA_Happy_mean_1.GROUP1
SCALED_3_PERMA_Happy ~ GROUP1 +  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 + SCALED_1_PERMA_Happy + PERMA_Happy_mean_1.GROUP1
SCALED_3_PERMA_Happy ~ GROUP1 +  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 + SCALED_1_PERMA_Lonely + PERMA_Lonely_mean_1.GROUP1
SCALED_3_PERMA_Lonely ~ GROUP1 + 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 +   SCALED_1_PERMA_Lonely + PERMA_Lonely_mean_1.GROUP1
SCALED_3_PERMA_Lonely ~ GROUP1 +   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 +   SCALED_1_GRIT +GRIT_mean_1.GROUP1
SCALED_3_GRIT ~ GROUP1 +   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 +   SCALED_1_GRIT +GRIT_mean_1.GROUP1
SCALED_3_GRIT ~ GROUP1 +   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 +   SCALED_1_Res +Res_mean_1.GROUP1
SCALED_3_Res ~ GROUP1 +   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 +   SCALED_1_Res +Res_mean_1.GROUP1
SCALED_3_Res ~ GROUP1 +   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 +   SCALED_1_APSI + PurposeAPSI_mean_1.GROUP1
SCALED_3_APSI ~ GROUP1 +   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 +   SCALED_1_APSI + PurposeAPSI_mean_1.GROUP1
SCALED_3_APSI ~ GROUP1 +   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 +   SCALED_1_PWB + PurposePWB_mean_1.GROUP1
SCALED_3_PWB ~ GROUP1 +   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 +   SCALED_1_PWB + PurposePWB_mean_1.GROUP1
SCALED_3_PWB ~ GROUP1 +   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 +   SCALED_1_Optimism + Optimism_mean_1.GROUP1
SCALED_3_Optimism ~ GROUP1 +   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 +   SCALED_1_Optimism + Optimism_mean_1.GROUP1
SCALED_3_Optimism ~ GROUP1 +   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 +   SCALED_1_LS +LifeSatisfaction_mean_1.GROUP1
SCALED_3_LS ~ GROUP1 +   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 +   SCALED_1_LS +LifeSatisfaction_mean_1.GROUP1
SCALED_3_LS ~ GROUP1 +   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 +   SCALED_1_Engagement + Engagement_mean_1.GROUP1
SCALED_3_Engagement ~ GROUP1 +   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 +   SCALED_1_Engagement + Engagement_mean_1.GROUP1
SCALED_3_Engagement ~ GROUP1 +   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 +   SCALED_1_Rrealtionships + Relationships_mean_1.GROUP1
SCALED_3_Rrealtionships ~ GROUP1 +   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 +   SCALED_1_Rrealtionships +Relationships_mean_1.GROUP1
SCALED_3_Rrealtionships ~ GROUP1 +   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 +   SCALED_1_Nagative + Negative_mean_1.GROUP1
SCALED_3_Nagative ~ GROUP1 +   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 +   SCALED_1_Nagative + Negative_mean_1.GROUP1
SCALED_3_Nagative ~ GROUP1 +   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 +   SCALED_1_Acheivement + Acheivement_mean_1.GROUP1
SCALED_3_Acheivement ~ GROUP1 +   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 +   SCALED_1_ Acheivement + Acheivement_mean_1.GROUP1
SCALED_3_Acheivement ~ GROUP1 +   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 +   SCALED_1_ Positive + Positive_mean_1.GROUP1
SCALED_3_Positive ~ GROUP1 +   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 +   SCALED_1_Positive + Positive_mean_1.GROUP1
SCALED_3_Positive ~ GROUP1 +   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 +   SCALED_1_LET + LifeEngagement_mean_1.GROUP1
SCALED_3_LET ~ GROUP1 +   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 +   SCALED_1_LET + LifeEngagement_mean_1.GROUP1
SCALED_3_LET ~ GROUP1 +   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 +   SCALED_1_PERMA_Happy + PERMA_Happy_mean_1.GROUP1
SCALED_3_PERMA_Happy ~ GROUP1 +   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 +   SCALED_1_PERMA_Happy + PERMA_Happy_mean_1.GROUP1
SCALED_3_PERMA_Happy ~ GROUP1 +   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 +  SCALED_1_PERMA_Lonely + PERMA_Lonely_mean_1.GROUP1
SCALED_3_PERMA_Lonely ~ GROUP1 + 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 +   SCALED_1_PERMA_Lonely + PERMA_Lonely_mean_1.GROUP1
SCALED_3_PERMA_Lonely ~ GROUP1 +   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(16, 1:3, 17, 4:6))
lolollol<-rename(lolollol, Item = rhs, β = est, SE = se, p = pvalue, "90% CI" = CI)
lolollol[1,1] <- sprintf('Intercept', lolollol[1,1])
lolollol[5,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:4)
lolollol2<-slice(lolollol, 5:8)
lolollol<-list(lolollol1,lolollol2)
lolollol
}



library(ggplot2)

PlotInter<-function(fitname, PlotTitle, time2, time3){
fit<-(parameterEstimates(fitname)) 
Treat=1
Control=0
Group0 <-fit[16,4]
Group1<- fit[1,4]
T1 = fit[2,4]
interaction1 = fit[3,4]
Group0_2 = fit[17,4]
Group2 = fit[4,4]
T1_2 = fit[5,4]
interaction2 = fit[6,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 = paste(PlotTitle, time2), 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 = paste(PlotTitle, time3), x = "Levels Pre in SD", y="Levels Post in SD", lty = "Lines" ))
library(gridExtra)
g<-grid.arrange(Plot1, Plot2, ncol=2, top = PlotTitle)
ggsave(file=paste(PlotTitle, time2,".PNG", sep = ""), Plot1)
ggsave(file=paste(PlotTitle, time3,".PNG", sep = ""), Plot2)}

SimpleSlopes<-function(fitName){
fit<-(parameterEstimates(fitName)) 
Treat=1
Control=0
Group0 <-fit[16,4]
Group1<- fit[1,4]
T1 = fit[2,4]
interaction1 = fit[3,4]
Group0_2 = fit[17,4]
Group2 = fit[4,4]
T1_2 = fit[5,4]
interaction2 = fit[6,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, time2, time3){
fitname<-sem(modelname, data, missing='fiml', meanstructure=TRUE,fixed.x=T)  
PlotInter(fitname, new_scale_name, time2, time3)
}

Fits

#########################################
#################  New Purpose  ###########
#########################################
library(purrr) 
## 
## Attaching package: 'purrr'
## The following objects are masked from 'package:dplyr':
## 
##     contains, 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  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              104.105
##   Degrees of freedom                                 7
##   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.605
##   Loglikelihood unrestricted model (H1)       -348.605
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 719.210
##   Bayesian (BIC)                               746.585
##   Sample-size adjusted Bayesian (BIC)          711.871
## 
## 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.658    0.137    4.786    0.000    0.658
##     SCALED_1_NwPrp         0.814    0.073   11.127    0.000    0.814
##     NwPr__1.GROUP1        -0.527    0.159   -3.309    0.001   -0.527
##   SCALED_3_NewPurpose ~                                             
##     GROUP1                 0.624    0.246    2.539    0.011    0.624
##     SCALED_1_NwPrp         0.708    0.137    5.155    0.000    0.708
##     NwPr__1.GROUP1        -0.554    0.299   -1.853    0.064   -0.554
##   Std.all
##          
##     0.325
##     0.800
##    -0.238
##          
##     0.282
##     0.636
##    -0.228
## 
## Covariances:
##                          Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_NewPurpose ~~                                             
##     SCALED_3_NwPrp          0.185    0.077    2.396    0.017    0.185
##   Std.all
##          
##     0.421
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_NwPrp   -0.478    0.095   -5.027    0.000   -0.478   -0.473
##     SCALED_3_NwPrp   -0.589    0.187   -3.149    0.002   -0.589   -0.533
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_NwPrp    0.297    0.053    5.575    0.000    0.297    0.291
##     SCALED_3_NwPrp    0.649    0.136    4.776    0.000    0.649    0.531
## 
## R-Square:
##                    Estimate
##     SCALED_2_NwPrp    0.709
##     SCALED_3_NwPrp    0.469
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z p       90% CI
## 1            Intercept -0.48 0.09 -5.03 0 -0.66, -0.29
## 2               GROUP1  0.66 0.14  4.79 0   0.39, 0.93
## 3          New Purpose  0.81 0.07 11.13 0   0.67, 0.96
## 4 Interaction w/ Group -0.53 0.16 -3.31 0 -0.84, -0.21
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.59 0.19 -3.15 0.00 -0.96, -0.22
## 2               GROUP1  0.62 0.25  2.54 0.01   0.14, 1.11
## 3          New Purpose  0.71 0.14  5.15 0.00   0.44, 0.98
## 4 Interaction w/ Group -0.55 0.30 -1.85 0.06  -1.14, 0.03
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.11      -1.29    -0.09      -1.30
## 2      0     0.18      -0.48     0.07      -0.59
## 3      1     0.47       0.34     0.22       0.12
plots(modelname = modelNewPurpose_interaction, fitname = fitNewPurpose1, data = adult2,  interactionterm = "NewPurpose_mean_1.GROUP1", current_scale_name = "NewPurpose", new_scale_name = "New Purpose", time2 = "T1-T2", time3 = "T1-T3")
## 
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
## 
##     combine
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  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              104.105
##   Degrees of freedom                                 7
##   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.605
##   Loglikelihood unrestricted model (H1)       -348.605
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 719.210
##   Bayesian (BIC)                               746.585
##   Sample-size adjusted Bayesian (BIC)          711.871
## 
## 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.658    0.137    4.786    0.000    0.658
##     SCALED_1_NwPrp         0.814    0.073   11.127    0.000    0.814
##     NwPr__1.GROUP1        -0.527    0.159   -3.309    0.001   -0.527
##   SCALED_3_NewPurpose ~                                             
##     GROUP1                 0.215    0.273    0.787    0.431    0.215
##     SCALED_1_NwPrp         0.202    0.213    0.947    0.343    0.202
##     NwPr__1.GROUP1        -0.225    0.297   -0.759    0.448   -0.225
##     SCALED_2_NwPrp         0.622    0.227    2.736    0.006    0.622
##   Std.all
##          
##     0.325
##     0.800
##    -0.238
##          
##     0.097
##     0.181
##    -0.093
##     0.568
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_NwPrp   -0.478    0.095   -5.027    0.000   -0.478   -0.473
##     SCALED_3_NwPrp   -0.292    0.202   -1.443    0.149   -0.292   -0.264
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_NwPrp    0.297    0.053    5.575    0.000    0.297    0.291
##     SCALED_3_NwPrp    0.534    0.116    4.619    0.000    0.534    0.437
## 
## R-Square:
##                    Estimate
##     SCALED_2_NwPrp    0.709
##     SCALED_3_NwPrp    0.563
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z p       90% CI
## 1            Intercept -0.48 0.09 -5.03 0 -0.66, -0.29
## 2               GROUP1  0.66 0.14  4.79 0   0.39, 0.93
## 3          New Purpose  0.81 0.07 11.13 0   0.67, 0.96
## 4 Interaction w/ Group -0.53 0.16 -3.31 0 -0.84, -0.21
## 
## [[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.22 0.27  0.79 0.43 -0.32, 0.75
## 3          New Purpose  0.20 0.21  0.95 0.34 -0.22, 0.62
## 4 Interaction w/ Group -0.23 0.30 -0.76 0.45 -0.81, 0.36
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.11      -1.29     0.39      -0.49
## 2      0     0.18      -0.48     0.37      -0.29
## 3      1     0.47       0.34     0.34      -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", time2 = "T1-T2", time3 = "T1-T2-T3")
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
#################  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  22 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              122.649
##   Degrees of freedom                                 7
##   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)               -375.161
##   Loglikelihood unrestricted model (H1)       -375.161
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 772.322
##   Bayesian (BIC)                               799.697
##   Sample-size adjusted Bayesian (BIC)          764.983
## 
## 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.743    0.146    5.081    0.000    0.743    0.360
##     SCALED_1_MLQP     0.802    0.076   10.507    0.000    0.802    0.774
##     MLQ_m_1.GROUP1   -0.264    0.112   -2.359    0.018   -0.264   -0.176
##   SCALED_3_MLQP ~                                                       
##     GROUP1            0.814    0.185    4.403    0.000    0.814    0.351
##     SCALED_1_MLQP     0.886    0.108    8.231    0.000    0.886    0.762
##     MLQ_m_1.GROUP1   -0.550    0.155   -3.545    0.000   -0.550   -0.326
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_MLQP ~~                                                      
##     SCALED_3_MLQP     0.187    0.063    2.946    0.003    0.187    0.510
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQP    -0.521    0.101   -5.160    0.000   -0.521   -0.505
##     SCALED_3_MLQP    -0.743    0.136   -5.451    0.000   -0.743   -0.642
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQP     0.338    0.062    5.437    0.000    0.338    0.317
##     SCALED_3_MLQP     0.397    0.082    4.835    0.000    0.397    0.296
## 
## R-Square:
##                    Estimate
##     SCALED_2_MLQP     0.683
##     SCALED_3_MLQP     0.704
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.52 0.10 -5.16 0.00 -0.72, -0.32
## 2               GROUP1  0.74 0.15  5.08 0.00   0.46, 1.03
## 3              MLQ - P  0.80 0.08 10.51 0.00   0.65, 0.95
## 4 Interaction w/ Group -0.26 0.11 -2.36 0.02 -0.48, -0.04
## 
## [[1]][[2]]
##                   Item     β   SE     z p       90% CI
## 1            Intercept -0.74 0.14 -5.45 0 -1.01, -0.48
## 2               GROUP1  0.81 0.18  4.40 0   0.45, 1.18
## 3              MLQ - P  0.89 0.11  8.23 0    0.68, 1.1
## 4 Interaction w/ Group -0.55 0.16 -3.54 0 -0.85, -0.25
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.32      -1.32    -0.34      -1.63
## 2      0     0.22      -0.52     0.00      -0.74
## 3      1     0.76       0.28     0.34       0.14
plots(modelname = modelMLQP_interaction, fitname = MLQ, data = adult2,  interactionterm = "MLQ_mean_1.GROUP1", new_scale_name = "Meaning in Life Questionnaire - P", time2 = "T1-T2", time3 = "T1-T3")                              
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  19 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              122.649
##   Degrees of freedom                                 7
##   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)               -375.161
##   Loglikelihood unrestricted model (H1)       -375.161
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 772.322
##   Bayesian (BIC)                               799.697
##   Sample-size adjusted Bayesian (BIC)          764.983
## 
## 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.743    0.146    5.081    0.000    0.743    0.360
##     SCALED_1_MLQP     0.802    0.076   10.507    0.000    0.802    0.774
##     MLQ_m_1.GROUP1   -0.264    0.112   -2.359    0.018   -0.264   -0.176
##   SCALED_3_MLQP ~                                                       
##     GROUP1            0.403    0.206    1.957    0.050    0.403    0.174
##     SCALED_1_MLQP     0.443    0.152    2.918    0.004    0.443    0.381
##     MLQ_m_1.GROUP1   -0.404    0.150   -2.695    0.007   -0.404   -0.239
##     SCALED_2_MLQP     0.553    0.150    3.698    0.000    0.553    0.493
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQP    -0.521    0.101   -5.160    0.000   -0.521   -0.505
##     SCALED_3_MLQP    -0.455    0.144   -3.160    0.002   -0.455   -0.393
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQP     0.338    0.062    5.437    0.000    0.338    0.317
##     SCALED_3_MLQP     0.294    0.067    4.409    0.000    0.294    0.219
## 
## R-Square:
##                    Estimate
##     SCALED_2_MLQP     0.683
##     SCALED_3_MLQP     0.781
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.52 0.10 -5.16 0.00 -0.72, -0.32
## 2               GROUP1  0.74 0.15  5.08 0.00   0.46, 1.03
## 3              MLQ - P  0.80 0.08 10.51 0.00   0.65, 0.95
## 4 Interaction w/ Group -0.26 0.11 -2.36 0.02 -0.48, -0.04
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.45 0.14 -3.16 0.00 -0.74, -0.17
## 2               GROUP1  0.40 0.21  1.96 0.05      0, 0.81
## 3              MLQ - P  0.44 0.15  2.92 0.00   0.15, 0.74
## 4 Interaction w/ Group -0.40 0.15 -2.70 0.01  -0.7, -0.11
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.32      -1.32     0.25      -0.90
## 2      0     0.22      -0.52     0.29      -0.45
## 3      1     0.76       0.28     0.33      -0.01
plots(modelname = modelMLQP_interaction_T3, fitname = MLQ, data = adult2,  interactionterm = "MLQ_mean_1.GROUP1", new_scale_name = "Meaning in Life Questionnaire - P", time2 = "T1-T2", time3 = "T1-T2-T3")   
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
#################  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  25 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               79.943
##   Degrees of freedom                                 7
##   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)               -410.746
##   Loglikelihood unrestricted model (H1)       -410.746
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 843.492
##   Bayesian (BIC)                               870.867
##   Sample-size adjusted Bayesian (BIC)          836.153
## 
## 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.036    0.173   -0.207    0.836   -0.036   -0.018
##     SCALED_1_MLQS     0.676    0.084    8.014    0.000    0.676    0.694
##     MLQS__1.GROUP1    0.148    0.108    1.365    0.172    0.148    0.121
##   SCALED_3_MLQS ~                                                       
##     GROUP1            0.125    0.224    0.557    0.578    0.125    0.063
##     SCALED_1_MLQS     0.558    0.117    4.758    0.000    0.558    0.571
##     MLQS__1.GROUP1    0.157    0.152    1.029    0.304    0.157    0.128
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_MLQS ~~                                                      
##     SCALED_3_MLQS     0.327    0.084    3.896    0.000    0.327    0.583
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQS     0.043    0.118    0.366    0.714    0.043    0.044
##     SCALED_3_MLQS    -0.023    0.156   -0.147    0.883   -0.023   -0.023
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQS     0.494    0.087    5.655    0.000    0.494    0.518
##     SCALED_3_MLQS     0.638    0.124    5.142    0.000    0.638    0.663
## 
## R-Square:
##                    Estimate
##     SCALED_2_MLQS     0.482
##     SCALED_3_MLQS     0.337
## [[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.17 -0.21 0.84  -0.38, 0.3
## 3              MLQ - S  0.68 0.08  8.01 0.00  0.51, 0.84
## 4 Interaction w/ Group  0.15 0.11  1.36 0.17 -0.06, 0.36
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.02 0.16 -0.15 0.88 -0.33, 0.28
## 2               GROUP1  0.12 0.22  0.56 0.58 -0.31, 0.56
## 3              MLQ - S  0.56 0.12  4.76 0.00  0.33, 0.79
## 4 Interaction w/ Group  0.16 0.15  1.03 0.30 -0.14, 0.46
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.82      -0.63    -0.77      -0.58
## 2      0     0.01       0.04    -0.06      -0.02
## 3      1     0.83       0.72     0.66       0.54
plots(modelname = modelMLQS_interaction, fitname = MLQ, data = adult2,  interactionterm = "MLQS_mean_1.GROUP1", new_scale_name = "Meaning in Life Questionnaire - S", time2 = "T1-T2", time3 = "T1-T3")                              
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  17 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               79.943
##   Degrees of freedom                                 7
##   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)               -410.746
##   Loglikelihood unrestricted model (H1)       -410.746
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 843.492
##   Bayesian (BIC)                               870.867
##   Sample-size adjusted Bayesian (BIC)          836.153
## 
## 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.036    0.173   -0.207    0.836   -0.036   -0.018
##     SCALED_1_MLQS     0.676    0.084    8.014    0.000    0.676    0.694
##     MLQS__1.GROUP1    0.148    0.108    1.365    0.172    0.148    0.121
##   SCALED_3_MLQS ~                                                       
##     GROUP1            0.148    0.198    0.750    0.453    0.148    0.076
##     SCALED_1_MLQS     0.111    0.134    0.827    0.409    0.111    0.114
##     MLQS__1.GROUP1    0.059    0.136    0.433    0.665    0.059    0.048
##     SCALED_2_MLQS     0.662    0.125    5.311    0.000    0.662    0.659
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQS     0.043    0.118    0.366    0.714    0.043    0.044
##     SCALED_3_MLQS    -0.052    0.140   -0.367    0.713   -0.052   -0.053
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_MLQS     0.494    0.087    5.655    0.000    0.494    0.518
##     SCALED_3_MLQS     0.421    0.089    4.722    0.000    0.421    0.437
## 
## R-Square:
##                    Estimate
##     SCALED_2_MLQS     0.482
##     SCALED_3_MLQS     0.563
## [[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.17 -0.21 0.84  -0.38, 0.3
## 3              MLQ - S  0.68 0.08  8.01 0.00  0.51, 0.84
## 4 Interaction w/ Group  0.15 0.11  1.36 0.17 -0.06, 0.36
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.05 0.14 -0.37 0.71 -0.33, 0.22
## 2               GROUP1  0.15 0.20  0.75 0.45 -0.24, 0.54
## 3              MLQ - S  0.11 0.13  0.83 0.41 -0.15, 0.37
## 4 Interaction w/ Group  0.06 0.14  0.43 0.67 -0.21, 0.33
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.82      -0.63    -0.26      -0.16
## 2      0     0.01       0.04    -0.09      -0.05
## 3      1     0.83       0.72     0.08       0.06
plots(modelname = modelMLQS_interaction_T3, fitname = MLQ, data = adult2,  interactionterm = "MLQS_mean_1.GROUP1", new_scale_name = "Meaning in Life Questionnaire - S", time2 = "T1-T2", time3 = "T1-T2-T3")                                                                                
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
#################  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  20 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.013
##   Degrees of freedom                                 7
##   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)               -414.232
##   Loglikelihood unrestricted model (H1)       -414.232
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 850.463
##   Bayesian (BIC)                               877.838
##   Sample-size adjusted Bayesian (BIC)          843.124
## 
## 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.370    0.173    2.146    0.032    0.370
##     SCALED_1_Postv       0.638    0.086    7.398    0.000    0.638
##     Pstv__1.GROUP1      -0.159    0.095   -1.673    0.094   -0.159
##   SCALED_3_Positive ~                                             
##     GROUP1               0.565    0.223    2.530    0.011    0.565
##     SCALED_1_Postv       0.660    0.135    4.903    0.000    0.660
##     Pstv__1.GROUP1      -0.160    0.153   -1.044    0.296   -0.160
##   Std.all
##          
##     0.188
##     0.643
##    -0.146
##          
##     0.262
##     0.606
##    -0.133
## 
## Covariances:
##                        Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Positive ~~                                             
##     SCALED_3_Postv        0.324    0.099    3.283    0.001    0.324
##   Std.all
##          
##     0.612
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Postv   -0.262    0.116   -2.263    0.024   -0.262   -0.267
##     SCALED_3_Postv   -0.467    0.153   -3.048    0.002   -0.467   -0.433
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Postv    0.474    0.091    5.200    0.000    0.474    0.491
##     SCALED_3_Postv    0.593    0.125    4.751    0.000    0.593    0.511
## 
## R-Square:
##                    Estimate
##     SCALED_2_Postv    0.509
##     SCALED_3_Postv    0.489
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.26 0.12 -2.26 0.02 -0.49, -0.04
## 2               GROUP1  0.37 0.17  2.15 0.03   0.03, 0.71
## 3     Perma - Positive  0.64 0.09  7.40 0.00   0.47, 0.81
## 4 Interaction w/ Group -0.16 0.10 -1.67 0.09  -0.35, 0.03
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.47 0.15 -3.05 0.00 -0.77, -0.17
## 2               GROUP1  0.57 0.22  2.53 0.01      0.13, 1
## 3     Perma - Positive  0.66 0.13  4.90 0.00    0.4, 0.92
## 4 Interaction w/ Group -0.16 0.15 -1.04 0.30  -0.46, 0.14
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.37      -0.90     -0.6      -1.13
## 2      0     0.11      -0.26     -0.1      -0.47
## 3      1     0.59       0.38      0.4       0.19
plots(modelname = modelPositive_interaction, fitname = fit, data = adult2,  interactionterm = "Positive_mean_1.GROUP1", new_scale_name = "Perma Positive Emotion", time2 = "T1-T2", time3 = "T1-T3") 
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  20 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.013
##   Degrees of freedom                                 7
##   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)               -414.232
##   Loglikelihood unrestricted model (H1)       -414.232
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 850.463
##   Bayesian (BIC)                               877.838
##   Sample-size adjusted Bayesian (BIC)          843.124
## 
## 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.370    0.173    2.146    0.032    0.370
##     SCALED_1_Postv       0.638    0.086    7.398    0.000    0.638
##     Pstv__1.GROUP1      -0.159    0.095   -1.673    0.094   -0.159
##   SCALED_3_Positive ~                                             
##     GROUP1               0.312    0.213    1.463    0.144    0.312
##     SCALED_1_Postv       0.223    0.142    1.571    0.116    0.223
##     Pstv__1.GROUP1      -0.051    0.151   -0.336    0.737   -0.051
##     SCALED_2_Postv       0.684    0.150    4.568    0.000    0.684
##   Std.all
##          
##     0.188
##     0.643
##    -0.145
##          
##     0.145
##     0.204
##    -0.042
##     0.623
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Postv   -0.262    0.116   -2.263    0.024   -0.262   -0.267
##     SCALED_3_Postv   -0.288    0.145   -1.981    0.048   -0.288   -0.267
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Postv    0.474    0.091    5.200    0.000    0.474    0.491
##     SCALED_3_Postv    0.371    0.092    4.022    0.000    0.371    0.320
## 
## R-Square:
##                    Estimate
##     SCALED_2_Postv    0.509
##     SCALED_3_Postv    0.680
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.26 0.12 -2.26 0.02 -0.49, -0.04
## 2               GROUP1  0.37 0.17  2.15 0.03   0.03, 0.71
## 3     Perma - Positive  0.64 0.09  7.40 0.00   0.47, 0.81
## 4 Interaction w/ Group -0.16 0.10 -1.67 0.09  -0.35, 0.03
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.29 0.15 -1.98 0.05    -0.57, 0
## 2               GROUP1  0.31 0.21  1.46 0.14 -0.11, 0.73
## 3     Perma - Positive  0.22 0.14  1.57 0.12  -0.06, 0.5
## 4 Interaction w/ Group -0.05 0.15 -0.34 0.74 -0.35, 0.25
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.37      -0.90    -0.09      -0.51
## 2      0     0.11      -0.26     0.08      -0.29
## 3      1     0.59       0.38     0.25      -0.06
plots(modelname = modelPositive_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Positive_mean_1.GROUP1", new_scale_name = "Perma Positive Emotion", time2 = "T1-T2", time3 = "T1-T2-T3")                                                                                        
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
############### 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  19 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.667
##   Degrees of freedom                                 7
##   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)               -422.718
##   Loglikelihood unrestricted model (H1)       -422.718
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 867.436
##   Bayesian (BIC)                               894.811
##   Sample-size adjusted Bayesian (BIC)          860.097
## 
## 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.390    0.189    2.066    0.039    0.390
##     SCALED_1_Achvm          0.622    0.100    6.216    0.000    0.622
##     Achv__1.GROUP1         -0.292    0.115   -2.543    0.011   -0.292
##   SCALED_3_Acheivement ~                                             
##     GROUP1                  0.779    0.232    3.350    0.001    0.779
##     SCALED_1_Achvm          0.692    0.135    5.140    0.000    0.692
##     Achv__1.GROUP1         -0.469    0.154   -3.052    0.002   -0.469
##   Std.all
##          
##     0.196
##     0.618
##    -0.255
##          
##     0.347
##     0.610
##    -0.364
## 
## Covariances:
##                           Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Acheivement ~~                                             
##     SCALED_3_Achvm           0.285    0.101    2.823    0.005    0.285
##   Std.all
##          
##     0.482
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Achvm   -0.287    0.129   -2.222    0.026   -0.287   -0.289
##     SCALED_3_Achvm   -0.598    0.170   -3.523    0.000   -0.598   -0.533
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Achvm    0.577    0.103    5.613    0.000    0.577    0.583
##     SCALED_3_Achvm    0.603    0.126    4.795    0.000    0.603    0.479
## 
## R-Square:
##                    Estimate
##     SCALED_2_Achvm    0.417
##     SCALED_3_Achvm    0.521
## Warning in lavaan(slotOptions = object@Options, slotParTable =
## object@ParTable, : lavaan WARNING: model has NOT converged!

## Warning in lavaan(slotOptions = object@Options, slotParTable =
## object@ParTable, : lavaan WARNING: model has NOT converged!
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.29 0.13 -2.22 0.03 -0.54, -0.03
## 2               GROUP1  0.39 0.19  2.07 0.04   0.02, 0.76
## 3  Perma - Acheivement  0.62 0.10  6.22 0.00   0.43, 0.82
## 4 Interaction w/ Group -0.29 0.11 -2.54 0.01 -0.52, -0.07
## 
## [[1]][[2]]
##                   Item     β   SE     z p       90% CI
## 1            Intercept -0.60 0.17 -3.52 0 -0.93, -0.27
## 2               GROUP1  0.78 0.23  3.35 0   0.32, 1.23
## 3  Perma - Acheivement  0.69 0.13  5.14 0   0.43, 0.96
## 4 Interaction w/ Group -0.47 0.15 -3.05 0 -0.77, -0.17
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.23      -0.91    -0.43      -1.29
## 2      0     0.10      -0.29    -0.21      -0.60
## 3      1     0.43       0.33     0.02       0.09
plots(modelname = modelAcheivement_interaction, fitname = fit, data = adult2,  interactionterm = "Acheivement_mean_1.GROUP1", new_scale_name = "Perma Acheivement", time2 = "T1-T2", time3 = "T1-T3") 
## Warning in lavaan(slotOptions = object@Options, slotParTable =
## object@ParTable, : lavaan WARNING: model has NOT converged!
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  17 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.667
##   Degrees of freedom                                 7
##   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)               -422.718
##   Loglikelihood unrestricted model (H1)       -422.718
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 867.436
##   Bayesian (BIC)                               894.811
##   Sample-size adjusted Bayesian (BIC)          860.097
## 
## 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.390    0.189    2.066    0.039    0.390
##     SCALED_1_Achvm          0.622    0.100    6.216    0.000    0.622
##     Achv__1.GROUP1         -0.292    0.115   -2.543    0.011   -0.292
##   SCALED_3_Acheivement ~                                             
##     GROUP1                  0.586    0.223    2.630    0.009    0.586
##     SCALED_1_Achvm          0.386    0.159    2.433    0.015    0.386
##     Achv__1.GROUP1         -0.325    0.162   -2.008    0.045   -0.325
##     SCALED_2_Achvm          0.493    0.147    3.355    0.001    0.493
##   Std.all
##          
##     0.196
##     0.618
##    -0.255
##          
##     0.261
##     0.340
##    -0.252
##     0.437
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Achvm   -0.287    0.129   -2.222    0.026   -0.287   -0.289
##     SCALED_3_Achvm   -0.457    0.168   -2.718    0.007   -0.457   -0.407
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Achvm    0.577    0.103    5.613    0.000    0.577    0.583
##     SCALED_3_Achvm    0.463    0.102    4.560    0.000    0.463    0.367
## 
## R-Square:
##                    Estimate
##     SCALED_2_Achvm    0.417
##     SCALED_3_Achvm    0.633
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.29 0.13 -2.22 0.03 -0.54, -0.03
## 2               GROUP1  0.39 0.19  2.07 0.04   0.02, 0.76
## 3  Perma - Acheivement  0.62 0.10  6.22 0.00   0.43, 0.82
## 4 Interaction w/ Group -0.29 0.11 -2.54 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.79, -0.13
## 2               GROUP1  0.59 0.22  2.63 0.01   0.15, 1.02
## 3  Perma - Acheivement  0.39 0.16  2.43 0.01    0.07, 0.7
## 4 Interaction w/ Group -0.33 0.16 -2.01 0.04 -0.64, -0.01
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.23      -0.91    -0.13      -0.84
## 2      0     0.10      -0.29    -0.07      -0.46
## 3      1     0.43       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", time2 = "T1-T2", time3 = "T1-T2-T3")                                                                               
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
################  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  17 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.989
##   Degrees of freedom                                 7
##   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)               -420.562
##   Loglikelihood unrestricted model (H1)       -420.562
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 863.124
##   Bayesian (BIC)                               890.499
##   Sample-size adjusted Bayesian (BIC)          855.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
##   SCALED_2_Nagative ~                                             
##     GROUP1              -0.289    0.190   -1.525    0.127   -0.289
##     SCALED_1_Nagtv       0.635    0.100    6.358    0.000    0.635
##     Ngtv__1.GROUP1       0.033    0.108    0.307    0.759    0.033
##   SCALED_3_Nagative ~                                             
##     GROUP1              -0.328    0.193   -1.702    0.089   -0.328
##     SCALED_1_Nagtv       0.657    0.097    6.803    0.000    0.657
##     Ngtv__1.GROUP1      -0.131    0.105   -1.255    0.210   -0.131
##   Std.all
##          
##    -0.143
##     0.623
##     0.030
##          
##    -0.168
##     0.666
##    -0.123
## 
## Covariances:
##                        Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Nagative ~~                                             
##     SCALED_3_Nagtv        0.276    0.088    3.154    0.002    0.276
##   Std.all
##          
##     0.532
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Nagtv    0.203    0.128    1.587    0.113    0.203    0.201
##     SCALED_3_Nagtv    0.184    0.132    1.396    0.163    0.184    0.188
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Nagtv    0.583    0.103    5.643    0.000    0.583    0.571
##     SCALED_3_Nagtv    0.463    0.098    4.724    0.000    0.463    0.485
## 
## R-Square:
##                    Estimate
##     SCALED_2_Nagtv    0.429
##     SCALED_3_Nagtv    0.515
## [[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.29 0.19 -1.52 0.13 -0.66, 0.08
## 3             Nagative  0.63 0.10  6.36 0.00  0.44, 0.83
## 4 Interaction w/ Group  0.03 0.11  0.31 0.76 -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.33 0.19 -1.70 0.09 -0.71, 0.05
## 3             Nagative  0.66 0.10  6.80 0.00  0.47, 0.85
## 4 Interaction w/ Group -0.13 0.10 -1.25 0.21 -0.34, 0.07
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.75      -0.43    -0.63      -0.47
## 2      0    -0.09       0.20    -0.10       0.18
## 3      1     0.58       0.84     0.42       0.84
plots(modelname = modelNegative_interaction, fitname = fit, data = adult2,  interactionterm = "Negative_mean_1.GROUP1", new_scale_name = "Perma Negative", time2 = "T1-T2", time3 = "T1-T3") 
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  19 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.989
##   Degrees of freedom                                 7
##   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)               -420.562
##   Loglikelihood unrestricted model (H1)       -420.562
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 863.124
##   Bayesian (BIC)                               890.499
##   Sample-size adjusted Bayesian (BIC)          855.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
##   SCALED_2_Nagative ~                                             
##     GROUP1              -0.289    0.190   -1.525    0.127   -0.289
##     SCALED_1_Nagtv       0.635    0.100    6.358    0.000    0.635
##     Ngtv__1.GROUP1       0.033    0.108    0.307    0.759    0.033
##   SCALED_3_Nagative ~                                             
##     GROUP1              -0.191    0.178   -1.072    0.284   -0.191
##     SCALED_1_Nagtv       0.356    0.120    2.977    0.003    0.356
##     Ngtv__1.GROUP1      -0.147    0.097   -1.518    0.129   -0.147
##     SCALED_2_Nagtv       0.474    0.124    3.817    0.000    0.474
##   Std.all
##          
##    -0.143
##     0.623
##     0.030
##          
##    -0.098
##     0.361
##    -0.138
##     0.490
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Nagtv    0.203    0.128    1.587    0.113    0.203    0.201
##     SCALED_3_Nagtv    0.088    0.123    0.711    0.477    0.088    0.090
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Nagtv    0.583    0.103    5.643    0.000    0.583    0.571
##     SCALED_3_Nagtv    0.332    0.072    4.596    0.000    0.332    0.347
## 
## R-Square:
##                    Estimate
##     SCALED_2_Nagtv    0.429
##     SCALED_3_Nagtv    0.653
## [[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.29 0.19 -1.52 0.13 -0.66, 0.08
## 3             Nagative  0.63 0.10  6.36 0.00  0.44, 0.83
## 4 Interaction w/ Group  0.03 0.11  0.31 0.76 -0.18, 0.24
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.09 0.12  0.71 0.48 -0.15, 0.33
## 2               GROUP1 -0.19 0.18 -1.07 0.28 -0.54, 0.16
## 3             Nagative  0.36 0.12  2.98 0.00  0.12, 0.59
## 4 Interaction w/ Group -0.15 0.10 -1.52 0.13 -0.34, 0.04
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.75      -0.43    -0.41      -0.27
## 2      0    -0.09       0.20    -0.20       0.09
## 3      1     0.58       0.84     0.01       0.44
plots(modelname = modelNegative_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Negative_mean_1.GROUP1", new_scale_name = "Perma Negative", time2 = "T1-T2", time3 = "T1-T2-T3")
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
############### 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  23 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               67.342
##   Degrees of freedom                                 7
##   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)               -434.963
##   Loglikelihood unrestricted model (H1)       -434.963
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 891.927
##   Bayesian (BIC)                               919.302
##   Sample-size adjusted Bayesian (BIC)          884.588
## 
## 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.271    0.195    1.386    0.166    0.271
##     SCALED_1_Rrltn             0.579    0.100    5.764    0.000    0.579
##     Rltn__1.GROUP1             0.053    0.101    0.527    0.598    0.053
##   SCALED_3_Rrealtionships ~                                             
##     GROUP1                     0.515    0.251    2.048    0.041    0.515
##     SCALED_1_Rrltn             0.430    0.141    3.055    0.002    0.430
##     Rltn__1.GROUP1            -0.081    0.140   -0.576    0.565   -0.081
##   Std.all
##          
##     0.135
##     0.574
##     0.052
##          
##     0.240
##     0.398
##    -0.075
## 
## Covariances:
##                              Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Rrealtionships ~~                                             
##     SCALED_3_Rrltn              0.551    0.124    4.453    0.000    0.551
##   Std.all
##          
##     0.741
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Rrltn   -0.196    0.132   -1.485    0.138   -0.196   -0.195
##     SCALED_3_Rrltn   -0.323    0.173   -1.863    0.062   -0.323   -0.301
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Rrltn    0.635    0.112    5.689    0.000    0.635    0.632
##     SCALED_3_Rrltn    0.869    0.180    4.830    0.000    0.869    0.755
## 
## R-Square:
##                    Estimate
##     SCALED_2_Rrltn    0.368
##     SCALED_3_Rrltn    0.245
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.20 0.13 -1.48 0.14 -0.45, 0.06
## 2               GROUP1  0.27 0.20  1.39 0.17 -0.11, 0.65
## 3       Rrealtionships  0.58 0.10  5.76 0.00  0.38, 0.78
## 4 Interaction w/ Group  0.05 0.10  0.53 0.60 -0.14, 0.25
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.32 0.17 -1.86 0.06 -0.66, 0.02
## 2               GROUP1  0.51 0.25  2.05 0.04  0.02, 1.01
## 3       Rrealtionships  0.43 0.14  3.05 0.00  0.15, 0.71
## 4 Interaction w/ Group -0.08 0.14 -0.58 0.56 -0.36, 0.19
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.56      -0.77    -0.40      -0.75
## 2      0     0.07      -0.20    -0.05      -0.32
## 3      1     0.71       0.38     0.30       0.11
plots(modelname = modelRelationships_interaction, fitname = fit, data = adult2,  interactionterm = "Relationships_mean_1.GROUP1", new_scale_name = "Perma Relationships", time2 = "T1-T2", time3 = "T1-T3") 
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  18 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               67.342
##   Degrees of freedom                                 7
##   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)               -434.963
##   Loglikelihood unrestricted model (H1)       -434.963
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 891.927
##   Bayesian (BIC)                               919.302
##   Sample-size adjusted Bayesian (BIC)          884.588
## 
## 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.271    0.195    1.386    0.166    0.271
##     SCALED_1_Rrltn             0.579    0.100    5.764    0.000    0.579
##     Rltn__1.GROUP1             0.053    0.101    0.527    0.598    0.053
##   SCALED_3_Rrealtionships ~                                             
##     GROUP1                     0.280    0.195    1.434    0.152    0.280
##     SCALED_1_Rrltn            -0.071    0.146   -0.488    0.625   -0.071
##     Rltn__1.GROUP1            -0.127    0.118   -1.074    0.283   -0.127
##     SCALED_2_Rrltn             0.867    0.131    6.617    0.000    0.867
##   Std.all
##          
##     0.135
##     0.574
##     0.052
##          
##     0.130
##    -0.066
##    -0.117
##     0.810
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Rrltn   -0.196    0.132   -1.485    0.138   -0.196   -0.195
##     SCALED_3_Rrltn   -0.153    0.137   -1.115    0.265   -0.153   -0.143
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Rrltn    0.635    0.112    5.689    0.000    0.635    0.632
##     SCALED_3_Rrltn    0.392    0.086    4.533    0.000    0.392    0.340
## 
## R-Square:
##                    Estimate
##     SCALED_2_Rrltn    0.368
##     SCALED_3_Rrltn    0.660
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.20 0.13 -1.48 0.14 -0.45, 0.06
## 2               GROUP1  0.27 0.20  1.39 0.17 -0.11, 0.65
## 3       Rrealtionships  0.58 0.10  5.76 0.00  0.38, 0.78
## 4 Interaction w/ Group  0.05 0.10  0.53 0.60 -0.14, 0.25
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.15 0.14 -1.11 0.26 -0.42, 0.12
## 2               GROUP1  0.28 0.20  1.43 0.15  -0.1, 0.66
## 3       Rrealtionships -0.07 0.15 -0.49 0.63 -0.36, 0.22
## 4 Interaction w/ Group -0.13 0.12 -1.07 0.28  -0.36, 0.1
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.56      -0.77     0.32      -0.08
## 2      0     0.07      -0.20     0.12      -0.15
## 3      1     0.71       0.38    -0.08      -0.22
plots(modelname = modelRelationships_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Relationships_mean_1.GROUP1", new_scale_name = "Perma Relationships", time2 = "T1-T2", time3 = "T1-T2-T3") 
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
#################  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  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              108.504
##   Degrees of freedom                                 7
##   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)               -333.567
##   Loglikelihood unrestricted model (H1)       -333.567
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 689.134
##   Bayesian (BIC)                               716.509
##   Sample-size adjusted Bayesian (BIC)          681.795
## 
## 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.311    0.148    2.103    0.035    0.311    0.156
##     SCALED_1_LET      0.819    0.075   10.903    0.000    0.819    0.815
##     LfEn__1.GROUP1   -0.011    0.187   -0.061    0.951   -0.011   -0.005
##   SCALED_3_LET ~                                                        
##     GROUP1            0.608    0.230    2.644    0.008    0.608    0.289
##     SCALED_1_LET      0.666    0.121    5.509    0.000    0.666    0.625
##     LfEn__1.GROUP1   -0.031    0.302   -0.104    0.917   -0.031   -0.012
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_LET ~~                                                       
##     SCALED_3_LET      0.289    0.089    3.256    0.001    0.289    0.616
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LET     -0.240    0.101   -2.385    0.017   -0.240   -0.242
##     SCALED_3_LET     -0.430    0.166   -2.592    0.010   -0.430   -0.409
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LET      0.344    0.062    5.532    0.000    0.344    0.349
##     SCALED_3_LET      0.640    0.146    4.386    0.000    0.640    0.579
## 
## R-Square:
##                    Estimate
##     SCALED_2_LET      0.651
##     SCALED_3_LET      0.421
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.24 0.10 -2.38 0.02 -0.44, -0.04
## 2               GROUP1  0.31 0.15  2.10 0.04    0.02, 0.6
## 3                  LET  0.82 0.08 10.90 0.00   0.67, 0.97
## 4 Interaction w/ Group -0.01 0.19 -0.06 0.95  -0.38, 0.36
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.43 0.17 -2.59 0.01 -0.76, -0.1
## 2               GROUP1  0.61 0.23  2.64 0.01  0.16, 1.06
## 3                  LET  0.67 0.12  5.51 0.00   0.43, 0.9
## 4 Interaction w/ Group -0.03 0.30 -0.10 0.92 -0.62, 0.56
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.74      -1.06    -0.75      -1.10
## 2      0     0.07      -0.24    -0.12      -0.43
## 3      1     0.88       0.58     0.52       0.24
plots(modelname = modelLET_interaction, fitname = fit, data = adult2,  interactionterm = "LifeEngagement_mean_1.GROUP1", new_scale_name = "Life Engagement Scale", time2 = "T1-T2", time3 = "T1-T3") 
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  25 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              108.504
##   Degrees of freedom                                 7
##   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)               -333.567
##   Loglikelihood unrestricted model (H1)       -333.567
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 689.134
##   Bayesian (BIC)                               716.509
##   Sample-size adjusted Bayesian (BIC)          681.795
## 
## 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.311    0.148    2.103    0.035    0.311    0.156
##     SCALED_1_LET      0.819    0.075   10.903    0.000    0.819    0.815
##     LfEn__1.GROUP1   -0.011    0.187   -0.061    0.951   -0.011   -0.005
##   SCALED_3_LET ~                                                        
##     GROUP1            0.347    0.219    1.585    0.113    0.347    0.165
##     SCALED_1_LET     -0.023    0.204   -0.113    0.910   -0.023   -0.022
##     LfEn__1.GROUP1   -0.022    0.267   -0.081    0.935   -0.022   -0.008
##     SCALED_2_LET      0.841    0.206    4.077    0.000    0.841    0.794
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LET     -0.240    0.101   -2.385    0.017   -0.240   -0.242
##     SCALED_3_LET     -0.228    0.163   -1.400    0.162   -0.228   -0.217
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LET      0.344    0.062    5.532    0.000    0.344    0.349
##     SCALED_3_LET      0.397    0.090    4.431    0.000    0.397    0.359
## 
## R-Square:
##                    Estimate
##     SCALED_2_LET      0.651
##     SCALED_3_LET      0.641
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.24 0.10 -2.38 0.02 -0.44, -0.04
## 2               GROUP1  0.31 0.15  2.10 0.04    0.02, 0.6
## 3                  LET  0.82 0.08 10.90 0.00   0.67, 0.97
## 4 Interaction w/ Group -0.01 0.19 -0.06 0.95  -0.38, 0.36
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.23 0.16 -1.40 0.16 -0.55, 0.09
## 2               GROUP1  0.35 0.22  1.58 0.11 -0.08, 0.78
## 3                  LET -0.02 0.20 -0.11 0.91 -0.42, 0.38
## 4 Interaction w/ Group -0.02 0.27 -0.08 0.94  -0.55, 0.5
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.74      -1.06     0.13      -0.21
## 2      0     0.07      -0.24     0.08      -0.23
## 3      1     0.88       0.58     0.04      -0.25
plots(modelname = modelLET_interaction_T3, fitname = fit, data = adult2,  interactionterm = "LifeEngagement_mean_1.GROUP1", new_scale_name = "Life Engagement Scale", time2 = "T1-T2", time3 = "T1-T2-T3")                                                              
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
################### 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  20 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.111
##   Degrees of freedom                                 7
##   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)               -379.126
##   Loglikelihood unrestricted model (H1)       -379.126
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 780.251
##   Bayesian (BIC)                               807.626
##   Sample-size adjusted Bayesian (BIC)          772.912
## 
## 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.616    0.149    4.146    0.000    0.616    0.324
##     SCALED_1_LS       0.600    0.073    8.196    0.000    0.600    0.626
##     LfSt__1.GROUP1   -0.520    0.111   -4.689    0.000   -0.520   -0.364
##   SCALED_3_LS ~                                                         
##     GROUP1            0.581    0.216    2.690    0.007    0.581    0.278
##     SCALED_1_LS       0.578    0.112    5.181    0.000    0.578    0.548
##     LfSt__1.GROUP1   -0.504    0.167   -3.018    0.003   -0.504   -0.320
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_LS ~~                                                        
##     SCALED_3_LS       0.269    0.078    3.445    0.001    0.269    0.596
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LS      -0.298    0.099   -3.004    0.003   -0.298   -0.314
##     SCALED_3_LS      -0.373    0.148   -2.523    0.012   -0.373   -0.357
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LS       0.351    0.064    5.488    0.000    0.351    0.389
##     SCALED_3_LS       0.583    0.123    4.746    0.000    0.583    0.534
## 
## R-Square:
##                    Estimate
##     SCALED_2_LS       0.611
##     SCALED_3_LS       0.466
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z p      90% CI
## 1            Intercept -0.30 0.10 -3.00 0 -0.49, -0.1
## 2               GROUP1  0.62 0.15  4.15 0  0.32, 0.91
## 3    Life Satisfaction  0.60 0.07  8.20 0  0.46, 0.74
## 4 Interaction w/ Group -0.52 0.11 -4.69 0 -0.74, -0.3
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.37 0.15 -2.52 0.01 -0.66, -0.08
## 2               GROUP1  0.58 0.22  2.69 0.01      0.16, 1
## 3    Life Satisfaction  0.58 0.11  5.18 0.00    0.36, 0.8
## 4 Interaction w/ Group -0.50 0.17 -3.02 0.00 -0.83, -0.18
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1     0.24       -0.9     0.17      -0.95
## 2      0     0.32       -0.3     0.24      -0.37
## 3      1     0.40        0.3     0.32       0.20
plots(modelname = modelLS_interaction, fitname = fit, data = adult2,  interactionterm = "LifeSatisfaction_mean_1.GROUP1", new_scale_name = "Life Satisfaction Scale", time2 = "T1-T2", time3 = "T1-T3")  
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  21 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.111
##   Degrees of freedom                                 7
##   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)               -379.126
##   Loglikelihood unrestricted model (H1)       -379.126
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 780.251
##   Bayesian (BIC)                               807.626
##   Sample-size adjusted Bayesian (BIC)          772.912
## 
## 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.616    0.149    4.146    0.000    0.616    0.324
##     SCALED_1_LS       0.600    0.073    8.196    0.000    0.600    0.626
##     LfSt__1.GROUP1   -0.520    0.111   -4.689    0.000   -0.520   -0.364
##   SCALED_3_LS ~                                                         
##     GROUP1            0.108    0.211    0.511    0.610    0.108    0.052
##     SCALED_1_LS       0.117    0.141    0.828    0.408    0.117    0.111
##     LfSt__1.GROUP1   -0.105    0.176   -0.593    0.553   -0.105   -0.066
##     SCALED_2_LS       0.768    0.171    4.480    0.000    0.768    0.698
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LS      -0.298    0.099   -3.004    0.003   -0.298   -0.314
##     SCALED_3_LS      -0.144    0.141   -1.024    0.306   -0.144   -0.138
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_LS       0.351    0.064    5.488    0.000    0.351    0.389
##     SCALED_3_LS       0.376    0.085    4.399    0.000    0.376    0.344
## 
## R-Square:
##                    Estimate
##     SCALED_2_LS       0.611
##     SCALED_3_LS       0.656
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z p      90% CI
## 1            Intercept -0.30 0.10 -3.00 0 -0.49, -0.1
## 2               GROUP1  0.62 0.15  4.15 0  0.32, 0.91
## 3    Life Satisfaction  0.60 0.07  8.20 0  0.46, 0.74
## 4 Interaction w/ Group -0.52 0.11 -4.69 0 -0.74, -0.3
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.14 0.14 -1.02 0.31 -0.42, 0.13
## 2               GROUP1  0.11 0.21  0.51 0.61 -0.31, 0.52
## 3    Life Satisfaction  0.12 0.14  0.83 0.41 -0.16, 0.39
## 4 Interaction w/ Group -0.10 0.18 -0.59 0.55 -0.45, 0.24
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1     0.24       -0.9     0.46      -0.26
## 2      0     0.32       -0.3     0.47      -0.14
## 3      1     0.40        0.3     0.48      -0.03
plots(modelname = modelLS_interaction_T3, fitname = fit, data = adult2,  interactionterm = "LifeSatisfaction_mean_1.GROUP1", new_scale_name = "Life Satisfaction Scale", time2 = "T1-T2", time3 = "T1-T2-T3")                                                                
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
############### 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  22 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               35.618
##   Degrees of freedom                                 7
##   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)               -443.353
##   Loglikelihood unrestricted model (H1)       -443.353
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 908.705
##   Bayesian (BIC)                               936.080
##   Sample-size adjusted Bayesian (BIC)          901.366
## 
## 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.213    0.213    0.999    0.318    0.213
##     SCALED_1_Enggm         0.519    0.111    4.665    0.000    0.519
##     Engg__1.GROUP1        -0.114    0.121   -0.944    0.345   -0.114
##   SCALED_3_Engagement ~                                             
##     GROUP1                 0.533    0.285    1.868    0.062    0.533
##     SCALED_1_Enggm         0.394    0.195    2.026    0.043    0.394
##     Engg__1.GROUP1        -0.204    0.210   -0.970    0.332   -0.204
##   Std.all
##          
##     0.107
##     0.516
##    -0.104
##          
##     0.248
##     0.363
##    -0.173
## 
## Covariances:
##                          Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Engagement ~~                                             
##     SCALED_3_Enggm          0.412    0.152    2.717    0.007    0.412
##   Std.all
##          
##     0.505
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Enggm   -0.168    0.146   -1.152    0.249   -0.168   -0.169
##     SCALED_3_Enggm   -0.368    0.206   -1.784    0.074   -0.368   -0.342
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Enggm    0.719    0.132    5.451    0.000    0.719    0.721
##     SCALED_3_Enggm    0.925    0.197    4.699    0.000    0.925    0.799
## 
## R-Square:
##                    Estimate
##     SCALED_2_Enggm    0.279
##     SCALED_3_Enggm    0.201
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.17 0.15 -1.15 0.25 -0.45, 0.12
## 2               GROUP1  0.21 0.21  1.00 0.32 -0.21, 0.63
## 3           Engagement  0.52 0.11  4.66 0.00   0.3, 0.74
## 4 Interaction w/ Group -0.11 0.12 -0.94 0.34 -0.35, 0.12
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.37 0.21 -1.78 0.07 -0.77, 0.04
## 2               GROUP1  0.53 0.29  1.87 0.06 -0.03, 1.09
## 3           Engagement  0.39 0.19  2.03 0.04  0.01, 0.78
## 4 Interaction w/ Group -0.20 0.21 -0.97 0.33 -0.61, 0.21
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.36      -0.69    -0.35      -0.76
## 2      0     0.04      -0.17    -0.15      -0.37
## 3      1     0.45       0.35     0.04       0.03
plots(modelname = modelEngagement_interaction, fitname = fit, data = adult2,  interactionterm = "Engagement_mean_1.GROUP1", new_scale_name = "Perma Engagament", time2 = "T1-T2", time3 = "T1-T3")  
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  22 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               35.618
##   Degrees of freedom                                 7
##   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)               -443.353
##   Loglikelihood unrestricted model (H1)       -443.353
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 908.705
##   Bayesian (BIC)                               936.080
##   Sample-size adjusted Bayesian (BIC)          901.366
## 
## 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.213    0.213    0.999    0.318    0.213
##     SCALED_1_Enggm         0.519    0.111    4.665    0.000    0.519
##     Engg__1.GROUP1        -0.114    0.121   -0.944    0.345   -0.114
##   SCALED_3_Engagement ~                                             
##     GROUP1                 0.411    0.263    1.561    0.118    0.411
##     SCALED_1_Enggm         0.096    0.201    0.479    0.632    0.096
##     Engg__1.GROUP1        -0.138    0.207   -0.666    0.505   -0.138
##     SCALED_2_Enggm         0.573    0.174    3.295    0.001    0.573
##   Std.all
##          
##     0.107
##     0.516
##    -0.104
##          
##     0.191
##     0.089
##    -0.117
##     0.532
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Enggm   -0.168    0.146   -1.152    0.249   -0.168   -0.169
##     SCALED_3_Enggm   -0.271    0.194   -1.397    0.162   -0.271   -0.252
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Enggm    0.719    0.132    5.451    0.000    0.719    0.721
##     SCALED_3_Enggm    0.689    0.158    4.347    0.000    0.689    0.595
## 
## R-Square:
##                    Estimate
##     SCALED_2_Enggm    0.279
##     SCALED_3_Enggm    0.405
## Warning in lavaan(slotOptions = object@Options, slotParTable =
## object@ParTable, : lavaan WARNING: model has NOT converged!

## Warning in lavaan(slotOptions = object@Options, slotParTable =
## object@ParTable, : lavaan WARNING: model has NOT converged!
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.17 0.15 -1.15 0.25 -0.45, 0.12
## 2               GROUP1  0.21 0.21  1.00 0.32 -0.21, 0.63
## 3           Engagement  0.52 0.11  4.67 0.00   0.3, 0.74
## 4 Interaction w/ Group -0.11 0.12 -0.94 0.34 -0.35, 0.12
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.27 0.19 -1.40 0.16 -0.65, 0.11
## 2               GROUP1  0.41 0.26  1.56 0.12  -0.1, 0.93
## 3           Engagement  0.10 0.20  0.48 0.63  -0.3, 0.49
## 4 Interaction w/ Group -0.14 0.21 -0.67 0.51 -0.54, 0.27
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.36      -0.69    -0.02      -0.37
## 2      0     0.04      -0.17    -0.06      -0.27
## 3      1     0.45       0.35    -0.10      -0.18
plots(modelname = modelEngagement_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Engagement_mean_1.GROUP1", new_scale_name = "Perma Engagament", time2 = "T1-T2", time3 = "T1-T2-T3")                                                                                                 
## Warning in lavaan(slotOptions = object@Options, slotParTable =
## object@ParTable, : lavaan WARNING: model has NOT converged!
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
############### 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  21 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.594
##   Degrees of freedom                                 7
##   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)               -364.308
##   Loglikelihood unrestricted model (H1)       -364.308
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 750.615
##   Bayesian (BIC)                               777.990
##   Sample-size adjusted Bayesian (BIC)          743.276
## 
## 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.273    0.228   -1.200    0.230   -0.273
##     SCALED_1_Optms       0.358    0.112    3.201    0.001    0.358
##     Optm__1.GROUP1      -0.332    0.302   -1.100    0.271   -0.332
##   SCALED_3_Optimism ~                                             
##     GROUP1              -0.625    0.231   -2.705    0.007   -0.625
##     SCALED_1_Optms       0.440    0.119    3.688    0.000    0.440
##     Optm__1.GROUP1      -0.699    0.317   -2.203    0.028   -0.699
##   Std.all
##          
##    -0.138
##     0.358
##    -0.124
##          
##    -0.313
##     0.437
##    -0.261
## 
## Covariances:
##                        Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_Optimism ~~                                             
##     SCALED_3_Optms        0.248    0.116    2.134    0.033    0.248
##   Std.all
##          
##     0.351
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Optms    0.192    0.154    1.248    0.212    0.192    0.193
##     SCALED_3_Optms    0.401    0.161    2.488    0.013    0.401    0.402
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Optms    0.816    0.144    5.665    0.000    0.816    0.826
##     SCALED_3_Optms    0.613    0.126    4.847    0.000    0.613    0.615
## 
## R-Square:
##                    Estimate
##     SCALED_2_Optms    0.174
##     SCALED_3_Optms    0.385
## [[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.27 0.23 -1.20 0.23 -0.72, 0.17
## 3       Optimism Scale  0.36 0.11  3.20 0.00  0.14, 0.58
## 4 Interaction w/ Group -0.33 0.30 -1.10 0.27 -0.92, 0.26
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept  0.40 0.16  2.49 0.01   0.09, 0.72
## 2               GROUP1 -0.62 0.23 -2.71 0.01 -1.08, -0.17
## 3       Optimism Scale  0.44 0.12  3.69 0.00   0.21, 0.67
## 4 Interaction w/ Group -0.70 0.32 -2.20 0.03 -1.32, -0.08
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.11      -0.17     0.39      -0.04
## 2      0    -0.08       0.19     0.13       0.40
## 3      1    -0.06       0.55    -0.13       0.84
plots(modelname = modelOPTIMISM_interaction, fitname = fit, data = adult2,  interactionterm = "Optimism_mean_1.GROUP1", new_scale_name = "Optimism Scale", time2 = "T1-T2", time3 = "T1-T3")  
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  23 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.594
##   Degrees of freedom                                 7
##   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)               -364.308
##   Loglikelihood unrestricted model (H1)       -364.308
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 750.615
##   Bayesian (BIC)                               777.990
##   Sample-size adjusted Bayesian (BIC)          743.276
## 
## 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.273    0.228   -1.200    0.230   -0.273
##     SCALED_1_Optms       0.358    0.112    3.201    0.001    0.358
##     Optm__1.GROUP1      -0.332    0.302   -1.100    0.271   -0.332
##   SCALED_3_Optimism ~                                             
##     GROUP1              -0.542    0.228   -2.379    0.017   -0.542
##     SCALED_1_Optms       0.331    0.129    2.573    0.010    0.331
##     Optm__1.GROUP1      -0.598    0.314   -1.903    0.057   -0.598
##     SCALED_2_Optms       0.304    0.129    2.352    0.019    0.304
##   Std.all
##          
##    -0.138
##     0.358
##    -0.124
##          
##    -0.271
##     0.329
##    -0.223
##     0.303
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Optms    0.192    0.154    1.248    0.212    0.192    0.193
##     SCALED_3_Optms    0.343    0.162    2.117    0.034    0.343    0.343
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Optms    0.816    0.144    5.665    0.000    0.816    0.826
##     SCALED_3_Optms    0.537    0.115    4.667    0.000    0.537    0.539
## 
## R-Square:
##                    Estimate
##     SCALED_2_Optms    0.174
##     SCALED_3_Optms    0.461
## [[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.27 0.23 -1.20 0.23 -0.72, 0.17
## 3       Optimism Scale  0.36 0.11  3.20 0.00  0.14, 0.58
## 4 Interaction w/ Group -0.33 0.30 -1.10 0.27 -0.92, 0.26
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.34 0.16  2.12 0.03  0.03, 0.66
## 2               GROUP1 -0.54 0.23 -2.38 0.02 -0.99, -0.1
## 3       Optimism Scale  0.33 0.13  2.57 0.01  0.08, 0.58
## 4 Interaction w/ Group -0.60 0.31 -1.90 0.06 -1.21, 0.02
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.11      -0.17     0.34       0.01
## 2      0    -0.08       0.19     0.07       0.34
## 3      1    -0.06       0.55    -0.20       0.67
plots(modelname = modelOPTIMISM_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Optimism_mean_1.GROUP1", new_scale_name = "Optimism Scale", time2 = "T1-T2", time3 = "T1-T2-T3")                                                                                         
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
#################  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  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               80.220
##   Degrees of freedom                                 7
##   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)               -364.655
##   Loglikelihood unrestricted model (H1)       -364.655
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 751.310
##   Bayesian (BIC)                               778.685
##   Sample-size adjusted Bayesian (BIC)          743.971
## 
## 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.461    0.181    2.551    0.011    0.461    0.225
##     SCALED_1_PWB      0.721    0.102    7.081    0.000    0.721    0.700
##     PPWB__1.GROUP1   -0.287    0.217   -1.327    0.184   -0.287   -0.134
##   SCALED_3_PWB ~                                                        
##     GROUP1            0.736    0.223    3.302    0.001    0.736    0.343
##     SCALED_1_PWB      0.657    0.133    4.954    0.000    0.657    0.610
##     PPWB__1.GROUP1   -0.526    0.279   -1.887    0.059   -0.526   -0.234
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_PWB ~~                                                       
##     SCALED_3_PWB      0.294    0.095    3.098    0.002    0.294    0.540
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PWB     -0.373    0.126   -2.954    0.003   -0.373   -0.364
##     SCALED_3_PWB     -0.573    0.162   -3.541    0.000   -0.573   -0.535
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PWB      0.505    0.091    5.550    0.000    0.505    0.481
##     SCALED_3_PWB      0.587    0.125    4.702    0.000    0.587    0.510
## 
## R-Square:
##                    Estimate
##     SCALED_2_PWB      0.519
##     SCALED_3_PWB      0.490
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.37 0.13 -2.95 0.00 -0.62, -0.13
## 2               GROUP1  0.46 0.18  2.55 0.01   0.11, 0.81
## 3                 RPWB  0.72 0.10  7.08 0.00   0.52, 0.92
## 4 Interaction w/ Group -0.29 0.22 -1.33 0.18  -0.71, 0.14
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.57 0.16 -3.54 0.00 -0.89, -0.26
## 2               GROUP1  0.74 0.22  3.30 0.00    0.3, 1.17
## 3                 RPWB  0.66 0.13  4.95 0.00    0.4, 0.92
## 4 Interaction w/ Group -0.53 0.28 -1.89 0.06  -1.07, 0.02
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.35      -1.09    -0.24      -1.23
## 2      0     0.09      -0.37    -0.11      -0.57
## 3      1     0.52       0.35     0.02       0.08
plots(modelname = modelPWB_interaction, fitname = fit, data = adult2,  interactionterm = "PurposePWB_mean_1.GROUP1", new_scale_name = "Ryff Purpose Subscale", time2 = "T1-T2", time3 = "T1-T3")  
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  22 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               80.220
##   Degrees of freedom                                 7
##   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)               -364.655
##   Loglikelihood unrestricted model (H1)       -364.655
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 751.310
##   Bayesian (BIC)                               778.685
##   Sample-size adjusted Bayesian (BIC)          743.971
## 
## 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.461    0.181    2.551    0.011    0.461    0.225
##     SCALED_1_PWB      0.721    0.102    7.081    0.000    0.721    0.700
##     PPWB__1.GROUP1   -0.287    0.217   -1.327    0.184   -0.287   -0.134
##   SCALED_3_PWB ~                                                        
##     GROUP1            0.468    0.213    2.202    0.028    0.468    0.218
##     SCALED_1_PWB      0.238    0.168    1.420    0.156    0.238    0.221
##     PPWB__1.GROUP1   -0.359    0.263   -1.362    0.173   -0.359   -0.159
##     SCALED_2_PWB      0.581    0.153    3.811    0.000    0.581    0.556
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PWB     -0.373    0.126   -2.954    0.003   -0.373   -0.364
##     SCALED_3_PWB     -0.356    0.159   -2.237    0.025   -0.356   -0.332
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PWB      0.505    0.091    5.550    0.000    0.505    0.481
##     SCALED_3_PWB      0.416    0.091    4.565    0.000    0.416    0.362
## 
## R-Square:
##                    Estimate
##     SCALED_2_PWB      0.519
##     SCALED_3_PWB      0.638
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.37 0.13 -2.95 0.00 -0.62, -0.13
## 2               GROUP1  0.46 0.18  2.55 0.01   0.11, 0.81
## 3                 RPWB  0.72 0.10  7.08 0.00   0.52, 0.92
## 4 Interaction w/ Group -0.29 0.22 -1.33 0.18  -0.71, 0.14
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.36 0.16 -2.24 0.03 -0.67, -0.04
## 2               GROUP1  0.47 0.21  2.20 0.03   0.05, 0.89
## 3                 RPWB  0.24 0.17  1.42 0.16  -0.09, 0.57
## 4 Interaction w/ Group -0.36 0.26 -1.36 0.17  -0.87, 0.16
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.35      -1.09     0.23      -0.59
## 2      0     0.09      -0.37     0.10      -0.36
## 3      1     0.52       0.35    -0.02      -0.12
plots(modelname = modelPWB_interaction_T3, fitname = fit, data = adult2,  interactionterm = "PurposePWB_mean_1.GROUP1", new_scale_name = "Ryff Purpose Subscale", time2 = "T1-T2", time3 = "T1-T2-T3")                                                                         
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
#################  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  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              109.932
##   Degrees of freedom                                 7
##   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)               -322.678
##   Loglikelihood unrestricted model (H1)       -322.678
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 667.356
##   Bayesian (BIC)                               694.731
##   Sample-size adjusted Bayesian (BIC)          660.016
## 
## 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.777    0.140    5.555    0.000    0.777    0.392
##     SCALED_1_APSI     0.816    0.072   11.380    0.000    0.816    0.815
##     PAPSI__1.GROUP   -0.721    0.197   -3.651    0.000   -0.721   -0.262
##   SCALED_3_APSI ~                                                       
##     GROUP1            0.673    0.233    2.891    0.004    0.673    0.321
##     SCALED_1_APSI     0.673    0.127    5.306    0.000    0.673    0.637
##     PAPSI__1.GROUP   -0.912    0.351   -2.601    0.009   -0.912   -0.314
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_APSI ~~                                                      
##     SCALED_3_APSI     0.213    0.079    2.707    0.007    0.213    0.496
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_APSI    -0.509    0.096   -5.275    0.000   -0.509   -0.513
##     SCALED_3_APSI    -0.544    0.174   -3.119    0.002   -0.544   -0.520
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_APSI     0.305    0.055    5.552    0.000    0.305    0.311
##     SCALED_3_APSI     0.603    0.130    4.635    0.000    0.603    0.551
## 
## R-Square:
##                    Estimate
##     SCALED_2_APSI     0.689
##     SCALED_3_APSI     0.449
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z p       90% CI
## 1            Intercept -0.51 0.10 -5.27 0  -0.7, -0.32
## 2               GROUP1  0.78 0.14  5.56 0    0.5, 1.05
## 3                 APSI  0.82 0.07 11.38 0   0.68, 0.96
## 4 Interaction w/ Group -0.72 0.20 -3.65 0 -1.11, -0.33
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.54 0.17 -3.12 0.00 -0.89, -0.2
## 2               GROUP1  0.67 0.23  2.89 0.00  0.22, 1.13
## 3                 APSI  0.67 0.13  5.31 0.00  0.42, 0.92
## 4 Interaction w/ Group -0.91 0.35 -2.60 0.01 -1.6, -0.22
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1     0.17      -1.32     0.47      -1.22
## 2      0     0.27      -0.51     0.23      -0.54
## 3      1     0.36       0.31    -0.01       0.13
plots(modelname = modelAPSI_interaction, fitname = fit, data = adult2,  interactionterm = "PurposeAPSI_mean_1.GROUP1", new_scale_name = "APSI Sense of Identity", time2 = "T1-T2", time3 = "T1-T3")  
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  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              109.932
##   Degrees of freedom                                 7
##   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)               -322.678
##   Loglikelihood unrestricted model (H1)       -322.678
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 667.356
##   Bayesian (BIC)                               694.731
##   Sample-size adjusted Bayesian (BIC)          660.016
## 
## 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.777    0.140    5.555    0.000    0.777    0.392
##     SCALED_1_APSI     0.816    0.072   11.380    0.000    0.816    0.815
##     PAPSI__1.GROUP   -0.721    0.197   -3.651    0.000   -0.721   -0.262
##   SCALED_3_APSI ~                                                       
##     GROUP1            0.131    0.279    0.470    0.639    0.131    0.063
##     SCALED_1_APSI     0.104    0.223    0.468    0.640    0.104    0.099
##     PAPSI__1.GROUP   -0.410    0.358   -1.143    0.253   -0.410   -0.141
##     SCALED_2_APSI     0.697    0.217    3.214    0.001    0.697    0.660
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_APSI    -0.509    0.096   -5.275    0.000   -0.509   -0.513
##     SCALED_3_APSI    -0.189    0.207   -0.917    0.359   -0.189   -0.181
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_APSI     0.305    0.055    5.552    0.000    0.305    0.311
##     SCALED_3_APSI     0.454    0.100    4.536    0.000    0.454    0.415
## 
## R-Square:
##                    Estimate
##     SCALED_2_APSI     0.689
##     SCALED_3_APSI     0.585
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z p       90% CI
## 1            Intercept -0.51 0.10 -5.27 0  -0.7, -0.32
## 2               GROUP1  0.78 0.14  5.56 0    0.5, 1.05
## 3                 APSI  0.82 0.07 11.38 0   0.68, 0.96
## 4 Interaction w/ Group -0.72 0.20 -3.65 0 -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.13 0.28  0.47 0.64 -0.42, 0.68
## 3                 APSI  0.10 0.22  0.47 0.64 -0.33, 0.54
## 4 Interaction w/ Group -0.41 0.36 -1.14 0.25 -1.11, 0.29
## 
## 
## [[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.36       0.31     0.28      -0.08
plots(modelname = modelAPSI_interaction_T3, fitname = fit, data = adult2,  interactionterm = "PurposeAPSI_mean_1.GROUP1", new_scale_name = "APSI Sense of Identity", time2 = "T1-T2", time3 = "T1-T2-T3") 
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
#################  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  22 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.299
##   Degrees of freedom                                 7
##   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.539
##   Loglikelihood unrestricted model (H1)       -404.539
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 831.077
##   Bayesian (BIC)                               858.452
##   Sample-size adjusted Bayesian (BIC)          823.738
## 
## 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.095    0.147   -0.645    0.519   -0.095   -0.044
##     SCALED_1_Res      0.943    0.084   11.182    0.000    0.943    0.865
##     Rs_mn_1.GROUP1    0.240    0.092    2.602    0.009    0.240    0.201
##   SCALED_3_Res ~                                                        
##     GROUP1            0.152    0.201    0.754    0.451    0.152    0.073
##     SCALED_1_Res      0.771    0.135    5.711    0.000    0.771    0.736
##     Rs_mn_1.GROUP1   -0.081    0.150   -0.539    0.590   -0.081   -0.071
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_Res ~~                                                       
##     SCALED_3_Res      0.104    0.070    1.497    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.122    0.262   -0.109   -0.101
##     SCALED_3_Res     -0.192    0.136   -1.419    0.156   -0.192   -0.186
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Res      0.330    0.058    5.700    0.000    0.330    0.284
##     SCALED_3_Res      0.449    0.096    4.699    0.000    0.449    0.419
## 
## R-Square:
##                    Estimate
##     SCALED_2_Res      0.716
##     SCALED_3_Res      0.581
## [[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.65 0.52 -0.38, 0.19
## 3           Resiliance  0.94 0.08 11.18 0.00  0.78, 1.11
## 4 Interaction w/ Group  0.24 0.09  2.60 0.01  0.06, 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.15 0.20  0.75 0.45 -0.24, 0.55
## 3           Resiliance  0.77 0.13  5.71 0.00  0.51, 1.04
## 4 Interaction w/ Group -0.08 0.15 -0.54 0.59 -0.37, 0.21
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -1.39      -1.05    -0.98      -0.96
## 2      0    -0.20      -0.11    -0.29      -0.19
## 3      1     0.98       0.83     0.40       0.58
plots(modelname = modelRes_interaction, fitname = fit, data = adult2,  interactionterm = "Res_mean_1.GROUP1", new_scale_name = "Resiliance", , time2 = "T1-T2", time3 = "T1-T3")  
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  22 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.299
##   Degrees of freedom                                 7
##   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.539
##   Loglikelihood unrestricted model (H1)       -404.539
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 831.077
##   Bayesian (BIC)                               858.452
##   Sample-size adjusted Bayesian (BIC)          823.738
## 
## 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.095    0.147   -0.645    0.519   -0.095   -0.044
##     SCALED_1_Res      0.943    0.084   11.182    0.000    0.943    0.865
##     Rs_mn_1.GROUP1    0.240    0.092    2.602    0.009    0.240    0.201
##   SCALED_3_Res ~                                                        
##     GROUP1            0.182    0.198    0.919    0.358    0.182    0.088
##     SCALED_1_Res      0.472    0.241    1.961    0.050    0.472    0.451
##     Rs_mn_1.GROUP1   -0.156    0.149   -1.049    0.294   -0.156   -0.137
##     SCALED_2_Res      0.316    0.204    1.553    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.122    0.262   -0.109   -0.101
##     SCALED_3_Res     -0.158    0.136   -1.164    0.244   -0.158   -0.153
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_Res      0.330    0.058    5.700    0.000    0.330    0.284
##     SCALED_3_Res      0.416    0.087    4.794    0.000    0.416    0.388
## 
## R-Square:
##                    Estimate
##     SCALED_2_Res      0.716
##     SCALED_3_Res      0.612
## [[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.65 0.52 -0.38, 0.19
## 3           Resiliance  0.94 0.08 11.18 0.00  0.78, 1.11
## 4 Interaction w/ Group  0.24 0.09  2.60 0.01  0.06, 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.18 0.20  0.92 0.36 -0.21, 0.57
## 3           Resiliance  0.47 0.24  1.96 0.05     0, 0.94
## 4 Interaction w/ Group -0.16 0.15 -1.05 0.29 -0.45, 0.14
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -1.39      -1.05    -0.57      -0.63
## 2      0    -0.20      -0.11    -0.25      -0.16
## 3      1     0.98       0.83     0.06       0.31
plots(modelname = modelRes_interaction_T3, fitname = fit, data = adult2,  interactionterm = "Res_mean_1.GROUP1", new_scale_name = "Resiliance", time2 = "T1-T2", time3 = "T1-T2-T3")                                                                          
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
#################  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  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               27.606
##   Degrees of freedom                                 7
##   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)               -281.905
##   Loglikelihood unrestricted model (H1)       -281.905
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 585.810
##   Bayesian (BIC)                               613.185
##   Sample-size adjusted Bayesian (BIC)          578.471
## 
## 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.406    0.201   -2.018    0.044   -0.406   -0.203
##     SCALED_1_GRIT     0.561    0.108    5.186    0.000    0.561    0.563
##     GRIT__1.GROUP1   -0.597    0.782   -0.763    0.445   -0.597   -0.085
##   SCALED_3_GRIT ~                                                       
##     GROUP1            0.018    0.292    0.062    0.950    0.018    0.009
##     SCALED_1_GRIT     0.207    0.171    1.213    0.225    0.207    0.210
##     GRIT__1.GROUP1    0.470    1.197    0.393    0.694    0.470    0.067
## 
## Covariances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##   SCALED_2_GRIT ~~                                                      
##     SCALED_3_GRIT     0.034    0.124    0.278    0.781    0.034    0.044
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_GRIT     0.173    0.136    1.272    0.203    0.173    0.172
##     SCALED_3_GRIT    -0.044    0.199   -0.220    0.826   -0.044   -0.044
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_GRIT     0.638    0.115    5.565    0.000    0.638    0.635
##     SCALED_3_GRIT     0.945    0.195    4.847    0.000    0.945    0.959
## 
## R-Square:
##                    Estimate
##     SCALED_2_GRIT     0.365
##     SCALED_3_GRIT     0.041
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.17 0.14  1.27 0.20 -0.09, 0.44
## 2               GROUP1 -0.41 0.20 -2.02 0.04 -0.8, -0.01
## 3                 Grit  0.56 0.11  5.19 0.00  0.35, 0.77
## 4 Interaction w/ Group -0.60 0.78 -0.76 0.45 -2.13, 0.94
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.04 0.20 -0.22 0.83 -0.43, 0.35
## 2               GROUP1  0.02 0.29  0.06 0.95 -0.55, 0.59
## 3                 Grit  0.21 0.17  1.21 0.23 -0.13, 0.54
## 4 Interaction w/ Group  0.47 1.20  0.39 0.69 -1.88, 2.82
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.20      -0.39    -1.13      -0.25
## 2      0    -0.23       0.17    -0.45      -0.04
## 3      1    -0.27       0.73     0.23       0.16
plots(modelname = modelGRIT_interaction, fitname = fit, data = adult2,  interactionterm = "GRIT_mean_1.GROUP1", new_scale_name = "Grit Scale (Duckworth)", , time2 = "T1-T2", time3 = "T1-T3")  
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  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               27.606
##   Degrees of freedom                                 7
##   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)               -281.905
##   Loglikelihood unrestricted model (H1)       -281.905
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 585.810
##   Bayesian (BIC)                               613.185
##   Sample-size adjusted Bayesian (BIC)          578.471
## 
## 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.406    0.201   -2.018    0.044   -0.406   -0.203
##     SCALED_1_GRIT     0.561    0.108    5.186    0.000    0.561    0.563
##     GRIT__1.GROUP1   -0.597    0.782   -0.763    0.445   -0.597   -0.085
##   SCALED_3_GRIT ~                                                       
##     GROUP1            0.040    0.297    0.135    0.892    0.040    0.020
##     SCALED_1_GRIT     0.177    0.212    0.837    0.403    0.177    0.180
##     GRIT__1.GROUP1    0.502    1.204    0.417    0.676    0.502    0.072
##     SCALED_2_GRIT     0.054    0.194    0.279    0.780    0.054    0.055
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_GRIT     0.173    0.136    1.272    0.203    0.173    0.172
##     SCALED_3_GRIT    -0.053    0.199   -0.267    0.790   -0.053   -0.054
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_GRIT     0.638    0.115    5.565    0.000    0.638    0.635
##     SCALED_3_GRIT     0.943    0.195    4.845    0.000    0.943    0.957
## 
## R-Square:
##                    Estimate
##     SCALED_2_GRIT     0.365
##     SCALED_3_GRIT     0.043
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.17 0.14  1.27 0.20 -0.09, 0.44
## 2               GROUP1 -0.41 0.20 -2.02 0.04 -0.8, -0.01
## 3                 Grit  0.56 0.11  5.19 0.00  0.35, 0.77
## 4 Interaction w/ Group -0.60 0.78 -0.76 0.45 -2.13, 0.94
## 
## [[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.04 0.30  0.14 0.89 -0.54, 0.62
## 3                 Grit  0.18 0.21  0.84 0.40 -0.24, 0.59
## 4 Interaction w/ Group  0.50 1.20  0.42 0.68 -1.86, 2.86
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.20      -0.39    -1.14      -0.23
## 2      0    -0.23       0.17    -0.46      -0.05
## 3      1    -0.27       0.73     0.22       0.12
plots(modelname = modelGRIT_interaction_T3, fitname = fit, data = adult2,  interactionterm = "GRIT_mean_1.GROUP1", new_scale_name = "Grit Scale (Duckworth)", time2 = "T1-T2", time3 = "T1-T2-T3")  
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
#################  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  21 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               59.551
##   Degrees of freedom                                 7
##   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)               -464.622
##   Loglikelihood unrestricted model (H1)       -464.622
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 951.243
##   Bayesian (BIC)                               978.618
##   Sample-size adjusted Bayesian (BIC)          943.904
## 
## 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.181    0.205   -0.887    0.375   -0.181
##     SCALED_1_PERMA           0.555    0.105    5.279    0.000    0.555
##     PERMA_L__1.GRO           0.094    0.081    1.162    0.245    0.094
##   SCALED_3_PERMA_Lonely ~                                             
##     GROUP1                  -0.295    0.222   -1.330    0.184   -0.295
##     SCALED_1_PERMA           0.630    0.116    5.420    0.000    0.630
##     PERMA_L__1.GRO          -0.152    0.092   -1.654    0.098   -0.152
##   Std.all
##          
##    -0.091
##     0.556
##     0.124
##          
##    -0.146
##     0.623
##    -0.199
## 
## Covariances:
##                            Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_PERMA_Lonely ~~                                             
##     SCALED_3_PERMA            0.270    0.092    2.921    0.003    0.270
##   Std.all
##          
##     0.444
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA    0.141    0.137    1.026    0.305    0.141    0.141
##     SCALED_3_PERMA    0.213    0.150    1.417    0.157    0.213    0.211
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA    0.666    0.118    5.655    0.000    0.666    0.668
##     SCALED_3_PERMA    0.555    0.114    4.880    0.000    0.555    0.544
## 
## R-Square:
##                    Estimate
##     SCALED_2_PERMA    0.332
##     SCALED_3_PERMA    0.456
## [[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.18 0.20 -0.89 0.38 -0.58, 0.22
## 3         Perma Lonely  0.56 0.11  5.28 0.00  0.35, 0.76
## 4 Interaction w/ Group  0.09 0.08  1.16 0.25 -0.06, 0.25
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept  0.21 0.15  1.42 0.16 -0.08, 0.51
## 2               GROUP1 -0.29 0.22 -1.33 0.18 -0.73, 0.14
## 3         Perma Lonely  0.63 0.12  5.42 0.00   0.4, 0.86
## 4 Interaction w/ Group -0.15 0.09 -1.65 0.10 -0.33, 0.03
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.69      -0.41    -0.45      -0.42
## 2      0    -0.04       0.14     0.03       0.21
## 3      1     0.61       0.70     0.51       0.84
plots(modelname = modelPERMA_Lonely_interaction, fitname = fit, data = adult2,  interactionterm = "PERMA_Lonely_mean_1.GROUP1", new_scale_name = "Perma Lonely", time2 = "T1-T2", time3 = "T1-T3")  
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  16 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               59.551
##   Degrees of freedom                                 7
##   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)               -464.622
##   Loglikelihood unrestricted model (H1)       -464.622
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 951.243
##   Bayesian (BIC)                               978.618
##   Sample-size adjusted Bayesian (BIC)          943.904
## 
## 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.181    0.205   -0.887    0.375   -0.181
##     SCALED_1_PERMA           0.555    0.105    5.279    0.000    0.555
##     PERMA_L__1.GRO           0.094    0.081    1.162    0.245    0.094
##   SCALED_3_PERMA_Lonely ~                                             
##     GROUP1                  -0.221    0.214   -1.031    0.302   -0.221
##     SCALED_1_PERMA           0.405    0.126    3.224    0.001    0.405
##     PERMA_L__1.GRO          -0.191    0.086   -2.214    0.027   -0.191
##     SCALED_2_PERMA           0.406    0.117    3.473    0.001    0.406
##   Std.all
##          
##    -0.091
##     0.556
##     0.124
##          
##    -0.109
##     0.400
##    -0.249
##     0.401
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA    0.141    0.137    1.026    0.305    0.141    0.141
##     SCALED_3_PERMA    0.156    0.146    1.071    0.284    0.156    0.154
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA    0.666    0.118    5.655    0.000    0.666    0.668
##     SCALED_3_PERMA    0.445    0.097    4.597    0.000    0.445    0.437
## 
## R-Square:
##                    Estimate
##     SCALED_2_PERMA    0.332
##     SCALED_3_PERMA    0.563
## [[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.18 0.20 -0.89 0.38 -0.58, 0.22
## 3         Perma Lonely  0.56 0.11  5.28 0.00  0.35, 0.76
## 4 Interaction w/ Group  0.09 0.08  1.16 0.25 -0.06, 0.25
## 
## [[1]][[2]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept  0.16 0.15  1.07 0.28  -0.13, 0.44
## 2               GROUP1 -0.22 0.21 -1.03 0.30   -0.64, 0.2
## 3         Perma Lonely  0.40 0.13  3.22 0.00   0.16, 0.65
## 4 Interaction w/ Group -0.19 0.09 -2.21 0.03 -0.36, -0.02
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.69      -0.41    -0.24      -0.25
## 2      0    -0.04       0.14    -0.03       0.16
## 3      1     0.61       0.70     0.19       0.56
plots(modelname = modelPERMA_Lonely_interaction_T3, fitname = fit, data = adult2,  interactionterm = "PERMA_Lonely_mean_1.GROUP1", new_scale_name = "Perma Lonely", time2 = "T1-T2", time3 = "T1-T2-T3")                                                                                                      
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#########################################
#################  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  19 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.680
##   Degrees of freedom                                 7
##   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.527
##   Loglikelihood unrestricted model (H1)       -425.527
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 873.054
##   Bayesian (BIC)                               900.429
##   Sample-size adjusted Bayesian (BIC)          865.715
## 
## 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.526    0.184    2.861    0.004    0.526
##     SCALED_1_PERMA          0.606    0.099    6.116    0.000    0.606
##     PERMA_H__1.GRO         -0.171    0.103   -1.649    0.099   -0.171
##   SCALED_3_PERMA_Happy ~                                             
##     GROUP1                  0.500    0.218    2.294    0.022    0.500
##     SCALED_1_PERMA          0.531    0.124    4.280    0.000    0.531
##     PERMA_H__1.GRO         -0.278    0.132   -2.112    0.035   -0.278
##   Std.all
##          
##     0.265
##     0.605
##    -0.164
##          
##     0.250
##     0.526
##    -0.266
## 
## Covariances:
##                           Estimate  Std.Err  Z-value  P(>|z|)   Std.lv
##   SCALED_2_PERMA_Happy ~~                                             
##     SCALED_3_PERMA           0.343    0.097    3.533    0.000    0.343
##   Std.all
##          
##     0.605
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA   -0.332    0.123   -2.691    0.007   -0.332   -0.335
##     SCALED_3_PERMA   -0.375    0.152   -2.469    0.014   -0.375   -0.375
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA    0.539    0.100    5.381    0.000    0.539    0.547
##     SCALED_3_PERMA    0.598    0.122    4.889    0.000    0.598    0.599
## 
## R-Square:
##                    Estimate
##     SCALED_2_PERMA    0.453
##     SCALED_3_PERMA    0.401
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.33 0.12 -2.69 0.01 -0.57, -0.09
## 2               GROUP1  0.53 0.18  2.86 0.00   0.17, 0.89
## 3          Perma Happy  0.61 0.10  6.12 0.00    0.41, 0.8
## 4 Interaction w/ Group -0.17 0.10 -1.65 0.10  -0.37, 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.50 0.22  2.29 0.02   0.07, 0.93
## 3          Perma Happy  0.53 0.12  4.28 0.00   0.29, 0.77
## 4 Interaction w/ Group -0.28 0.13 -2.11 0.03 -0.54, -0.02
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.24      -0.94    -0.10      -0.91
## 2      0     0.19      -0.33     0.15      -0.37
## 3      1     0.63       0.27     0.40       0.16
plots(modelname = modelPERMA_Happy_interaction, fitname = fit, data = adult2,  interactionterm = "PERMA_Happy_mean_1.GROUP1", new_scale_name = "Perma Happy", time2 = "T1-T2", time3 = "T1-T3")  
## Saving 7 x 5 in image
## Saving 7 x 5 in image

#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  17 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.680
##   Degrees of freedom                                 7
##   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.527
##   Loglikelihood unrestricted model (H1)       -425.527
## 
##   Number of free parameters                         11
##   Akaike (AIC)                                 873.054
##   Bayesian (BIC)                               900.429
##   Sample-size adjusted Bayesian (BIC)          865.715
## 
## 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.526    0.184    2.861    0.004    0.526
##     SCALED_1_PERMA          0.606    0.099    6.116    0.000    0.606
##     PERMA_H__1.GRO         -0.171    0.103   -1.649    0.099   -0.171
##   SCALED_3_PERMA_Happy ~                                             
##     GROUP1                  0.165    0.206    0.801    0.423    0.165
##     SCALED_1_PERMA          0.145    0.139    1.042    0.297    0.145
##     PERMA_H__1.GRO         -0.170    0.135   -1.261    0.207   -0.170
##     SCALED_2_PERMA          0.637    0.131    4.864    0.000    0.637
##   Std.all
##          
##     0.265
##     0.605
##    -0.164
##          
##     0.082
##     0.144
##    -0.162
##     0.633
## 
## Intercepts:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA   -0.332    0.123   -2.691    0.007   -0.332   -0.335
##     SCALED_3_PERMA   -0.163    0.142   -1.150    0.250   -0.163   -0.163
## 
## Variances:
##                    Estimate  Std.Err  Z-value  P(>|z|)   Std.lv  Std.all
##     SCALED_2_PERMA    0.539    0.100    5.381    0.000    0.539    0.547
##     SCALED_3_PERMA    0.379    0.090    4.237    0.000    0.379    0.380
## 
## R-Square:
##                    Estimate
##     SCALED_2_PERMA    0.453
##     SCALED_3_PERMA    0.620
## [[1]]
## [[1]][[1]]
##                   Item     β   SE     z    p       90% CI
## 1            Intercept -0.33 0.12 -2.69 0.01 -0.57, -0.09
## 2               GROUP1  0.53 0.18  2.86 0.00   0.17, 0.89
## 3          Perma Happy  0.61 0.10  6.12 0.00    0.41, 0.8
## 4 Interaction w/ Group -0.17 0.10 -1.65 0.10  -0.37, 0.03
## 
## [[1]][[2]]
##                   Item     β   SE     z    p      90% CI
## 1            Intercept -0.16 0.14 -1.15 0.25 -0.44, 0.12
## 2               GROUP1  0.16 0.21  0.80 0.42 -0.24, 0.57
## 3          Perma Happy  0.14 0.14  1.04 0.30 -0.13, 0.42
## 4 Interaction w/ Group -0.17 0.13 -1.26 0.21 -0.43, 0.09
## 
## 
## [[2]]
##   levels Treat_T2 Control_T2 Treat_T3 Control_T3
## 1     -1    -0.24      -0.94     0.39      -0.31
## 2      0     0.19      -0.33     0.36      -0.16
## 3      1     0.63       0.27     0.34      -0.02
plots(modelname = modelPERMA_Happy_interaction_T3, fitname = fit, data = adult2,  interactionterm = "PERMA_Happy_mean_1.GROUP1", new_scale_name = "Perma Happy", time2 = "T1-T2", time3 = "T1-T2-T3")  
## Saving 7 x 5 in image
## Saving 7 x 5 in image