Not necessarily all companies would pay dividend, that does not mean the stocks of those company is not worth buying or the company is not doing well. Growth oriented companies would pay fewer dividends or no dividend and invest the profits in projects which would benefit the company and the shareholder at large. Well-established companies tend to pay higher dividend.
Investors should not make their investment decision solely on the basis of dividend yield as this can risky. Taking the example stated above, Company A and Company B each declares $1 as dividend when the market price of Company A is $20 and B is $40. Assuming that the market price of Company B falls to $10 by the end of the year. The dividend yield of Company A stands at 5% whereas dividend yield of Company B has gone up to 10%. The dividend yield of B has increased because it failed to meet the earnings projection and the share price went down, which is not a good. Therefore, one would be putting his/her money at risk by investing in Company B.
It is advisable to check the financial of the company especially the payout ratio. A higher payout ratio is a cause of concern as it could mean that the company is failing to re-invest the profits in the business. The dividend yield of DJIA and S&P500 is approximately 2.97% and 1.83% respectively.