New Publication: Stata tip 142: joinby is the real merge m:m

Hi OOW members! Here is a methods article from OOW Member Deni Mazrekaj‘s recent work:


1. Mazrekaj D, Wursten J. Stata tip 142: joinby is the real merge m:m. The Stata Journal. 2021;21(4):1065-1068. doi:10.1177/1536867X211063416


The merge command is one of Stata’s most used commands and works fine as long as the match key is unique in one of the datasets (that is, merge 1:1, 1:m, or m:1 situations). However, when the match key contains duplicates in either dataset, Stata gives an error message saying that the key variable(s) do not uniquely identify observations in master or using dataset. This article offers examples and tools for working with names in a data set on Stata.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.