Displaying 1 result from an estimated 1 matches for "notreat".
Did you mean:
nocreat
2009 Mar 23
2
Efficiently create dummy
What's the neat way to create a dummy from a list?
The code below is not replicable, but hopefully self-explanatory...
d$treatment<-rep(1,length(d))
notreat<-c("AR", "DE", "MS", "NY", "TN", "AK", "LA", "MD", "NC", "OK", "UT", "VA")
#i would really like this to work:
d$treatment[d$st==any(notreat)]<-0
#but instead i resort to...