Announcement

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

  • varlist not allowed

    Using the code below, I am trying to ask Stata to use weight variables in 1998 for each id (hhidpn) and constantly use them over the years after 1998 as weight variables. The code returns an error: varlist not allowed.


    foreach v of varlist raehsamp rwtcrnh rwtresp raestrat {
    by hhidpn , sort: egen `v'_base = max(cond(year== 1998))}
    Last edited by Nader Mehri; 25 Jan 2023, 20:48.

  • #2
    You are employing incorrect syntax for the cond() function. See the help file
    help f_cond

    Comment

    Working...
    X