Girls more resilient than boys in troubled families