Male sex, ostomy, infection, and intravenous fluids are associated with increased risk of postoperative ileus in elective colorectal surgery.