Hi,
I am currently working on a database with repeated values over time. This database is as follows:
ctrpat is the identification number for each subject
visite is the visit number over time (patients were followed 7 times)
A_SCMMSE is the cognitive score at each follow-up visit (mainly at V0, 2, 4 and 6)
I would like to create a new cognitive variable = to the delta of cognition between the first one evaluation of cognition and the last one for each patient. Thus, mainly between the 6th and the baseline visit but due to missing values or patients sometimes having visits at v1, v3, and maybe v5, it can change from one subject to another one.
Thank you very for your help +++
Best regards,
Pierre
I am currently working on a database with repeated values over time. This database is as follows:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long ctrpat byte(visite A_SCMMSE) 10005001 0 28 10005001 1 . 10005001 2 30 10005001 3 . 10005001 4 30 10005001 5 . 10005001 6 30 10005002 0 30 10005002 1 . 10005002 2 29 10005002 3 . 10005002 4 30 10005002 5 . 10005002 6 30 10005003 0 25 10005003 1 . 10005003 2 27 10005003 3 . 10005003 4 25 10005003 5 . 10005003 6 26 10005004 0 30 10005004 1 . 10005004 2 29 10005004 3 . 10005004 4 30 10005004 5 . 10005004 6 30 10007001 0 30 10007001 1 . 10007002 0 30 10007003 0 . 10010001 0 30 10010001 1 . 10010001 2 . 10010002 0 . 10010003 0 . 10010003 1 . 10010004 0 . 10010004 1 . 10015001 0 . 10015001 1 . 10015001 2 . 10015001 3 . 10015001 4 19 10015001 5 . 10015001 6 12 10015002 0 . 10015002 1 . 10015002 2 . end
visite is the visit number over time (patients were followed 7 times)
A_SCMMSE is the cognitive score at each follow-up visit (mainly at V0, 2, 4 and 6)
I would like to create a new cognitive variable = to the delta of cognition between the first one evaluation of cognition and the last one for each patient. Thus, mainly between the 6th and the baseline visit but due to missing values or patients sometimes having visits at v1, v3, and maybe v5, it can change from one subject to another one.
Thank you very for your help +++
Best regards,
Pierre
Comment