CIUDAD JUÁREZ, Mexico — Telma Pedro Córdoba could have left this blood- and bullet-marked city when she lost her husband to a drive-by shooting in 2009, or when an injury kept her mother from factory work, or when gunmen killed a neighbor in front of a friend’s 3-year-old son a few months ago.

Instead, she has stayed. Her tiny one-bedroom home, decorated with carefully done red and silver stenciling, is shared with her mother, grandmother, sister, younger brother and two children. In local slang, unlike their neighbors whose abandoned homes are now stripped of even windows, they have become a “familia anclada,” a family anchored to Ciudad Juárez.

Not long ago, the phrase hardly existed here in this city of overnight truck drivers and baby-faced factory workers from afar. But over the past several years, the forces of drug violence and recession have reshaped both the city’s character — from loose and busy to tight-knit and cautious — and its demographics.

Image The proportion of women rose in Chihuahua and Tamaulipas.

Decades of growth have been replaced by exodus. The city has lost nearly 20 percent of its population in the past three years, or about 230,000 people, according to one academic estimate. And new government figures and interviews suggest that the men who once arrived in waves are departing in larger numbers than women.