Announcement

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

  • Imputation not using all obs

    Hi, I am using stata v18 on mac OS Ventura 13.4.1

    I am using a dataset with a total of 8410 observations, when I check missing data I get the following results:
    Code:
    misstable summarize agew4 sex ethnicity notmarried adl wealth education mmw5 ssupport4
    Variable | Obs=. Obs>. Obs<.
    -------------+--------------------------------+----
    ssupport6 | 3,780 4,630
    adl | 673 7,737
    wealth | 208 8,202
    education | 171 8,239
    --------------------------------------------------

    I run the imputations using the following code and the result returns the model results but with only 7297 observations. What is the reason for this please?

    Code:
    global modelb agew4 i.sex i.ethnicity
    global modelc $modelb i.education i.wealth i.notmarried i.adl
    
    mi set mlong
    mi register regular sex agew4 ethnicity notmarried mmw5
    mi register imputed ssupport4 education wealth adl
    mi impute chained (regress) ssupport4 (logit, augment) adl (ologit, augment) wealth education = mmw5 sex agew4 ethnicity notmarried, add(45) rseed(54321)
    
    mi estimate, post: nbreg mmw5 ssupport4 $modelc [pweight=w4scwt], irr
    Thank you

  • #2
    I have used:
    Code:
    mi estimate, esample(check): nbreg mmw5 ssupport4 $modelc [pweight=w4scwt]
    looking at this check variable I can identify participants where the imputations/observation isn't being used – some with fully observed data and some without, I can't seem to find a pattern for why they would be excluded? are there any known problems or explanations?

    Comment


    • #3
      Here is an example of the imputation for one participant who is excluded from the mi estimate:
      age ethnicity exp outcome wealth education sex spouse limitation _mi_m esample check
      84 1.white . 3 1 NVQ1/CSE other grade equiv male 0 . 0 0
      84 1.white 1.693354 3 1 NVQ1/CSE other grade equiv male 0 none 1 0
      84 1.white 1.976703 3 1 NVQ1/CSE other grade equiv male 0 none 2 0
      84 1.white 1.389476 3 1 NVQ1/CSE other grade equiv male 0 1+ 3 0
      84 1.white 2.325524 3 1 NVQ1/CSE other grade equiv male 0 none 4 0
      84 1.white 1.723726 3 1 NVQ1/CSE other grade equiv male 0 none 5 0
      84 1.white 1.579414 3 1 NVQ1/CSE other grade equiv male 0 none 6 0
      84 1.white 1.26626 3 1 NVQ1/CSE other grade equiv male 0 none 7 0
      84 1.white 2.209294 3 1 NVQ1/CSE other grade equiv male 0 none 8 0
      84 1.white 1.510552 3 1 NVQ1/CSE other grade equiv male 0 1+ 9 0
      84 1.white 1.900252 3 1 NVQ1/CSE other grade equiv male 0 none 10 0
      84 1.white 2.055556 3 1 NVQ1/CSE other grade equiv male 0 none 11 0
      84 1.white 1.226345 3 1 NVQ1/CSE other grade equiv male 0 1+ 12 0
      84 1.white 1.704704 3 1 NVQ1/CSE other grade equiv male 0 none 13 0
      84 1.white 1.754613 3 1 NVQ1/CSE other grade equiv male 0 1+ 14 0
      84 1.white 1.66927 3 1 NVQ1/CSE other grade equiv male 0 none 15 0
      84 1.white 1.270409 3 1 NVQ1/CSE other grade equiv male 0 none 16 0
      84 1.white 2.162107 3 1 NVQ1/CSE other grade equiv male 0 none 17 0
      84 1.white 1.880571 3 1 NVQ1/CSE other grade equiv male 0 none 18 0
      84 1.white 1.348033 3 1 NVQ1/CSE other grade equiv male 0 none 19 0
      84 1.white 0.7318558 3 1 NVQ1/CSE other grade equiv male 0 none 20 0
      Last edited by Robyn Jones; 16 Aug 2023, 05:00.

      Comment


      • #4
        We need to see more complete output -- wrapped inside CODE delimiters, please. It is nearly impossible to read the tables as posted now. In particular, we need to see the complete output of

        Code:
        misstable summarize
        before imputation for all variables used in either the imputation or the analyses model. That includes the weights (which should probably be in the imputation model, too).

        We also need to see the output (including any notes) from

        Code:
        mi impute
        and (at least the header of) the results table from

        Code:
        mi estimate

        Edit:

        By the way, please show us the code that you have really used! Some of the variable names in #3 do not appear in any of the code shown in #1. Also, the esample() option of mi estimate requires flong or flongsep style; according to #1 you used mlong. You are wasting our time and yours if you do not show us what you have typed, exactly, and what Stata did in response, exactly.
        Last edited by daniel klein; 16 Aug 2023, 06:29.

        Comment


        • #5
          Hi Daniel,

          I have identified the issue now but thanks for the advice on how to post! Sorry that it is not formatted correctly and unreadable – I am constantly working on trying to figure it out myself so there are things that had changed which I forgot to mention.

          Thanks again!

          Comment


          • #6
            Originally posted by Robyn Jones View Post
            I have identified the issue now
            Then please tell us more as others may find themselves in a similar situation and will benefit from your work.

            Comment

            Working...
            X