If you want to stick to OLS, your suggestion (clustering) seems fine. If you want to pursue efficiency, you may want to use the random effects FGLS (xtreg bodytemperature, i(person)
) estimation.
If you believe that all body temperatures are identical on average, it is alright to use any of them. But if they are heterogenous (due to genes or whatever), none is satisfactory. I would rather think more about what "average body temperature" means.
Let us take an example. When your population is three people (101, 102, and 103) and your sample is
i person x /* x = measured temp */
1 101 36.5
2 102 36.8
3 102 37.8
4 103 37.5
(note that person 102 is measured twice), I guess what you want is $A=(1/3) \times [E(temp_{101}) + E(temp_{102}) + E(temp_{103}) ]$. OLS (the unweighted average), however, equals $(1/4) \times (x_1 + x_2 + x_3 + x_4)$, which is an unbiased estimator of $B=(1/4) \times [ E(temp_{101}) + E(temp_{102}) + E(temp_{102}) + E(temp_{103}) ]$. If $A = B$, that's fine, but $A$ and $B$ can be different.
When you want $A$, what you want to calculate is $A_{be} = (1/3) \times [x_1 + (x_2 + x_3)/2 + x_4]$, while OLS puts too much weight on person 102. $A_{be}$ is called the panel "between group (BE) estimator". You can get it by xtreg bodytemperature, be i(person)
.
For the above data set, the BE estimate (of $A$) is 37.1, while the OLS estimate (of $B$) is 37.15. Try the following in Stata (copy & paste).
* Copy & paste into Stata
clear all
input person temp
101 36.5
102 36.8
102 37.8
103 37.5
end
gen temp37 = temp-37
reg temp37, vce(cluster person)
xtreg temp37, be i(person)
(I deliberately subtracted 37 in order to test your null hypothesis.)