Hi all,
I'm wondering if it's possible to estimate the predictive margins and average marginal effects etc of a latent variable in a structural equation model.
To give you a simple simulated example, say I've got 2000 observations of a variable y that is affected by an unobserved variable U, which is measured through five variables x1-x5, and a few observed covariates z1-z3
Then I estimate my model like so:
I know I can estimate the predictive margins of my z variables, with Stata integrating over the latent variable, like so:
But what I want to do is estimate the margins of the latent variable itself, i.e.
But when I do that, Stata tells me "variable 'LatentU' not found in list of covariates"
Is there any way of doing this? Or is there some reason doing this would be a bad idea? I can imagine the calculations of the standard errors are potentially quite complicated but can't see an obvious reason why it wouldn't be possible in theory, but I might be missing something.
Thanks for any help!
Chris
I'm wondering if it's possible to estimate the predictive margins and average marginal effects etc of a latent variable in a structural equation model.
To give you a simple simulated example, say I've got 2000 observations of a variable y that is affected by an unobserved variable U, which is measured through five variables x1-x5, and a few observed covariates z1-z3
Code:
set obs 2000
drawnorm U z1 z2 z3
forvalues x = 1/5 {
gen x`x' = U + rnormal()
}
gen y = U + z1 + z2 + z3 + rnormal()
Code:
sem /// (LatentU -> x1 x2 x3 x4 x5) /// (z1 z2 z3 LatentU -> y)
Code:
margins, at(z1=(-1 0 1)) predict(xb(y))
Code:
margins, at(LatentU=(-1 0 1)) predict(xb(y))
Is there any way of doing this? Or is there some reason doing this would be a bad idea? I can imagine the calculations of the standard errors are potentially quite complicated but can't see an obvious reason why it wouldn't be possible in theory, but I might be missing something.
Thanks for any help!
Chris

Comment