這裏是我的代碼爲什麼SAS「合併」函數會覆蓋觀察結果和偏差?
libname blood "C:\Users\owner\Desktop\SAS";
data blood.donors1;
input id type $ units;
cards;
2304 o 16
1129 a 48
1129 a 50
1129 a 57
2486 b 63
;
run;
data blood.donors2;
input id code units;
cards;
6488 65 27
1129 63 32
5438 63 39
2304 61 45
1387 64 67
;
run;
proc sort data=blood.donors1 out=blood.donors1;
by id;
run;
proc sort data=blood.donors2
out=blood.donors2;
by id;
run;
data blood.donorsmerge;
merge blood.donors1 (in = indonors1) blood.donors2;
by id;
if indonors1;
run;
下面是結果表donorsmerge
行1129 a 48
得到完全1129 63 32
覆蓋。但行1129 a 50
和1129 a 57
被部分覆蓋。爲什麼?我閱讀文檔。在我看來,結果數據集應該包含32
,正如我在上面的圖片中指出的那樣