I have some data that was misclassified for a certain date range and would like to change using Stata. I am trying to change variable "type" to "3" for date range Dec 17, 2018 to Jan 10, 2019. Below is an example of how the data looks and the code I've tried. I also have a variable for date that is a string variable.
input type date
1, 03jan2018
2, 05mar2019
2, 25dec2018
2, 01jan2019
replace type = 3 if inrange(date, 17dec2018, 10jan2019)
Related Posts with Replacing a data variable if data falls within a date range
In SEM, calculating SE of standardized total effects and indirect effectsI'm fitting a SEM model, and everything is fine except the paper's reviewers want standardized total…
Reshape wide errorI'm using Stata 15.1 on a Windows 10 machine I'm struggling to get my head around -reshape- (again)…
Svyset command "unrecognized" in Stata 15Hi everyone, I have a puzzling problem. I'm using Stata 15 and when I try to svyset, I get an error…
Bootstrapping standard errors moves the p-value of a variable from 0.000 to 1.000Hi all, To overcome the generated regressor problem, I perform bootstrapping to correct the standar…
Significance of variablesHello, I have one doubt about the significance of an independent variables. In my database I have e…
Subscribe to:
Post Comments (Atom)
0 Response to Replacing a data variable if data falls within a date range
Post a Comment