Dear Statalist,
I have a variable State with storage type str3. I want to creat a dummy variable, 1 when State equals "CT", 0 for else. So I generate a new dummy as below:
gen New_England = 0
replace New_England = 1 if State == "CT"
But 0 real changes made.
I am confused which step is wrong. Forgive me that I may ask a silly easy question.. And thank you for your help!
Best regard
Lijuan
Related Posts with replace if with no real changes made
Using MarginsPlot to visualize Quadratics in Panel DataDear Statalist community, I need help with two things: One, I want to use the margins and marginsp…
Did I set up my panel data (with restrictions) correctly?Hi all, I would like to seek your advice regarding my analysis sample. Specifically, I have a three…
Reshaping a both long and wide dataset into only long formHi. I have medical prescription data ranging from 2007-2012 in the format below. The two identifying…
State by Year Fixed Effects and Annual State ControlsIn my econometric model the identifying variation is at the state, year, and factory level. When I i…
search if a value is present in tableHello all, How can I search if a particular value is present in a table. if the value is present in…
Subscribe to:
Post Comments (Atom)
0 Response to replace if with no real changes made
Post a Comment