Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using gsem with ordered categorical mediators

    Hi,

    I want to run a mediation analysis looking at the direct and indirect effect of adolescent personality (three separate but related measures of personality) on all-cause mortality in adulthood. I have a range of mediators I want to include, most of which are continuous variables. However, I have several ordered categorical mediators, including highest qualification and self-reported health. I know gsem allows me to run ordered logit models for the effect of personality on these ordered categorical mediators. However, does the command treat them as continuous when mortality is the outcome and they are independent variables? Is it possible to include them as dummy variables when they are acting as independent variables?

    Thanks,
    Rose

  • #2
    Welcome to the Stata Forum / Statalist,

    Please take a look at the examples with gsem.

    That said, the use of, say, logit, mlogit, etc. relates to the observed variables.

    What is more, under a single gsem command, you can select a Gaussian identity approach for the continuous variables, a Bernoulli logit for the binary ones, etc.

    Hopefully that helps.
    Best regards,

    Marcos

    Comment


    • #3
      Originally posted by Rose Atkins View Post
      Hi,

      I want to run a mediation analysis looking at the direct and indirect effect of adolescent personality (three separate but related measures of personality) on all-cause mortality in adulthood. I have a range of mediators I want to include, most of which are continuous variables. However, I have several ordered categorical mediators, including highest qualification and self-reported health. I know gsem allows me to run ordered logit models for the effect of personality on these ordered categorical mediators. However, does the command treat them as continuous when mortality is the outcome and they are independent variables? Is it possible to include them as dummy variables when they are acting as independent variables?

      Thanks,
      Rose
      Just to clarify a bit what Marcos said: the model type relates to your dependent variable. If your dependent variable were some ordinal item, like a question on self-rated health, you use ordered logit. If the DV were continuous, you use regression. In your case, I would suppose this is either a survival model or a logistic model.

      For independent variables, if they're categorical, you prefix them with i. Type help fvvarlist for more info about Stata's factor variable syntax. If you omit that prefix, then the variable in question does get treated as continuous!

      Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

      When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

      Comment

      Working...
      X