Even if you might have partly caused an accident yourself, you can still receive compensation from anyone else who partly caused the accident through carelessness (or recklessness). The amount of another person's responsibility is determined by comparing his or her carelessness with your own. For example, if you were 25% at fault and the other person was 75% at fault, the other person (or that person's insurance company) must pay 75% of the fair compensation for your injuries. This rule is called "comparative negligence."
A few states bar you from compensation if your own carelessness substantially contributed to the accident. (This is called "contributory negligence.") But in practice, the question of whether and how much your carelessness actually contributed to the accident is a point to negotiate with the insurance adjuster.
There is no formula for assigning a percentage to your carelessness -- or that of the other person. During claim negotiations, you will come up with one percentage; the adjuster may come up with another percentage and explain why you bear greater responsibility for the accident. The different percentages at which you each arrive then go into the negotiating hopper with all the other factors that determine how much your claim is worth.
For more about the basic rules used to determine carelessness, see the article Proving Fault in Personal Injury Accidents: General Rules.