I am trying to run an SEM model where multiple variables (and only latent exogenous variable) are predicting three mediators leading to two different latent outcomes. The latent outcomes are Highest risk and lower risk. I also have pathways that depict a “daisy chain mediation to one of the outcomes (shown in the indirect paths). I a getting the error “the optimizer warns that a solution has not been found. I am wondering if I need to add covariation in the two outcomes or run the analyses seperately for each outcome? Thank you in advance for any advice
Here is the code I am running:
"OrdinalOutcomeModel <-
‘
#Latent Variables:
ERILatent=~ ERIcent + ERIpub + ERIpriv
HighRiskLatent=~ RHPHHIC + RHPHLIC + RLPHHIC + RLPHLIC
LowRiskLatent=~ RHPLHIC + RHPLLIC + RLPLHIC + RLPLLIC
#Pathways
HighRiskLatent ~ a11*BFIN + a12 * SelfC + a13*BASfun + a14*SpiritCope + a15*DisengageCope + a16* Discrim + a17*SenseOB + a18*ERILatent + a19*MajPerc + a20*DrinkNorms + a21*StudInvest + a22*Coping
LowRiskLatent ~ e12*SelfC + e13*BASfun + e20*DrinkNorms + e23*Enhance
Coping ~ b14*SpiritCope + b15*DisengageCope + b16*Discrim + b17*SenseOB + b18*ERILatent + b19*MajPerc + b20*DrinkNorms + b21*StudInvest
Enhance ~ c12*SelfC + c13*BASfun + c20*DrinkNorms
StudInvest ~ d11*BFIN + d12*SelfC + d13*BASfun + d20*DrinkNorms
#Indirect Effects
#Pathways to High Risk Latent via Coping
SpiritviaCope := b14 * a22
DisengageviaCope := b15 * a22
DiscrimviaCope := b16 * a22
SenseOBviaCope := b17 * a22
EthnicRILatentviaCope := b18 * a22
MajPercviaCope := b19 * a22
DrinkNormsviaCope := b20 * a22
#Pathways to Low Risk via Enhancement
SelfCviaEnhance := c12 * e23
BASfunviaEnhance := c13 * e23
DrinkNormsviaEnhance := c20 * e23
#Pathways to High Risk Via Student Role Investment FIRST, then Coping
BFINviaSRthenCope := d11 * b21 * a22
SelfCviaSRthenCope := d12 * b21 * a22
BASfunviaSRthenCope := d13 *b21 * a22
#Exploratory Analyses (Run after initial model)
#Add e23*Enhance to HighRiskLatent
#Add paths coping and enhancement to RLPH, RHPH, RLPL, and RHPL
#RLPL~ Coping +Enhance
#RHPH~ Coping +Enhance
#RLPL~ Coping + Enhance
#RHPL~ Coping + Enhance
#total effects
BFINtotalHighRisk := a11 + (d11*b21*a22)
SelfCtotalHighRisk := a12 + (c12*e23) + (d12*b21*a22)
BASfuntotalHighRisk := a13 + (c13 * e23) + (d13 * b21 *a22)
ERIlatenttotalHighRisk := a18 + (b18 *a22)
SpritCopetotalHighRisk := a14 + (b14 *a22)
DisengageCopetotalHighRisk := a15 + (b15 * a22)
DiscrimtotalHighRisk := a16 + (b16 * a22)
SenseOBtotalHighRisk := a17 + (b17 * a22)
MajPerctotalHighRisk := a19 + (b19 *a22)
DrinkNormstotalHighRisk := a20 + (b20 * a22)
SelfCtotalLowRisk := e12 + (c12 * e23)
BasfuntotalLowRisk := e13 + (c13 * e23)
DrinkNormstotalLowRisk := e20 + (c20 * e23)
# Within wave 1
BFIN ~~ ERIpub
BFIN ~~ MajPerc
BFIN ~~ SenseOB
BFIN ~~ Sex
BFIN ~~ FamHist
SelfC ~~ Sex
BASfun ~~ Discrim
BASfun ~~ DailyDrink
BASfun ~~ FirstDrink
ERIcent ~~ Sex
ERIcent ~~ FamHist
ERIpub ~~ MajPerc
ERIpub ~~ Relig
ERIpub ~~ SenseOB
ERIpub ~~ Sex
ERIpub ~~ FamHist
ERIpriv ~~ Discrim
ERIpriv ~~ SenseOB
ERIpriv ~~ DrinkNorms
ERIpriv ~~ DailyDrink
ERIpriv ~~ Sex
MajPerc ~~ Sex
SenseOB ~~ Sex
DrinkNorms ~~ DailyDrink
DailyDrink ~~ Sex
Sex ~~ FirstDrink
SpiritCope ~~ BFIN
SpiritCope ~~ MajPerc
DisengageCope ~~ BFIN
DisengageCope ~~ SenseOB
DisengageCope ~~ DrinkNorms
DisengageCope ~~ ERIpriv
DisengageCope ~~ DailyDrink
‘
> OrdinalOutcomeModelFit <- sem(OrdinalOutcomeModel, data = mydata, estimator = "ML", missing = "FIML", fixed.x = FALSE)
Warning message:
In lavaan::lavaan(model = OrdinalOutcomeModel, data = mydata, estimator = "ML", :
lavaan WARNING:
the optimizer warns that a solution has NOT been found!
E M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.