Hi there,
I'm working with some panel data, whereby for each subject I have multiple events (lab tests) recorded in long form. Each event is dated and I need to calculate whether two specific tests (test_id 12 and 147) are conducted within 3 months of each other (to assess whether testing/diagnostic guidelines are being followed). Subjects may have multiple instances of each test.
At this moment in time, I'm considering looping through all instances of these tests to ascertain whether the other test occurs within 3 months. Given some subjects have 100s of test records and the dataset contains 100,000s of subjects, I'm wondering whether there is a more efficient method to derive my requirements.
(I found plenty of existing threads on the topic of dates and panel data, but nothing akin to the above)
Thanks in advance,
Rob.
Related Posts with Differences between dates using panel data
How to batch (re)label variables using a CSV lookup tableI want to (re)label my variables automatically, based on a variable name → new label lookup table. …
Adding highly correlated explanatory variablesHello, do we add explanatory variables that are highly correlated with the other explanatory variabl…
Combining DID with 2SLS. …
Interpreting coefficientsPlease can someone explain to me the meaning of the coefficients for this random effects GLS regress…
twoway connected line graph with multiple if statementI want to plot connected line graph to represent the before after pattern of a policy implemented in…
Subscribe to:
Post Comments (Atom)
0 Response to Differences between dates using panel data
Post a Comment