Red shirts have a skewed death rate in TOS due to the nature of their job. The Security role is handled by Ops, which all wear red shirts (Scotty, the engineer, is also Ops). So red shirts die in higher number because Security officers are at a higher risk. They assume guard duties and the dangers inherent to that role.
In TNG and beyond, the color structure has changed. Command has become the red shirts, and ops has become gold. In TNG, there is a higher number of gold shirt deaths. Tasha Yar being a prime example. Again, it is because Security is gold.
That’s according to Matthew Barsalou, who debunked the red shirt curse for Significance Magazine by mathematically breaking down the death rates, by uniform color, of characters on the original Star Trek. A simple pie chart reveals 55 total deaths and, yes, red shirts perished in frightening numbers. A whopping 24 died, compared to 9 in yellow/gold command and 7 in blue, with 15 crossing into the final frontier in unidentified colors. However, it’s all a matter of perspective and percentages. There were 430 crewmen aboard the Enterprise, 239 of them in engineering, security or operations, and all wore red. So, in reality, they had a decent survival rate, and it was, statistically speaking – courtesy of a little something called Bayes’ theorem -- the folks in gold who were more likely to meet their maker. - See more at: http://www.startrek.com/article/did-redshirts-really-die-more-often-on-tos#sthash.wUlkpts5.dpuf
So while red shirts in TOS are statistically safer, based on ship crew complement, they suffer a higher on screen death count. Higher number, lower percentage.