Dear Stata users,
I have a date variable formatted using %tmCCYYMon. However, I have identified a subset of observations for which years are wrong: they should be equal to 2018 instead of 2019. I can easily identify which observation is wrong by using a "flag" dummy.
Is there a way to directly modify the variable using -- replace date = .... if flag==1 --
This may sound like a simple question, but I cannot find an answer anywhere.
Thank you in advance,
Jack
Related Posts with Directly modifying part of a date variable
Cluster based on string similarityHey Community, I'm quite new to working with Stata and therefore desperately looking for help! I ha…
How to get the predicted value of each group?Dear all, I want get the predicted value of each regression of each group? Here is an example. Co…
Obtaining main results after jwdidHello, I have just started to use jwdid command, however, I cannot see the effect on main coefficien…
Dropping observations if entity does not exist in both wavesHi, I am new to Stata and trying to undertake a task for a stat class. I have a dataset containing…
Code help: Monte Carlo simulationI've attached a small Do file for a Monte Carlo Simulation I am running for an economics class. For …
Subscribe to:
Post Comments (Atom)
0 Response to Directly modifying part of a date variable
Post a Comment