Data cleaning question: I have a longitudinal data set from 2009 to 2020 involving children and adolescents with type 1 diabetes. In my data file, each row includes data for a study participant identified with a person_number as a string variable. Each column includes variables like the date that a HbA1c lab test was measured, the result of a central HbA1c value and the result of a local HbA1c value.
My question = How do you write code to first identify a list of dates when a study participant had a lab value reported for a central HbA1c AND a local HbA1c on the same date? Then, I will need to exclude the local HbA1c value, because the central HbA1c value is presumed to be more trustworthy.
*if central_HbA1c and local_HbA1c were done on the exact same date (HbA1c_date), then only keep the central_HbA1c value or keep the central_HbA1c.
*E.g. on 18 Feb 12, central_HbA1c = 61 mmol/mol and local_HbA1c = 63 mmol/mol, so drop the local_HbA1c value of 63 or keep the central_HbA1c value of 61.
Related Posts with Selectively dropping 1 of 2 similar variables measured on the same date
OLS/Random Effects/Mundlak Interaction termHi, I am currently using a panel data-set to identify ethnic pay differentials. My dependent variabl…
Generating new variable based on ICD9 code range anywhere in the rowGreetings, A sample data set for my problem is shown below. I am trying to generate few new variabl…
Extrac the numbers in variable labelsHi, How can I extract the numeric part from my variable labels? For example: I have the next var …
icalc, intspec - "invalid 'focal' " errorHi, I'm trying to learn how to use Kaufman's* 'icalc' suite of commands to probe interactions and I…
Categorizing ICD-10 codes into major categoriesHi; I work with ICD-10 codes regularly. I'm currently involved in a project where several thousand …
Subscribe to:
Post Comments (Atom)
0 Response to Selectively dropping 1 of 2 similar variables measured on the same date
Post a Comment