This study looked at sex, drug use and depression in adolescents:

“Overall, sex and drug behavior predicted an increased likelihood of depression, but depression did not predict behavior. Among girls, both experimental and high-risk behavior patterns predicted depression. Among boys, only high-risk behavior patterns increased the odds of later depression. Depression did not predict behavior in boys, or experimental behavior in girls; but it decreased the odds of high-risk behavior among abstaining girls (RRR=0.14) and increased the odds of high-risk behavior (RRR=2.68) among girls already experimenting with substance use”