I need the defined parameter later on and want to use it like this:
MODEL CONSTRAINT:
new (rho*.4 beta*0);
v_e1 = ((V0) - (V0 * (rho)))/(rho);
v_e2 = ((V0) - (V0 * (rho+ beta)))/(rho+ beta);
v_e3 = ((V0) - (V0 * (rho+ 2*beta)))/(rho+ 2*beta);
v_e4 = ((V0) - (V0 * (rho+ 3*beta)))/(rho+ 3*beta);
v_e5 = ((V0) - (V0 * (rho+ 7*beta)))/(rho+ 7*beta);
v_e6 = ((V0) - (V0 * (rho+11*beta)))/(rho+11*beta);
The V0 parameter is just a label given earlier in the syntax.
The same trick they mention in Footnote 1 (p. 686) works in lavaan. You can define a phantom variable as measured by a constant, so it will be automatically unrelated to everything in the model. If you run example(cfa), you can see this adapted script adds a phantom with zero (co)variance and a fixed mean of 0.4, without changing model fit because it does nothing with that phantom's mean.
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9
ph =~ 0
ph ~ 0.4*1
'
fit <- cfa(HS.model, data=HolzingerSwineford1939)
summary(fit)
Now, you want to freely estimate rho and beta, which are "free floating" model parameters defined only in the context of other parameters. So you just need to extend the line that specifies a phantom's mean to both free it, label it, and set the starting value (using the ? operator).
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
ph =~ 0
ph ~ NA*1 + label("foo")*1 + .4?1 # free it, label it, start it at .4
'
fit <- cfa(HS.model, data=HolzingerSwineford1939)
summary(fit)
And you do that for both rho and beta (i.e., create 2 phantoms, and use their means as placeholders for rho and beta, respectively). Then you can use those "phantom mean" parameters in your model constraints. For example, if I want "foo" to be the difference between the second and third loadings of the first 2 factors:
HS.model <- ' visual =~ x1 + L2*x2 + L3*x3
textual =~ x4 + L5*x5 + L6*x6
ph =~ 0
ph ~ NA*1 + label("foo")*1 + .2?1
L3 == L2 + foo
L5 == L6 + foo
'
fit <- cfa(HS.model, data=HolzingerSwineford1939)
summary(fit)
Of course, if I only include the constraint "L3 == L2 + foo", then the model will be identical to example(cfa). But your constraints are more complex and serve a different purpose than this illustration.
Good luck,
Terrence D. Jorgensen
Postdoctoral Researcher, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam