Announcement

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

  • Expanding observations by unique id and year

    I am using a cross-sectional time series dataset. Each panel is a country over time, with the country having a unique id (ccode) and values of the variable year. I want to expand the number of observations for each country each year by the value in the corresponding year of a third variable x. However, the expand command does not work with 'by' or 'bysort'. Is there another approach?

  • #2
    In a panel dataset, the combination of the panel identifier and the time variable uniquely identify an observation. So that implies that you need:

    Code:
    expand x

    Comment

    Working...
    X