This is a piece of code for a similar case. Is it okay?
dataSem <- '
BE=~0.95BE1+0.955BE2+0.95BE3+0.8BE4+0.9BE5
BA=~0.1BA1+.95BA2+0.9BA3+0.1BA4+0.95BA5+0.8BA6
BAS=~0.1BAS1+0.95BAS2+0.9BAS3+0.1BAS4+0.95BAS5+0.98BAS6+0.1BAS7+0.86BAS9
PQ=~0.977PQ1+0.985PQ2+0.959PQ3+0.1PQ4+0.987PQ5+0.2PQ6+0.1PQ7+0.15PQ8+0.05PQ9+0.09PQ10
L=~0.988L1+0.99L2+0.1L3+0.1L4+0.1L5+0.1L6+0.96L7
INF=~0.99INF1+0.989INF2+0.87INF3+0.8INF4
C=~0.8C1+0.1C2+0.8C3+0.8C4+0.1C5+0.1C6+0.9C7+0.9C8+0.9C9+0.9C10
INFEDINC=~INF+ED+INC+INF:ED+INF:INC
CEDINC=~C+ED+INC+C:ED+C:INC
PQCI=~PQ+C+INF+PQ:C+PQ:INF+INFEDINC+CEDINC
BE=~NABA+aPQCI+bBAS+cL
a+b+c ==2.5
'
If I want to add constraints to make INC and ED within the rage of 1 to 3
and rests in the range of 1 to 5 , how to do it?
--
You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/tXLtsqAXPZo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+unsubscribe@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.
I want a data simulation where INC and ED are moderating INF and C and INF and C are moderating PQ.
standardize <- function(x){
z <- qnorm(pnorm(y, mean(x), sd(x)))
return(z)
} # end function
y <- rnorm(10, 2, 1)
zy <- standardize(y)
mean(zy); sd(zy)
mySimulationFunction <- function(nobs=1){
myData <- data.frame(x=rnorm(nobs))
return(myData)
} # end function
fitModel <- 'x ~~ x'
mySim <- sim(nRep=5, model=fitModel, n=50, generate=mySimulationFunction)
summary(mySim)
CEDINC=~C+ED+INC+C:ED+C:INCy ~ x1 + x2 # everything but the disturbance
y ~~ y # the disturbance, e[y]