7.2 Estimation of domain quantiles

If we may want to estimate the population quantiles and medians of the self-reported weight and height among people with or without a university degree, we may consider the following codes.

R

# For people who did not attend an university 
Quant.NUni<- svyquantile( ~ HWT_DHT_M_TRM+HWT_WGHT_KG_TRM, 
  quantile = c(0.025, 0.05, 0.1, 0.5, 0.9, 0.95, 0.975),alpha = 0.05,
  design = subset(CLSA.design, ED_HIGH_TRM == "Non_university"), 
  interval.type = "Wald", ties = c("rounded"), ci = TRUE, se = TRUE)
Quant.NUni; SE(Quant.NUni); 
# For people who attended an university 
Quant.Uni<-svyquantile( ~ HWT_DHT_M_TRM+HWT_WGHT_KG_TRM, 
  quantil =c(0.025, 0.05, 0.1, 0.5, 0.9, 0.95, 0.975),alpha = 0.05, 
  design = subset(CLSA.design, ED_HIGH_TRM == "University"), 
  interval.type = "Wald",ties = c("rounded"), ci = TRUE, se = TRUE)
Quant.Uni; SE(Quant.Uni);

SAS

PROC SURVEYMEANS data = CLSAData 
QUANTILE = (0.025 0.05 0.1 0.5 0.9 0.95 0.975) NONSYMCL;    
VAR    HWT_DHT_M_TRM HWT_WGHT_KG_TRM ;
DOMAIN ED_HIGH_TRM; 
STRATA GEOSTRAT_TRM ;  
WEIGHT WGHTS_INFLATION_TRM;                                       
RUN;

SPSS and Stata In \(\texttt{SPSS}\) and \(\texttt{Stata}\) packages, there is no formal procedure available to produce quantile estimates for domain analysis.

Result comparison
HWT_DHT_M_TRM
HWT_WGHT_KG_TRM
Non university
University
Non university
University
Quantiles R SAS R SAS R SAS R SAS
Estimate
0.025 1.5367 1.5367 1.5291 1.5291 50.8669 50.8669 45.1422 45.1422
0.05 1.5452 1.5452 1.5691 1.5691 54.1563 54.1563 48.1974 48.1974
0.1 1.5769 1.5769 1.5958 1.5958 57.7347 57.7347 56.6144 56.6144
0.5 1.6729 1.6729 1.6915 1.6915 76.5711 76.5711 77.7776 77.7776
0.9 1.7564 1.7564 1.7677 1.7677 95.8922 95.8922 100.7855 100.7855
0.95 1.7846 1.7846 1.8053 1.8053 103.0741 103.0741 110.0363 110.0363
0.975 1.8024 1.8024 1.8391 1.8391 109.5934 109.5934 117.7170 117.7170
SE
0.025 0.0065 0.0138 0.0252 0.0424 1.2007 1.5157 7.8304 NA
0.05 0.0056 0.0078 0.0148 0.0144 1.1715 1.1681 3.2904 8.0046
0.1 0.0134 0.0134 0.0108 0.0112 1.7917 1.7500 4.0130 4.2362
0.5 0.0083 0.0084 0.0103 0.0103 1.1980 1.1927 1.1935 1.2661
0.9 0.0084 0.0083 0.0084 0.0082 1.7410 1.5701 4.4117 3.6180
0.95 0.0080 0.0081 0.0164 0.0153 3.0127 3.0355 4.2546 4.2032
0.975 0.0189 0.0144 0.0183 0.0167 7.3211 7.2938 5.5476 NA

Note:

SAS does not provide some standard errors since the quantiles are too extreme.