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?
Using response weights (svy) on a linear regression (regress) but want beta valuesI am using a large dataset (5000+) survey data with weights accounting for demographics that were un…
Stata 15.1 close after exceeding the limit of scrollbufsizeI have noticed that the Stata suddenly close and loosing my unsaved do files. I think it is because …
Using twoway histogram to plot bar graphsHello, I would like to plot two variables in overlaid bars that have the same 7 categories (pre_occ…
Merging 2 datasets on overlapping period of timeI have a question related to merging two datasets on an overlapping period of time. I have found som…
modelling "indirect" social networksI have a dataset of physicians working in different hospitals in different teams. A physician can wo…
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