Announcement

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

  • Multiple Imputation

    I have a problem running a panel regression. I have data for n=1019 observations and want to carry out a regression analyses with 15 variables. But due to a lot of missing values for some observations and variables, Stata carries out the regression with only n=347 observations. Therefore, I'd like to use multiple imputation with the regression method for missing data but am not quite sure how to implement it.

    After specifying my dataset I used the commands

    HTML Code:
     mi set mlong
    HTML Code:
    mi register var1 var2 var3 ...
    HTML Code:
     mi impute chained (logit) var1 (logit) var2 (regress) var3 ... , add(15)
    But after the last command, Stata shows a lengthy error message:

    mi impute logit: perfect predictor(s) detected
    Variables that perfectly predict an outcome were detected when logit executed on the observed data. First, specify mi impute's option
    noisily to identify the problem covariates. Then either remove perfect predictors from the model or specify mi impute logit's option
    augment to perform augmented regression; see The issue of perfect prediction during imputation of categorical data in [MI] mi impute
    for details.
    error occurred during imputation of var1 var2 var3 ... on m = 1
    r(498);
    What do I do wrong?

    Best,
    Jules
    Last edited by Jules Herz; 05 Dec 2023, 08:44.

  • #2
    You did not specify

    Code:
    mi impute chained var1 var2 var3 ... , add(15)
    because this is invalid syntax. You did include (logit) somewhere. In this case, this is (probably) not key to giving advice but generally, you are supposed to show what you have typed, exactly.

    Did you read the very informative error message? Or the pdf-manual entry to which it links? It tells you what your options are. I recommend reading the respective material as it will provide you with deeper insight into the issue than a quick answer on Statalist would typically do.

    Comment


    • #3
      daniel klein: thanks for pointing out my mistake in reporting the (stylized) code. I included (logit) or (regress) in front of every variable in the impute statement and changed it accordingly in the code above.

      I read the error message but did not understand it properly and the manual was not a big help either.

      Comment


      • #4
        not a clearly written question, but I think you want the "augment" option (here I am assuming that you are using "mi impute chained" or "mi impute logit" - if you are not please show the EXACT command you are using)

        Comment


        • #5
          I implemented the "augment" option, but now Stata says

          convergence not achieved
          logit failed to converge on observed data
          error occurred during imputation of Static Specific CrossBorder Electricity Capacity Budget Volume Financial Material Ceiling CP_Level
          FavTreatment PaB SlidingFIP FixedFIP SupDuration BidCapacity AwPrice AdjAwPrice AwCapacity Penalty on m = 1
          r(430);

          Comment


          • #6
            without more info, please read the FAQ and follow its advice, I can not help further but maybe someone else can

            Comment


            • #7
              From a technical point of view, add the option noisily and inspect the model that does not converge. Look for large or missing standard errors and possibly remove the offending predictor from the respective equation. We cannot give substantial advice on building models without further detail; and, even with more detail, this does not seem like my field of expertise.

              Comment


              • #8
                I added the noisily option and it ran several iterations which seemed to work but in the end Stata showed me this:

                Click image for larger version

Name:	2.png
Views:	1
Size:	36.4 KB
ID:	1736255
                Click image for larger version

Name:	1.png
Views:	1
Size:	83.7 KB
ID:	1736254

                Comment

                Working...
                X