Announcement

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

  • Creating a Group Variable

    I want to create groups for propensity score matching. If I want to classify the data into different age groups, I can create a new variable with all zeroes and give the values I want to each age group using replace. But is there a way to use egen along with group to do that?

    I tried egen age_1 = group(age>=17 & age<=20) but this seems to be incorrect.
    Last edited by Chirag Yadav; 04 Feb 2022, 18:41.

  • #2
    Welcome to Statalist.

    You have accidentally posted your topic in Statalist's Mata Forum, which is used for discussions of Stata's Mata language, which is different than Stata's command language. Your question will see a more appropriate and much larger audience if you re-post it in Statalist's General Forum.

    Also, if you have not already done so, take a look at the Statalist FAQ linked to at the top of this page for posting guidelines and suggestions.

    Comment

    Working...
    X