A method of estimating the upper airway resistance of a patient using a gas delivery system includes delivering a flow of breathing gas to the patient through the patient circuit of the gas delivery system, superimposing an oscillatory pressure on the flow of breathing gas during an expiratory phase of the patient, determining a first amplitude of an oscillatory component of a gas pressure provided to the patient at an end of the expiratory phase, determining a second amplitude of an oscillatory component of a gas flow provided to the patient at the end of the expiratory phase, determining a first resistance value based on the ratio of the first amplitude to the second amplitude, and determining an upper airway resistance value based on the first resistance value.