Dear Stata users,
My Data 1 have the following variables: ID, VISIT; DAYS FROM BASELINE. Data2: ID and DAYS FROM BASELINE for only last 1-3 visits. I am having difficulty in imputing missing values of DAYS FROM BASELINE for last 2 visit in Data1 from Data2. I have tried to join (joinby) them using id but it does not work (created many duplicates). Is there any way to solve the problem?
Thank you in advance.
Data looks as below:
My Data 1 have the following variables: ID, VISIT; DAYS FROM BASELINE. Data2: ID and DAYS FROM BASELINE for only last 1-3 visits. I am having difficulty in imputing missing values of DAYS FROM BASELINE for last 2 visit in Data1 from Data2. I have tried to join (joinby) them using id but it does not work (created many duplicates). Is there any way to solve the problem?
Thank you in advance.
Data looks as below:
PHP Code:
Data 1:
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input long id float v1 int days_from_baseline1
1 0 0
1 1 115
1 3 349
1 4 731
1 5 1101
1 6 .
1 8 .
2 0 0
2 1 111
2 3 364
2 4 735
2 5 1094
2 6 .
2 8 .
3 0 0
3 1 116
3 3 361
3 4 727
3 6 .
3 8 .
end
[/CODE]
PHP Code:
Data 2.
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input long id int days_from_baseline2
1 3808
1 4405
1 4832
2 3740
3 2807
3 3575
end
[/CODE]
Comment