Using data from a randomized trial to improve the quality of ambulatory care, the authors quantify the various sources of variability and bias that affect measures of quality of care and suggest experimental designs and analyses that reduce both bias and variability.