Hi everyone,
I have a dataset of 2304 observation.
In order to proceed with my analysis I have to fill the missing observations in the dataset. They consist in prices of different commodities.
I tried this command
but this is not exactly what I want, since I am asking STATA to estimate the price if the commodity is "mycommodity".
I want to fill the missing price for the different commodities, taking into account their specific trend, and I don't know how to.
Thank you
I have a dataset of 2304 observation.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str39 market str46 commodity float price int year "Alto Molócuè" "Maize (white)" 6.8571 2014 "Alto Molócuè" "Maize (white)" 20.5714 2016 "Alto Molócuè" "Maize meal (white with bran) " . 2014 "Alto Molócuè" "Maize meal (white with bran) " 18.5 2016 "Alto Molócuè" "Groundnuts (small shelled) " 43.75 2015 "Alto Molócuè" "Maize meal (white with bran) " . 2016 "Alto Molócuè" "Sugar (brown local) " . 2015 "Alto Molócuè" "Groundnuts (large shelled) " . 2015 "Alto Molócuè" "Oil (vegetable local) " 75 2014 "Alto Molócuè" "Groundnuts (large shelled) " 130 2016 "Alto Molócuè" "Maize (white)" 9.1429 2014 "Alto Molócuè" "Oil (vegetable local) " 82.5 2016 "Alto Molócuè" "Groundnuts (large shelled) " 20 2015 "Alto Molócuè" "Oil (vegetable local) " 150 2016 "Alto Molócuè" "Cowpeas" 35 2014 "Alto Molócuè" "Groundnuts (large shelled) " 30 2014 "Alto Molócuè" "Sugar (brown local) " 35.3333 2014 "Alto Molócuè" "Maize (white)" 28.5714 2016 "Alto Molócuè" "Cowpeas" 18.6667 2015 "Alto Molócuè" "Maize meal (white with bran) " 35 2016 "Alto Molócuè" "Oil (vegetable local) " 50 2014 "Alto Molócuè" "Groundnuts (small shelled) " 25 2014 "Alto Molócuè" "Rice (imported)" 25 2014 "Alto Molócuè" "Maize (white)" 10.2857 2015 "Alto Molócuè" "Rice (imported)" 26.6667 2015 "Alto Molócuè" "Oil (vegetable local) " 130 2016 "Alto Molócuè" "Maize meal (white with bran) " . 2014 "Alto Molócuè" "Maize (white)" . 2016 "Alto Molócuè" "Oil (vegetable local) " 50 2015 "Alto Molócuè" "Maize meal (white with bran) " . 2016 "Alto Molócuè" "Maize (white)" 10 2014 "Alto Molócuè" "Groundnuts (large shelled) " 41.6667 2014 "Alto Molócuè" "Cowpeas" . 2016 "Alto Molócuè" "Rice (imported)" 25 2014 "Alto Molócuè" "Cowpeas" 30 2016 "Alto Molócuè" "Rice (imported)" 25 2014 "Alto Molócuè" "Groundnuts (small shelled) " 40 2014 "Alto Molócuè" "Maize meal (white with bran) " 12.25 2015 "Alto Molócuè" "Oil (vegetable local) " 80 2015 "Alto Molócuè" "Maize meal (white with bran) " 35 2016 "Alto Molócuè" "Oil (vegetable local) " 50.5 2014 "Alto Molócuè" "Rice (imported)" 32.5 2016 "Alto Molócuè" "Groundnuts (large shelled) " 100 2016 "Alto Molócuè" "Sugar (brown local) " 70 2016 "Alto Molócuè" "Maize (white)" 22.8571 2016 "Alto Molócuè" "Groundnuts (small shelled) " 41.25 2015 "Alto Molócuè" "Cowpeas" 17 2015 "Alto Molócuè" "Sugar (brown local) " . 2015 "Alto Molócuè" "Rice (imported)" 40 2016 "Alto Molócuè" "Groundnuts (large shelled) " 120 2016 "Alto Molócuè" "Oil (vegetable local) " 70 2014 "Alto Molócuè" "Rice (imported)" 25 2014 "Alto Molócuè" "Maize (white)" 8 2014 "Alto Molócuè" "Cowpeas" . 2015 "Alto Molócuè" "Oil (vegetable local) " 70 2014 "Alto Molócuè" "Sugar (brown local) " 35 2014 "Alto Molócuè" "Maize (white)" 20.5714 2016 "Alto Molócuè" "Rice (imported)" 45 2016 "Alto Molócuè" "Groundnuts (large shelled) " . 2015 "Alto Molócuè" "Maize meal (white with bran) " 24 2016 "Alto Molócuè" "Groundnuts (large shelled) " 130 2016 "Alto Molócuè" "Groundnuts (large shelled) " 20 2014 "Alto Molócuè" "Cowpeas" 20 2015 "Alto Molócuè" "Groundnuts (small shelled) " 35 2014 "Alto Molócuè" "Sugar (brown local) " 45 2015 "Alto Molócuè" "Groundnuts (large shelled) " 31 2015 "Alto Molócuè" "Cowpeas" 37.5 2016 "Alto Molócuè" "Sugar (brown local) " . 2015 "Alto Molócuè" "Oil (vegetable local) " 73 2014 "Alto Molócuè" "Groundnuts (small shelled) " . 2016 "Alto Molócuè" "Cowpeas" 32.5 2016 "Alto Molócuè" "Oil (vegetable local) " . 2015 "Alto Molócuè" "Rice (imported)" 26.5 2015 "Alto Molócuè" "Maize meal (white with bran) " 15 2015 "Alto Molócuè" "Rice (imported)" 27.3333 2014 "Alto Molócuè" "Groundnuts (large shelled) " 20 2014 "Alto Molócuè" "Rice (imported)" 25.25 2015 "Alto Molócuè" "Oil (vegetable local) " 50 2014 "Alto Molócuè" "Cowpeas" 30 2016 "Alto Molócuè" "Maize meal (white with bran) " 11.2 2015 "Alto Molócuè" "Maize meal (white with bran) " 14 2015 "Alto Molócuè" "Maize meal (white with bran) " . 2014 "Alto Molócuè" "Oil (vegetable local) " 75 2015 "Alto Molócuè" "Groundnuts (large shelled) " 90 2016 "Alto Molócuè" "Sugar (brown local) " 45 2015 "Alto Molócuè" "Groundnuts (large shelled) " 32.5 2015 "Alto Molócuè" "Oil (vegetable local) " 50 2014 "Alto Molócuè" "Maize meal (white with bran) " . 2014 "Alto Molócuè" "Cowpeas" 15 2015 "Alto Molócuè" "Sugar (brown local) " 38 2014 "Alto Molócuè" "Sugar (brown local) " 35 2014 "Alto Molócuè" "Maize (white)" . 2016 "Alto Molócuè" "Groundnuts (small shelled) " 43 2015 "Alto Molócuè" "Maize meal (white with bran) " 12 2015 "Alto Molócuè" "Groundnuts (small shelled) " 41 2014 "Alto Molócuè" "Rice (imported)" 51.3333 2016 "Alto Molócuè" "Maize meal (white with bran) " 15 2015 "Alto Molócuè" "Oil (vegetable local) " 75 2014 "Alto Molócuè" "Rice (imported)" 25 2014 "Alto Molócuè" "Groundnuts (small shelled) " 50 2014 end
I tried this command
Code:
ipolate price year if commodity=="Cowpeas", generate(cowpeas_price)
I want to fill the missing price for the different commodities, taking into account their specific trend, and I don't know how to.
Thank you
Comment