I have a focused question. I am working in long format. One of my variables is called “new_diff_days”, which is the absolute # of days between each participant’s birthday (month and day - not DOB) and the date of each participants HbA1c test from a merged baseline study plus a registry-based data set. Of course, each participant has a numeric ID_number I want to only keep the lowest # of days between each individual participant's birthday and the date of their HbA1c test (“new_diff_days”) for each year (e.g., 2010) that one or many HbA1c tests (HbA1c_mmolmol) was done (“y_status_dato”) during the time period of 2008 to 2020. How would you write code for that?
Related Posts with How do I keep the lowest numeric value for a variable on an annual basis over time?
Psmatch2 and 1000 repetitionsHello all! I would like to ask a help, please. I ran the psmatch2 and now i need to run 1000 times t…
Replacing a variable in a longitudinal dataset based on a criteriaDear Statalist users, I have a longitudinal file in the long format. Please see a part of the varia…
Diff-in-Diff with multiple treatment periods and treatment magnitudes?I have a question regarding how to run a generalized diff-in-diff with treatments that are implement…
dropped data in xtlogit,fehi all, In the xtlogit regression below 17667 groups of data have been dropped. (All variables in th…
Family and link selection in GLMHi all, I have a continuous dependent variable varying between 0 and 1. There are lots of zeros, to…
Subscribe to:
Post Comments (Atom)
0 Response to How do I keep the lowest numeric value for a variable on an annual basis over time?
Post a Comment