Analysis of HIV-1 gene sequences sampled longitudinally from infected individuals can reveal the evolutionary dynamics that underlie associations between disease outcome and viral genetic diversity and divergence. Here we extend a statistical framework to estimate rates of viral molecular adaptation by considering sampling error when computing nucleotide site-frequencies. This is particularly beneficial when analyzing viral sequences from within-host viral infections if the number of sequences per time point is limited. To demonstrate the utility of this approach, we apply our method to a cohort of 24 patients infected with HIV-1 at birth. Our approach finds that viral adaptation arising from recurrent positive natural selection is associated with the rate of HIV-1 disease progression, in contrast to previous analyses of these data that found no significant association. Most surprisingly, we discover a strong negative correlation between viral population size and the rate of viral adaptation, the opposite of that predicted by standard molecular evolutionary theory. We argue that this observation is most likely due to the existence of a confounding third variable, namely variation in selective pressure among hosts. A conceptual non-linear model of virus adaptation that incorporates the two opposing effects of host immunity on the virus population can explain this counterintuitive result. 