Hi, I am trying to replace the value of one variable when the condition holds (the condition is that the survey_data (type double %td ) has to be equal to 04jul2020. When I try this: replace enumerator = 114 if survey_date == 04jul2020; I get the error 04jul2020 invalid name. when i try this: replace enumerator = 114 if survey_date == "04jul2020" , I get the error:
type mismatch.
Could you please help me?
Related Posts with Replace if value is a date
Bootstrapping to obtain confidence intervals around differences in failure functionsI have a longitudinal dataset with 2 matched cohorts (Cohort==1 & Cohort==0) in a ratio of 1:3 t…
Creating polynomial expansion of a variableDear Statalist, What I want to do is to create a polynomial expansion of a certain degree of two va…
Issues with converting string to numerical or date in StataHi everyone, I am a new comer to Stata. Currently, I have issues with converting some imported dat…
How to get the number of digits correct using esttabDear StataList, when I run the code below, I almost get what I want. The only problem is that the n…
How to generate a dependent variable in a second stage from point estimates on hundreds of occupation binary variablesDear StataList, I do the following first stage regression: regress logwage i.occupation age gen…
Subscribe to:
Post Comments (Atom)
0 Response to Replace if value is a date
Post a Comment