I am using Stata/SE 15.1 with Windows OS on a dataset with 6,650 observations and 2,341 variables. I have a measure indicating the date each observation completed their probation sentence (variable name outdate) and then (up to 130) measures indicating dates of rearrests (following the first arrest; variable names offnsdte1 offnsdte2 ... offnsdte130). My goal is to identify if each observation was rearrested within 365 days of their probation completion. The issue is that each observation could have been arrested during their probation sentence, so several of the rearrest dates were before the probation completion date. Each observation can have a different number of rearrests though the dates are coded as missing for those who weren't rearrested X number of times (i.e. if someone wasn't rearrested for a 10th time, they are missing for offnsdte10). I'm at a loss of how to move forward with this-- I imagine it may involve some kind of looping code, but I'm unfamiliar with how to use it. Also, all dates are in the %tdD_m_Y format.
I hope I provided enough information but let me know if not. I appreciate any advice you may have to offer. Thanks!
Related Posts with How to compare list of dates to a reference date within each observation
Renaming graphsHi, I would like to plot a graph titled "Crude Oil Production". As I type in the code, Code: two…
egen rank for multiple variables Code: +-------------------------------------------------------------+ | country year …
Creating a Regression Table from 2SLS RegressionsHi everyone! I would like to create two regression tables from nine 2SLS regressions. I have run m…
-tabout- -show(all)- and -mi- not workingHello all, First and foremost, thank you in advance to anybody that is able to help out. I tried se…
Why has Stata dropped observations from my fixed effects model?Hi, I have a dataset of 318 local authorities and am running a fixed effects regression. However wh…
Subscribe to:
Post Comments (Atom)
0 Response to How to compare list of dates to a reference date within each observation
Post a Comment