Announcement

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

  • #16
    This is a better code. Some corrections can make it perfect. For example for cid 537452903 the value of treathome is zero, but the individual was in homeschool at grade 6.

    Comment


    • #17
      Simiarly, for cid 537453243 the individual was in public school from grades 8 to 11 (4 years), but the value of treat pub is 3 years only

      Comment


      • #18
        I guess we need to subtract 1 from q37_1 and q38_1,
        Code:
        bys cid (grade): gen x = grade>=q37_1-1 & grade<=q38_1-1
        
        bys cid (grade): egen treatpub = total(x & inlist(q7_,1,5))
        bys cid (grade): egen treatpriv = total(x & inlist(q7_,2,3,4))
        bys cid (grade): egen treathome = total(x & q7_==6)

        Comment


        • #19
          That solved one problem, but raised another one. For cid 537452953 treatpriv should be 9 years, but it shows 8 years.

          Comment

          Working...
          X