Announcement

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

  • Error return code 119

    Dear Statlist users,

    I am currently struggling with an unexpected error in Stata/MP 18.0. I use longitudinal data from the SHARE-project (https://share-eric.eu/).
    To explore my data analysis strategy I am looking into logistic regression models using the logit command and multilevel logistic regression models using the melogit command.

    Everything runs well with the logit-command. Switching to melogit, a null model (outcome variable, constant and random intercept variable) and models including continuous covariates run. However, when specifying a factor (categorical) covariate using a prefix (e.g. "i." or "b1.") Stata returns r(119):
    no; data are mi set
    Use mi fvset to set or query these data; mi fvset has the same syntax as fvset.

    Perhaps you did not type fvset. Some commands call fvset to obtain information about the
    settings. In that case, that command is not appropriate for running directly on mi data.
    Use mi extract to select the data on which you want to run the command, which is probably
    m=0.
    r(119);
    This is odd as I didn't use the mi set command. If I check with mi describe or try mi unset, Stata returns errors because it -logically- does not find the required _mi_ variables.
    It is also unclear to me why it errors only for melogit models with factor variables (and not logit).

    I went through all steps of my data management again and found out that the error already occurs after merging all different original SHARE datasets (9 waves of +- 10 separate questionnaire modules). Is it possible that the error results of one of the original merged datasets being mi set by accident?
    And is there a silver bullet to undo this in my final dataset or do I need to check all 90 original datasets one-by-one? As far as I am aware the orginial data sources do not include any _mi variables neither.

  • #2
    Read the SHARE data documentation very carefully. From a glance, it seems SHARE provides datasets with multiply imputed values. This might have serious implications not only for merging but also for running regular estimation commands.


    As for the error, note that melogit is not listed as a supported estimation command in mi estimate. It is hard to comment further because you do not show the exact syntax you used. Running a simple example, which I choose not to show here, I can get mi estimate with the cmdok option to run melogit using factor variable notation without any probls.
    Last edited by daniel klein; 27 Sep 2024, 05:15.

    Comment


    • #3
      Thanks Daniel for your reply. They indeed offer an imputed dataset for a selection of variables in each wave. But I do not use these. But maybe I need to have a digger deep if there is no other way of unsetting the muliple imputation.

      Comment


      • #4
        Well, if (and only if) you are sure your datasets do not contain multiple imputations, try

        Code:
        mi unset , asis

        Comment


        • #5
          As for the error, note that melogit is not listed as a supported estimation command in mi estimate. It is hard to comment further because you do not show the exact syntax you used. Running a simple example, which I choose not to show here, I can get mi estimate with the cmdok option to run melogit using factor variable notation without any probls.
          Thanks again Daniel. Do I understand it well that the cmdok surpresses the mi estimate then?

          These are the simple models I am trying:
          melogit dm_diagnosed || country:
          melogit dm_diagnosed age || country:
          These two run.

          The error is returned when including a categorical variable:
          melogit dm_diagnosed age i.gender || country:

          Comment


          • #6
            Originally posted by daniel klein View Post
            Well, if (and only if) you are sure your datasets do not contain multiple imputations, try

            Code:
            mi unset , asis
            This seems to work, thanks so much!

            Comment

            Working...
            X