Complementarity or substitutability in networks? Methodology and application to the hospital industry