Dear StataList:
I am wishing to estimate age-adjusted median concentrations and 95% CIs of a laboratory measure across categories of participant characteristics (to use in a descriptive table). I have read that quantile regression estimates medians, but I cannot figure out the post-estimation commands to obtain the age-adjusted median concentrations and accompanying 95% CIs by categories of another variable.
For example, I would like to estimate the age-adjusted median concentration of a laboratory measure across categories of education. I started with the coding:
qreg [lab measure] [age] [age^2] [categorical education] if pop1==1 [pw=wt], vce(robust) /* I am using data with sample weights */
predict median if e(sample), xb
bysort education: centile median if pop1==1
The values I obtained for the age-adjusted median lab measure and 95% CI across categories of education are vastly different than the crude medians. I suspect my post-estimation commands are incorrect. I also wonder if education should be included in the quantile regression model, or just age and age^2.
I am grateful for any coding advice you can provide.
Sincerely,
Kristen Upson
I am wishing to estimate age-adjusted median concentrations and 95% CIs of a laboratory measure across categories of participant characteristics (to use in a descriptive table). I have read that quantile regression estimates medians, but I cannot figure out the post-estimation commands to obtain the age-adjusted median concentrations and accompanying 95% CIs by categories of another variable.
For example, I would like to estimate the age-adjusted median concentration of a laboratory measure across categories of education. I started with the coding:
qreg [lab measure] [age] [age^2] [categorical education] if pop1==1 [pw=wt], vce(robust) /* I am using data with sample weights */
predict median if e(sample), xb
bysort education: centile median if pop1==1
The values I obtained for the age-adjusted median lab measure and 95% CI across categories of education are vastly different than the crude medians. I suspect my post-estimation commands are incorrect. I also wonder if education should be included in the quantile regression model, or just age and age^2.
I am grateful for any coding advice you can provide.
Sincerely,
Kristen Upson
Comment