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
Creating a variable from a percentileDear Statalist Experts I hope you are well. I want to create a new variable "highVarA" that should …
item-rest correlation using Spearman?Hi, I'm wondering if there is a way to get item-rest correlation, as you get from the command alpha…
Interpretation of results of a paired analysisHello Everyone, I am doing a paired kidney analysis to look at the effect of obesity on post-transp…
Propensity Score Matching (PSM) to match firms based on age, size and industryDear community, I have a data set of firms that went public via a SPAC merger (SPAC=1). Now I want …
encoding a string variable with a delimiterHello Community, I've been struggling with this one. I have a dataset which is a questionnaire, in …
Subscribe to:
Post Comments (Atom)
0 Response to Differences between dates using panel data
Post a Comment