# Test for different median in two independent groups with repeated measurements

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:

Male

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

Female:

• 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.

• 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. – ttnphns Jan 3 at 16:01
• 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. – Sal Mangiafico Jan 4 at 10:14
• 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 – needRhelp Jan 8 at 10:52