Announcement

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

  • using MICE on panel data

    hello STATA. I have a panel data for 45 developed countries for 25 years. the countries are paired to make bilateral combination. my estimation model has 2 dependent variables as tradeflow_imf_o (continuous variable) and tradeflow_imf_d (continuous variable). my independent variables are disputes (categorical variable), outcome (factor variable), timeframe (factor variable) and rta (dummy variable). i have missing data for tradeflow_imf_o, tradeflow_imf_d and rta, although 85% of the dataset has completed data for these 3 variables. the missing pattern for these 3 variables by using
    Code:
    misstable pattern tradeflow_imf_dtradeflow_imf_o rta
    the result i get is


    Missing-value patterns
    (1 means complete)
    Pattern
    Percent 1 2 3
    87% 1 1 1
    10 1 1 0
    2 0 0 0
    <1 1 0 0
    <1 1 0 1
    <1 0 0 1
    <1 0 1 0
    100%
    Variables are (1) rta (2) tradeflow_imf_d (3) tradeflow_imf_o


    the pattern seems to be non-monotone, although i am not sure about it. plus, i am assuming the data to be MCAR.

    the MICE code i used is
    Code:
    mi set mlong
    mi xtset year
    mi register imputed tradeflow_imf_d tradeflow_imf_o rta
    mi register regular disputes outcome timeframe
    mi impute chained (regress) tradeflow_imf_d tradeflow_imf_o (logit) rta = disputes outcome timeframe, add(20) rseed(random_number)
    although after a successful code run, the results i get are undesired. the variables tradeflow_imf_d and tradeflow_imf_o impute very low negative values although their value should be above 0 and positive.

    please correct my code.

    thank you
    Last edited by Dr. Iqra Yaseen; 13 Sep 2022, 03:26.

  • #2
    first, you should review the following FAQ which might be relevant: https://www.stata.com/support/faqs/s...and-mi-impute/

    second, when you impute using regress you are specifically allowing for the chance that imputed data may be outside some range (in your case, <0); you might want to use method "pmm" instead - see the help file
    Code:
    help mi impute chained

    Comment


    • #3
      as per your advice Rich Goldstein, i edited my code to include
      Code:
      pmm
      . the modified code is

      Code:
       mi impute chained (pmm, knn(10)) tradeflow_imf_d tradeflow_imf_o (logit) rta = disputes outcome timeframe, add(20) rseed(6755)
      but the result i get is

      Code:
      Conditional models:
                     rta: logit rta tradeflow_imf_d tradeflow_imf_o disputes outcome timeframe
          tradeflow_im~d: pmm tradeflow_imf_d i.rta tradeflow_imf_o disputes outcome timeframe , knn(10)
          tradeflow_im~o: pmm tradeflow_imf_o i.rta tradeflow_imf_d disputes outcome timeframe , knn(10)
      
      Performing chained iterations ...
      convergence not achieved
      convergence not achieved
      logit failed to converge on observed data
      error occurred during imputation of tradeflow_imf_d tradeflow_imf_o rta on m = 1
      r(430);
      but when i exclude tradeflow_imf_d from MICE code, i get the desired results.

      what may be the possible cause of code crash after including tradeflow_imf_d.

      Comment


      • #4
        sorry, but I know nothing about your data - maybe someone else can help you

        Comment


        • #5
          thanks Rich Goldstein for at least replying. hope for someone to help me out.

          Comment

          Working...
          X