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
Point in poly dataset mappingHello, I am trying to map points in one dataset to the polygons defined in a second dataset in such…
crosstabsIf I would like to analyze the relationship between two or more categorical variables, can you recom…
Odd results in fixed effects panel regression with interaction termsI am trying to run a study of mutual fund performance where I divide the sample in expansions/recess…
label for loop?Der All, I have the following code for graphs Code: quietly rdplot lpop1994 X, graph_options(ytitl…
Defining variables based on characters included and conditional F tests using a step down procedure (Spanning tests)Dear STATA users, I am using the code below and have encountered two problems which I could not sol…
Subscribe to:
Post Comments (Atom)
0 Response to Replacing a data variable if data falls within a date range
Post a Comment