Objectives Hospitalized patients often experience adverse events of the gastrointestinal tract due to analgesic treatment. The objectives of this study were to estimate use of medications for treatment of nausea, vomiting, or constipation (NVC medications) after initiation of analgesic treatment, and to compare differences in length of stay and treatment costs between patients who received NVC medications and those who did not. Methods This retrospective cohort study used the Premier Perspective data from January 1, 2005 to December 31, 2007 and stratified inpatients into 4 groups based on the first analgesic agent they were given. Patients were observed for 14 days after the first analgesic use until a regimen change, first use of NVC medication, or hospital discharge, whichever occurred first. Data were analyzed using a Cox proportional hazards model and a generalized linear model. Results This study found that 239,183 (55.1%) of 434,304 patients received NVC medications after analgesic administration. Compared with oral nonopioid analgesics, the risk of using NVC medication was 4.8 times higher for injectable opioid analgesics after controlling for confounders. Patients who received NVC medications were hospitalized 0.26 days longer ( P<0.0001) at an additional cost of $756 per patient compared with patients who did not receive NVC medications ( P<0.0001). Discussion Use of an analgesic with improved gastrointestinal tolerability may potentially reduce use of NVC medications and hospital resources.