I want to test if the median of a continuous variable (e.g. height) is the same in two independent groups (boys and girls). For each person there are multiple measurements of the continuous variable at different time points (irregular). So the data looks like:


  • Male1: 85, 100, 120, 140
  • Male2: 100, 130
  • ...


  • Female1: 120, 125
  • Female2: 140, 150, 160
  • ...

What statistical test can I use?

I thought about U Mann-Whitney Test, but it assumes the observations in a group to be independent, which is not true as the same person is measured multiple times at different ages. Of course I could take a median per person and then apply the test. But I am not sure if this is a good idea.

  • $\begingroup$ Median test (a form of 2x2 chi-square test) can be used. This is for one measurement (one time point). You did not clarify what you want to gretet from this "For each person there are multiple measurements of the continuous variable at different time points (irregular)". How you are going to use this multiple "irregular" (how irregular?) measures. $\endgroup$ – ttnphns Jan 3 at 16:01
  • $\begingroup$ You should be able to use quantile regression to estimate the median, conditional on the group, and accounting for the measurements within each subject. Whether this is satisfactory depends upon what it is you are really trying to determine, and how "irregular" the data are. $\endgroup$ – Sal Mangiafico Jan 4 at 10:14
  • $\begingroup$ Let me clarify: I have body measurements (weight, height, body fat percentage, ...) of a group of patients with a specific disease. I calculated z scores based on reference values to show how much the body measurements of patients differ from normal healthy persons. Now I am trying to answer the question if the measurements are more abnormal for girls in comparison to boys. Therefore I want to test the median z-scores of each group. Each patient has measurements at different ages, but these are not the same for all patients. But overall the age distribution is very similar in boys and girls $\endgroup$ – needRhelp Jan 8 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.