The home price-to-income ratio is calculated by dividing the median home price by the median income to measure market affordability. A higher ratio indicates a more expensive market relative to local earnings, while a lower ratio suggests better affordability.