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
Panel data anaysisI have panel data for 34 countries and four independent variables to determine their impacts on Expo…
Rearranging data using stata codeDear Stata Users, I would like to rearrange the following data sets using a specific "stata-code" r…
r 430Hi All, im trying to submit the following command: melogit newpromar LOForLoan i.ObsAccessfinn ResD…
Structural Equation Modelling (SEM)using STATAHi, I want to analyse my data with SEM using STATA. But i still confuse because there is no unobserv…
Meta-analysis of individual patient data (one-step) - time to event in the presence of competing-risksHi, I am wondering whether anyone can help with a problem I am having synthesizing data for a meta-…
Subscribe to:
Post Comments (Atom)
0 Response to Drop observations for date A if > 90 days before or after date B
Post a Comment