Please help! How can I write a command in Stata so that..... for each individual ID_number, I uniformly drop the "HbA1c_date" (the date when a lab test was done / study participants) if the "HbA1c_date" was obtained > 90 days AFTER or BEFORE the "ADQresponse_date" (the date when a child or parent in the study filled out a questionnaire called the ADQ)? Thank you in advance for your sage advice.
* Example generated by -dataex-. For more info, type help dataex
clear
input str4 ID_number long ADQresponsedate float(meanADQscore__child meanADQscore_parent HbA1c_date HbA1c_mmolmol)
"0001" 18032 . 5.0 18057 57.3
"0002" 18058 . 4.7 18063 47.5
"0003" 18024 . 4.3 18042 55.2
"0004" 18065 . 4.5 18081 73.7
"0005" 18036 . 4.8 . 18064 63.9
"0005" 17951 5.0 5.0 17952 51.9
"0006" 18026 5.5 4.7 18029 59.5
"0007" 18025 5.9 4.3 18031 51.9
"0008" 18044 5.7 . 18030 54.1
"0009" 18087 . 4.7 18087 53.0
"0010" 18084 4.7 4.6 18059 61.7
Related Posts with Drop observations for date A if > 90 days before or after date B
Looping over many variables to create new variable "if any" ==0Dear Statalist: I am struggling with something that I know should be easy. My data is in long form, …
Revenue Growth TrendHi everyone, I have 15 years (2005-2019) of 548 municipalities general revenue data. I'm trying to g…
Differences in correlation coefficients produced by corr and regFor certain variables, corr and reg produce different correlation coefficients that cannot be explai…
Loop for collapse + save fileI'm trying to write a loop where I have reporter and partner countries and country groupings as sepa…
eventstudy2: why my command neglects results of Mondays?Hello everyone I am using the powerful command, eventstudy2 (Thomas Kaspereit, 2020) for a global e…
Subscribe to:
Post Comments (Atom)
0 Response to Drop observations for date A if > 90 days before or after date B
Post a Comment