Announcement

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

  • gsem: how to include error terms to a multinomial logit model

    Dear Statalisters,

    I am attempting to fit a generalised linear structure equation using panel data, with y as categorical response.

    I wanted to constrain the error term in the structural equation to 0, as following
    var(e.y@0)

    Stata returns the message that "invalid covariance specification; e.y does not identify an error for an uncensored gaussian response with the identity link"

    Does gsem include an error term by default please? Sem estimates error terms. I read the manual and couldn't find out whether gsem estimates error terms by default. Shall I include a latent variable as the disturbance please?

    Thank you very much for your very kind help!!!

    Boshuo
    PhD student, Imperial College London

  • #2
    Boshuo,

    I'm not a true SEM expert. But I am fairly sure that error terms are limited to linear SEMs.

    Consider this. In OLS regression, we assume that y = XB + e, where e is a random error term, and XB (a vector of Xs and betas) is the deterministic part of the equation. e is what makes it random.

    In logistic regression, we have logit(p) = XB. There is no error term, because probability is inherently random. A similar concept would apply to any ordered or unordered version of logistic regression.

    I am totally unfamiliar with why you would constrain the variance of the error term in OLS or linear SEM to be 0. If you can explain what you're trying to accomplish by doing so, I can try my best to tell you if there is a parallel concept in gsem with what I assume to be a multinomial logistic regression in gsem. It would also help if you at least show the full command you are trying to run in code delimiters (see my signature for details).
    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


    • #3
      Dear Weiwen,

      Thank you very much for your very kind, timely reply.

      I included an predetermined x variable in the equation and want this predetermined x to correlate with a prior error et-1.

      I included a latent variable E and correlate this Et-1 with x. I don't know how to constrain the equation error term to 0, as Allison Williams MoralBenito (2017) did. The semexample34g stated that "because neither generalized linear response has an error that could be correlated and so the only way to correlate these two responses in gsem is to add a shared latent variable affecting each"

      Is the multinomial logistic regression by default without error term please? Shall I include the E latent variable and do not have to worry about the non-existing error please?

      Your very kind help is appreciated very much.

      Boshuo

      Comment


      • #4
        Richard Williams

        Boshuo, it's best practice to give full sources. That said, I think you are referring to this paper: Allison, Williams, and Moral-Benito (2017) Maximum Likelihood for Cross-lagged Panel Models with Fixed Effects, Socius.

        That paper does refer specifically to linear, cross-lagged panel models. In logistic models or relatives of those models, there are no error terms for the reasons I explained above. I don't know how you would indicate a parallel concept to the error term in a multinomial cross-lagged panel model.

        I am tagging Rich Williams (one of the authors in the cited paper) because I am well and truly out of my depth.
        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


        • #5
          Sorry for not following this thread more closely. I have been of the country this past week.

          As far as xtdpdml, the latest Stata Journal has an article on it. A pre-publication copy (and other materials) can be found at

          https://www3.nd.edu/~rwilliam/dynamic/index.html

          We have been trying to adapt xtdpdml so it works with logit and other link functions. I think we come close but not quite. I think part of the trick is that, instead of using things like correlated error terms, you use direct paths instead. But I don't think it is working right yet. If I ever feel comfortable with it I will release it.

          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment


          • #6
            Dear Weiwen and Professor Williams,

            Thank you both very much for your very kind help!!!

            I sincerely apologise for the very delayed thanks because of the coming up of thesis hand-in date.

            The very kind help from both of you is appreciated very much!!

            Best regards
            Yours sincerely
            Boshuo

            Comment

            Working...
            X