The amount of oxygen which goes from the air in the lungs into the blood and attach to the haemoglobin (this transfer takes place in the alveoli) is determined by the partial pressure of oxygen.   The partial pressure of oxygen in the atmosphere is determined by the amount of oxygen in the atmosphere and the pressure altitude.