Revised to calculate weekend and weekday using the imputed values