The study of sexual segregation has received increasing attention over the last two decades. Several hypotheses have been proposed to explain the existence of sexual segregation, such as the "predation risk hypothesis," the "forage selection hypothesis," and the "activity budget hypothesis." Testing which hypothesis drives sexual segregation is hampered, however, by the lack of consensus regarding a formal measurement of sexual segregation. By using a derivation of the well-known chi-square (here called the sexual segregation and aggregation statistic [SSAS]) instead of existent segregation coefficients, we offer a reliable way to test for temporal variation in the occurrence of sexual segregation and aggregation, even in cases where a large proportion of animals are observed alone. A randomization procedure provides a test for the null hypothesis of independence of the distributions of males and females among the groups. The usefulness of SSAS in the study of sexual segregation is demonstrated with three case studies on ungulate populations belonging to species with contrasting life histories and annual grouping patterns (isard, red deer, and roe deer). The existent segregation coefficients were unreliable since, for a given value, sexual segregation could or could not occur. Similarly, the existent segregation coefficients performed badly when males and females aggregated. The new SSAS was not prone to such limitations and allowed clear conclusions regarding whether males and females segregate, aggregate, or simply mix at random applicable to all species.