Skip to content

Commit

Permalink
20231116 - cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
Petersen committed Nov 16, 2023
1 parent 9917bcf commit 469aa6c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions 08-Structural-Equation-Modeling.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -594,14 +594,14 @@ formativeModel3_syntax <- '
v4 ~~ 0*v4
# Calculate the unstandardized weights to form the formative latent variable
w1:= (-l32 + l22*l33 + l34*l42 - l22*l34*l43)/(
w1 := (-l32 + l22*l33 + l34*l42 - l22*l34*l43)/(
1 - l11*l32 - l21*l33 + l11*l22*l33 - l34*l41 + l11*l34*l42 +
l21* l34* l43 - l11* l22* l34* l43)
w2:= (-l33 + l34*l43)/(1 - l11*l32 - l21*l33 +
w2 := (-l33 + l34*l43)/(1 - l11*l32 - l21*l33 +
l11*l22*l33 - l34*l41 + l11*l34*l42 + l21*l34*l43 - l11*l22*l34*l43)
w3:= 1/(1 - l11*l32 - l21*l33 + l11*l22*l33 -
w3 := 1/(1 - l11*l32 - l21*l33 + l11*l22*l33 -
l34*l41 + l11*l34*l42 + l21*l34*l43 - l11*l22*l34*l43)
w4:= -l34/(1 - l11*l32 - l21*l33 + l11*l22*l33 -
w4 := -l34/(1 - l11*l32 - l21*l33 + l11*l22*l33 -
l34*l41 + l11*l34*l42 + l21*l34*l43 - l11*l22*l34*l43)
# Calculate the variances
Expand Down Expand Up @@ -697,10 +697,10 @@ formativeModel4_syntax <- '
varv4 := ((l41) * (varformative)) * (l41) + ((1) * (varnu3)) * (1)
# Calculate the standardized weights to form the formative latent variable
wstdv1:=((w1) * (sqrt(varv1))) * (1/sqrt(varformative))
wstdv2:=((w2) * (sqrt(varv2))) * (1/sqrt(varformative))
wstdv3:=((w3) * (sqrt(varv3))) * (1/sqrt(varformative))
wstdv4:=((w4) * (sqrt(varv4))) * (1/sqrt(varformative))
wstdv1 := ((w1) * (sqrt(varv1))) * (1/sqrt(varformative))
wstdv2 := ((w2) * (sqrt(varv2))) * (1/sqrt(varformative))
wstdv3 := ((w3) * (sqrt(varv3))) * (1/sqrt(varformative))
wstdv4 := ((w4) * (sqrt(varv4))) * (1/sqrt(varformative))
'
formativeModel4Fit <- sem(
Expand Down

0 comments on commit 469aa6c

Please sign in to comment.