Announcement

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

  • Combine the panel data with External Covariates.

    I have DHS data which have hhid(household id), BMI(Body Mass Index), and Year(2005, 2010, 2015. The first value of the hhid is the cluster number. I have another data in excel which have the values according to the cluster and the year.

    clear
    input str12 hhid float(bmi year)
    " 1 1" 15.968037 2015
    " 1 5" 15.353383 2015
    " 1 8" 15.81211 2015
    " 1 12" 14.74714 2015
    " 1 13" 13.963222 2015
    " 1 3" 14.712358 2010
    " 1 3" 15.86443 2010
    " 1 5" 14.367643 2010
    " 1 6" 12.80382 2010
    " 1 6" 15.79449 2010
    " 112724" 17.002277 2005
    " 148713" 16.550737 2005
    " 148713" 16.324196 2005
    " 150963" 14.09599 2005
    " 150963" 15.492178 2005

    end



    EXCEL DATA
    DHSCLUST Population_2005 Population_2010 Population_2015
    1 24671.02344 28366.08984 33122.26953
    2 3717.470947 4274.25 4990.918945
    3 16663.96484 19159.78516 22372.33203
    4 46965.32813 53999.48438 63053.64844
    5 87327.25 100406.5625 117241.8594

    So there are three years 2015, 2010, and 2005 and I have to combine the population values according to the year and according to the cluster. Please HELP me with this.


  • #2
    Looks to me like a reshape and m:1 merge problem. in that order.

    Comment

    Working...
    X