Announcement

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

  • #16
    Akwa Amps

    Did you finally manage to come up wth the syntax? If so can you share

    Gowokani

    Comment


    • #17
      Originally posted by Diana Abdwahab View Post
      If I understand it well, you need to create a pseudo panel data set from two sets of cross sectional data sets. It's understood that in both cross sectional data sets the observations are different individuals, and you need to create cohorts of individuals based on birth year and sex. Say you have variables x1 x2 x3, so the suggested codes is:

      Code:
      use data.dta, clear
      collapse x1 x2 x3 if sex==0, by(birth_year)
      save col1.dta, replace
      use data.dta, clear
      collapse x1 x2 x3 if sex==1, by(birth_year)
      save col2.dta, replace
      append using col1.dta
      gen ID=_n
      save pseudo.dta, replace
      Now you have a pseudo panel data set where each observation (ID) is a cohort sharing the same sex and birth year. The total number of observation is now N(birth_year)*N(sex).
      What variables should we xtset now?

      Comment


      • #18
        Hi, everyone,

        I need to create a pseudo panel data set from varios sets of cross sectional households data sets in Brazil. I want to create cohorts of households according with the states of Brazil. So, my dependent variable is a binary variable, the use or not of firewood or coal for cooking. I want to create cohorts preserving the dependent variable as binary. What is the way to do it?

        Comment

        Working...
        X