In the book "medical marijuanas grow bible" (i think thats the name) by george cervantes, he talks about how u can influence a plants sex. By the way if u dont own this book it is by far my favorite peice of literature on growing.
Any way basically he says u can influence sex after three sets of true leaves are formed. The deciding factors have to do with nutrients, heat, humidity, water, stress. The more stress the more likley males will form. more nitrogen more females, cooler temps more females, more water more females, higher humidity more females. Dont rely all on what i wrote here go get the book u wont regret it.