The endogenous formation of scientific research coalitions