Hi Statalist members,
I am a graduate student using Stata. My professors use R or SAS (which I have no clue about but hope to learn later) so they can't help much with my Stata questions).
I am currently using the NHANES data - a complex survey design - to compare several variables across quintiles of an exposure variable e.g. to compare the distribution of age across quintiles of sleep duration. However, all of the variables are not normally distributed, thus I am more inclined to report the numbers using median (interquartile range), instead of mean ± standard deviation. How can I get the median but also check for statistical significance?
If I use the epctile code below (user-written code by Stas Kolenikov) I get the Median but only with a Confidence Interval (not the Interquartile Range and an overall p-value). However, an arduous way to get IQR would be to run the same code separately for p(25) and p(75) from which I can calculate the IQR for each age category but still doesn't tell me about the overall statistical significance of age across all the categories (please see below).
Is there a more efficient way to run this as a single code to get the Median and IQR, while also getting a single p-value like I would with Mean?
I'd appreciate anyone's help with this, please. Thank you!

I am a graduate student using Stata. My professors use R or SAS (which I have no clue about but hope to learn later) so they can't help much with my Stata questions).
I am currently using the NHANES data - a complex survey design - to compare several variables across quintiles of an exposure variable e.g. to compare the distribution of age across quintiles of sleep duration. However, all of the variables are not normally distributed, thus I am more inclined to report the numbers using median (interquartile range), instead of mean ± standard deviation. How can I get the median but also check for statistical significance?
If I use the epctile code below (user-written code by Stas Kolenikov) I get the Median but only with a Confidence Interval (not the Interquartile Range and an overall p-value). However, an arduous way to get IQR would be to run the same code separately for p(25) and p(75) from which I can calculate the IQR for each age category but still doesn't tell me about the overall statistical significance of age across all the categories (please see below).
Is there a more efficient way to run this as a single code to get the Median and IQR, while also getting a single p-value like I would with Mean?
I'd appreciate anyone's help with this, please. Thank you!