First-time homebuyers struggling with affordability, study finds