Announcement

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

  • Missing Values for two Variables: stata

    Hi Everyone,

    I hope you are well.

    I am running panel data for 12 countries over a 13 year time period. I have % control variables but within two of them (Edu and Health).
    I have missing values. I don't want to drop these control variables, How do I fill the missing values?

    I have provided the data for the two variables just in case its important to see it. It is currently in percentage

    Thank you in advance for your time and help!
    A year Health Edu
    Botswana 1991
    Botswana 1992 31.11832
    Botswana 1993 39.76681
    Botswana 1994 6
    Botswana 1995 14.2 62.46729
    Botswana 1996 22.2 73.51929
    Botswana 1997 25.8
    Botswana 1998 25.7 78.52549
    Botswana 1999 24.6 0
    Botswana 2000 23.9 -78.5255
    Botswana 2001 23.5
    Botswana 2002 23.3 82.76215
    Botswana 2003 23.1 17.64272
    Cameroon 1991 20.20845
    Cameroon 1992 23.81009
    Cameroon 1993 25.45207
    Cameroon 1994 2
    Cameroon 1995 3.5
    Cameroon 1996 4.7 25.94187
    Cameroon 1997 5.3 27.88825
    Cameroon 1998 5.4 26.64419
    Cameroon 1999 5.2 35.94419
    Cameroon 2000 4.9
    Cameroon 2001 4.8 47.26565
    Cameroon 2002 4.8 50.46743
    Cameroon 2003 4.7 19.35992
    Cote d'Ivoire 1991 18.72056
    Cote d'Ivoire 1992 18.4261
    Cote d'Ivoire 1993
    Cote d'Ivoire 1994 3
    Cote d'Ivoire 1995 4.3
    Cote d'Ivoire 1996 5.4 24.28939
    Cote d'Ivoire 1997 5.7
    Cote d'Ivoire 1998 5.3
    Cote d'Ivoire 1999 4.6
    Cote d'Ivoire 2000 4.1
    Cote d'Ivoire 2001 3.8
    Cote d'Ivoire 2002 3.7
    Cote d'Ivoire 2003 3.6 39.88876
    Ghana 1991 38.99115
    Ghana 1992 37.37887
    Ghana 1993 35.94744
    Ghana 1994 1.5
    Ghana 1995 2.2
    Ghana 1996 2.7 40.73941
    Ghana 1997 2.9 41.02408
    Ghana 1998 2.7 47.34028
    Ghana 1999 2.4 55.77963
    Ghana 2000 2.1
    Ghana 2001 1.9 57.08299
    Ghana 2002 1.9 58.13869
    Ghana 2003 1.8 29.32197
    Kenya 1991 31.97818
    Kenya 1992 41.12302
    Kenya 1993
    Kenya 1994 6.4
    Kenya 1995 10.9
    Kenya 1996 12.8 38.52061
    Kenya 1997 11.6 40.99545
    Kenya 1998 9 47.8988
    Kenya 1999 7 59.40621
    Kenya 2000 6.2
    Kenya 2001 6.1
    Kenya 2002 6 67.64039
    Kenya 2003 6
    Madagascar 1991 34.07448
    Madagascar 1992
    Madagascar 1993 18.26771
    Madagascar 1994 0.1
    Madagascar 1995 0.1
    Madagascar 1996 0.3
    Madagascar 1997 0.5
    Madagascar 1998 0.6 21.14828
    Madagascar 1999 0.5 29.04219
    Madagascar 2000 0.4
    Madagascar 2001 0.4 36.59524
    Madagascar 2002 0.3 38.02759
    Madagascar 2003 0.3 15.99282
    Malawi 1991 17.13872
    Malawi 1992 16.71433
    Malawi 1993 16.09533
    Malawi 1994 8.8 18.06774
    Malawi 1995 13.3 24.65532
    Malawi 1996 16 36.01715
    Malawi 1997 16.7 29.89747
    Malawi 1998 15.8 27.28505
    Malawi 1999 13.9 31.21402
    Malawi 2000 12.1 33.05596
    Malawi 2001 11.2 34.18793
    Malawi 2002 10.8 34.44938
    Malawi 2003 10.3 48.15252
    Mauritius 1991 45.38366
    Mauritius 1992 45.59499
    Mauritius 1993 52.40914
    Mauritius 1994 0.1
    Mauritius 1995 0.1 66.75667
    Mauritius 1996 0.4 74.98109
    Mauritius 1997 0.9 81.02567
    Mauritius 1998 1.1 88.65556
    Mauritius 1999 1.2 88.13017
    Mauritius 2000 1.2 89.24696
    Mauritius 2001 1.1 90.41113
    Mauritius 2002 1 91.84192
    Mauritius 2003 1 4.48537
    Niger 1991 4.87009
    Niger 1992
    Niger 1993 6.24449
    Niger 1994 0.2 6.41819
    Niger 1995 0.5 6.52356
    Niger 1996 0.9 7.03912
    Niger 1997 1.2 6.862
    Niger 1998 1.2 9.90822
    Niger 1999 1.1 11.27569
    Niger 2000 0.8 13.51845
    Niger 2001 0.7 14.35081
    Niger 2002 0.6 15.56878
    Niger 2003 0.6 17.00856
    Nigeria 1991 28.68492
    Nigeria 1992 27.07259
    Nigeria 1993 24.59582
    Nigeria 1994 1.4
    Nigeria 1995 2.2
    Nigeria 1996 3.2 23.41556
    Nigeria 1997 3.8 29.42101
    Nigeria 1998 4 34.69912
    Nigeria 1999 3.8 35.09796
    Nigeria 2000 3.6 43.83671
    Nigeria 2001 3.5
    Nigeria 2002 3.4
    Nigeria 2003 3.3
    South Africa 1991
    South Africa 1992
    South Africa 1993 66.07011
    South Africa 1994 1
    South Africa 1995 3.9
    South Africa 1996 10.3 90.76656
    South Africa 1997 17.1 87.15127
    South Africa 1998 20.6 88.91318
    South Africa 1999 20.8 89.49576
    South Africa 2000 19.5 90.25352
    South Africa 2001 18.9 91.05531
    South Africa 2002 18.8 91.95773
    South Africa 2003 18.8
    Swaziland 1991
    Swaziland 1992
    Swaziland 1993
    Swaziland 1994 2.2 46.67545
    Swaziland 1995 9.4 47.33687
    Swaziland 1996 18.5 44.48612
    Swaziland 1997 24 42.11219
    Swaziland 1998 25.6 46.62029
    Swaziland 1999 25.7
    Swaziland 2000 26.4 57.97358
    Swaziland 2001 27.2 59.91126
    Swaziland 2002 27.6 60.67129
    Swaziland 2003 28

  • #2
    Bezi:
    - you can consider using -ipolate-;
    -you may want to let things as they are and end up with an unbalanced panel dataset (that Stata can handle without any problem);
    - you may wnat to consider -mi-.

    All the usual remarks about missingness mechanisms (i.e.: is the missingness informative or not) apply.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      See also http://www.statalist.org/forums/foru...-interpolation

      Comment


      • #4
        Originally posted by Nick Cox View Post
        Nick, thank you for the link.

        I just have one more question. Do i go about using mipolate as specified in the link below:
        http://www.statalist.org/forums/foru...tions-in-panel

        using the following command
        ipolate Edu year, gen (Edu1)?

        I have used the above command and I do get new figures but stata also changes existing figure

        mipolate Edu year, gen (Edu1) (Apologies I don't know how to copy the table directly from Stata yet) I had to move it to excel first.
        Edu Edu1
        20.28768 23.57115
        24.83205 26.48823
        31.11832 30.15479
        39.76681 31.64988
        51.41528 30.64417
        36.31811
        73.51929 43.61056
        75.65077 46.20282
        78.52549 47.05804
        48.3762
        54.64753
        53.85754
        82.76215 59.15254
        17.64272 23.57115
        20.20845 26.48823
        23.81009 30.15479
        25.45207 31.64988
        30.64417
        36.31811
        25.94187 43.61056
        27.88825 46.20282
        26.64419 47.05804
        35.94419 48.3762
        54.64753
        47.26565 53.85754
        50.46743 59.15254
        19.35992 23.57115
        18.72056 26.48823
        18.4261 30.15479
        31.64988
        30.64417
        36.31811
        24.28939 43.61056
        46.20282
        47.05804
        48.3762
        54.64753
        53.85754
        59.15254
        39.88876 23.57115
        38.99115 26.48823
        37.37887 30.15479
        35.94744 31.64988
        30.64417
        36.31811
        40.73941 43.61056
        41.02408 46.20282
        47.34028 47.05804
        55.77963 48.3762
        54.64753
        57.08299 53.85754
        58.13869 59.15254
        29.32197 23.57115
        31.97818 26.48823
        41.12302 30.15479
        31.64988
        30.64417
        36.31811
        38.52061 43.61056
        40.99545 46.20282
        47.8988 47.05804
        59.40621 48.3762
        54.64753
        53.85754
        67.64039 59.15254
        23.57115
        34.07448 26.48823
        30.15479
        18.26771 31.64988
        30.64417
        36.31811
        43.61056
        46.20282
        21.14828 47.05804
        29.04219 48.3762
        54.64753
        36.59524 53.85754
        38.02759 59.15254
        15.99282 23.57115
        17.13872 26.48823
        16.71433 30.15479
        16.09533 31.64988
        18.06774 30.64417
        24.65532 36.31811
        36.01715 43.61056
        29.89747 46.20282
        27.28505 47.05804
        31.21402 48.3762
        33.05596 54.64753
        34.18793 53.85754
        34.44938 59.15254
        48.15252 23.57115
        45.38366 26.48823
        45.59499 30.15479
        52.40914 31.64988
        30.64417
        66.75667 36.31811
        74.98109 43.61056
        81.02567 46.20282
        88.65556 47.05804
        88.13017 48.3762
        89.24696 54.64753
        90.41113 53.85754
        91.84192 59.15254
        4.48537 23.57115
        4.87009 26.48823
        30.15479
        6.24449 31.64988
        6.41819 30.64417
        6.52356 36.31811
        7.03912 43.61056
        6.862 46.20282
        9.90822 47.05804
        11.27569 48.3762
        13.51845 54.64753
        14.35081 53.85754
        15.56878 59.15254
        17.00856 23.57115
        28.68492 26.48823
        27.07259 30.15479
        24.59582 31.64988
        30.64417
        36.31811
        23.41556 43.61056
        29.42101 46.20282
        34.69912 47.05804
        35.09796 48.3762
        43.83671 54.64753
        53.85754
        59.15254
        23.57115
        26.48823
        30.15479
        66.07011 31.64988
        30.64417
        36.31811
        90.76656 43.61056
        87.15127 46.20282
        88.91318 47.05804
        89.49576 48.3762
        90.25352 54.64753
        91.05531 53.85754
        91.95773 59.15254
        23.57115
        26.48823
        30.15479
        31.64988
        46.67545 30.64417
        47.33687 36.31811
        44.48612 43.61056
        42.11219 46.20282
        46.62029 47.05804
        48.3762
        57.97358 54.64753
        59.91126 53.85754
        60.67129 59.15254

        Comment


        • #5
          Originally posted by Carlo Lazzaro View Post
          Bezi:
          - you can consider using -ipolate-;
          -you may want to let things as they are and end up with an unbalanced panel dataset (that Stata can handle without any problem);
          - you may wnat to consider -mi-.

          All the usual remarks about missingness mechanisms (i.e.: is the missingness informative or not) apply.
          Dear Carlo,

          Thanks for your response. My worry is that if I let things as they are, my sample size might reduce once I apply first differences no?
          Also I was unable to perform a unit root test on the variables with missing values.

          Comment


          • #6
            Bezi:
            you're right as far as the first point is concerned (you are probably right about the second one, too, but I'm not familiar with Sir Clyve Granger's machinery).
            Can't say whether in your case sample shrinkage is a limited or unaffordable damage (it boils down to how many observations will be listwise deleted letting things as they are).
            Kind regards,
            Carlo
            (Stata 18.0 SE)

            Comment


            • #7
              Nick and Carlo, thank you. for your help, I figured out my error and corrected it. Thank you both!

              Comment

              Working...
              X