可能的值_merge
in Stata
是(注意merge
也可以有值 4 和 5)
1 master observation appeared in master only
2 using observation appeared in using only
3 match observation appeared in both
In R
,您可以通过输入参数来做到这一点all=TRUE
or all.x=TRUE
or all.y=TRUE
e.g.,
merge(x, y, by = intersect(names(x), names(y)),by.x = by, by.y = by, all = TRUE)
merge(x, y, by = intersect(names(x), names(y)),by.x = by, by.y = by, all.x = TRUE)
merge(x, y, by = intersect(names(x), names(y)),by.x = by, by.y = by, all.y = TRUE)