We present a statistical comparison of the mass ratio distribution of companions, as observed in different multiplicity surveys, to the most recent estimate of the single object mass function (Bochanski et al. 2010). The main goal of our analysis is to test whether or not the observed companion mass ratio distribution (CMRD) as a function of primary star mass and star formation environment is consistent with having been drawn from the field star IMF. We consider samples of companions for M dwarfs, solar type and intermediate mass stars, both in the field as well as clusters or associations, and compare them with populations of binaries generated by random pairing from the assumed IMF for a fixed primary mass. With regard to the field we can reject the hypothesis that the CMRD was drawn from the IMF for different primary mass ranges: the observed CMRDs show a larger number of equal-mass systems than predicted by the IMF. This is in agreement with fragmentation theories of binary formation. For the open clusters {alpha} Persei and the Pleiades we also reject the IMF random- pairing hypothesis. Concerning young star-forming regions, currently we can rule out a connection between the CMRD and the field IMF in Taurus but not in Chamaeleon I. Larger and different samples are needed to better constrain the result as a function of the environment. We also consider other companion mass functions (CMF) and we compare them with observations. Moreover the CMRD both in the field and clusters or associations appears to be independent of separation in the range covered by the observations. Combining therefore the CMRDs of M and G primaries in the field and intermediate mass primary binaries in Sco OB2 for mass ratios, q = M2/M1, from 0.2 to 1, we find that the best chi-square fit follows a power law dN/dq propto q^{beta}, with {beta} = -0.50 pm 0.29, consistent with previous results.