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
Show SD-within statistics from panel data via outreg2 descriptive tableDear Statalist, For my Masters I need to replicate a paper using Stata. I have managed to successfu…
Wilcoxon matched-pair sign-rank test -signrank- with a grouping variable ( by(groupvar) )Hi! I'm conducting a study in which I have 3 controls per case, matched on age, cancer stage and ca…
Cluster multiple dummy variablesHi everyone, In my dataset there is a categorical variable "nationality" that takes on 36 values, d…
Marginsplot for selected categoriessolved …
Probit with Panel DataHi Everyone, I am using two waves of panel data to assess the impact of socio-demographic character…
Subscribe to:
Post Comments (Atom)
0 Response to Directly modifying part of a date variable
Post a Comment