Announcement

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

  • Geonear with panel data

    Hi Statlists,

    Please, could anyone help me?

    I have data with stations for temperature. There are 163 stations. There are measures per month from 2007-2017, however not all stations have the complete time series. Some stations started to collect data after 2007 and others stopped to collect before 2017. Some stations have the complete time series.
    I have another data set with 800 counties. Some counties have more than one station and not all counties have stations.
    I am trying to use geonear to calculate the 3 closest stations from each county. Then, I will calculate the average of temperature based on the distance from these three closest stations.

    I am trying to do the geonear and merge but it is messy since not all stations have data for all months and years.
    I have tried dropping the duplicates stations (i.e., eliminate the panel data) and doing geonear. And have also tried doing geonear with the repeated time series.
    Please, does anyone know how to code this in Stata?

    Thank you!

  • #2
    geonear is from SSC, as you are asked to explain (FAQ Advice #12). You will want to have the coordinates and name of each station in one dataset using something like

    Code:
    contract station latitude longitude
    then proceed as https://www.statalist.org/forums/for...-with-nearstat. Finally, merge one to many station with your panel datasets.

    Comment


    • #3
      Thank you very much!

      Comment

      Working...
      X