Hi,
Using gsem in Stata 13.1, I have built a single-level generalized structural equation model to fit data on tooth health in 145 dogs. Two endogenous variables are tooth calculus (calc: ordinal 0-1-2) and tooth loss (loss: binary 0-1). The model also contains a measurement part with a latent variable, which might be a complicating factor. I have managed to caculate predicted probabilities of the different levels of these variables for all observations, using e.g.
> predict prcalc*, pr outcome(calc)
> predict prloss*, pr outcome(loss)
However, I have not succeeded to estimate marginal means (margins). So far, the commands I have tried either do not work at all or produce an error message that estimates cannot be obtained. I have plotted the probabilities against exogenous predictors (categorical and continuous) to illustrate the relationships graphically, using colours to distinguish different categories of one predictor (and I have even drawn trend lines using a spline function), but I figure it should be possible for Stata to calculate margins and plot them, especially since it does provide the probabilites.
Can somebody please advise me on what command to issue and how to formulate it to get the margins?
Cheers,
Jan
Using gsem in Stata 13.1, I have built a single-level generalized structural equation model to fit data on tooth health in 145 dogs. Two endogenous variables are tooth calculus (calc: ordinal 0-1-2) and tooth loss (loss: binary 0-1). The model also contains a measurement part with a latent variable, which might be a complicating factor. I have managed to caculate predicted probabilities of the different levels of these variables for all observations, using e.g.
> predict prcalc*, pr outcome(calc)
> predict prloss*, pr outcome(loss)
However, I have not succeeded to estimate marginal means (margins). So far, the commands I have tried either do not work at all or produce an error message that estimates cannot be obtained. I have plotted the probabilities against exogenous predictors (categorical and continuous) to illustrate the relationships graphically, using colours to distinguish different categories of one predictor (and I have even drawn trend lines using a spline function), but I figure it should be possible for Stata to calculate margins and plot them, especially since it does provide the probabilites.
Can somebody please advise me on what command to issue and how to formulate it to get the margins?
Cheers,
Jan
Comment