That seems like a pretty hasty conclusion to jump to. I very well might be wrong, but I don't think that dying your hair is going to make it thinner.
It's hard to accept, but it very well may be nothing other than male pattern baldness.
At such a young age, though?
The truth is... my hair started thinning at the age of 16, almost two years ago. It's very possible.
If you're SERIOUS about your hairloss, the best thing to do would be to suck it up and see your doctor about it. It may be embarrasing, but remember: putting this off might make things much worse in the long run. There are a number of medical deficiencies that can cause hairloss, but if it turns out to be real male pattern baldness...
Don't freak out. Just come back here, post whatever questions you have, and we'll help you start up a hairloss regime, if you really want to keep your hair.
Good luck, and keep us posted!