<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" article-type="research-article"><?properties manuscript?><front><journal-meta><journal-id journal-id-type="nlm-journal-id">8506513</journal-id><journal-id journal-id-type="pubmed-jr-id">3134</journal-id><journal-id journal-id-type="nlm-ta">Comput Methods Programs Biomed</journal-id><journal-id journal-id-type="iso-abbrev">Comput Methods Programs Biomed</journal-id><journal-title-group><journal-title>Computer methods and programs in biomedicine</journal-title></journal-title-group><issn pub-type="ppub">0169-2607</issn><issn pub-type="epub">1872-7565</issn></journal-meta><article-meta><article-id pub-id-type="pmid">25123100</article-id><article-id pub-id-type="pmc">5708173</article-id><article-id pub-id-type="doi">10.1016/j.cmpb.2014.07.007</article-id><article-id pub-id-type="manuscript">HHSPA765247</article-id><article-categories><subj-group subj-group-type="heading"><subject>Article</subject></subj-group></article-categories><title-group><article-title>Median and Quantile Tests under Complex Survey Design using SAS and R</article-title></title-group><contrib-group><contrib contrib-type="author"><name><surname>Pan</surname><given-names>Yi</given-names></name><xref ref-type="aff" rid="A1">1</xref></contrib><contrib contrib-type="author"><name><surname>Caudill</surname><given-names>Sam</given-names></name><xref ref-type="aff" rid="A1">1</xref></contrib><contrib contrib-type="author"><name><surname>Li</surname><given-names>Ruosha</given-names></name><role>Assistant professor</role><xref ref-type="aff" rid="A2">2</xref></contrib><contrib contrib-type="author"><name><surname>Caldwell</surname><given-names>Kathy L.</given-names></name><xref ref-type="aff" rid="A1">1</xref></contrib></contrib-group><aff id="A1">
<label>1</label>Division of Laboratory Sciences, National Center for Environmental Health, Centers for Disease Control and Prevention, Atlanta, Georgia.</aff><aff id="A2">
<label>2</label>Department of Biostatistics, University of Pittsburg, Pittsburgh, PA 15261.</aff><pub-date pub-type="nihms-submitted"><day>14</day><month>11</month><year>2017</year></pub-date><pub-date pub-type="epub"><day>28</day><month>7</month><year>2014</year></pub-date><pub-date pub-type="ppub"><month>11</month><year>2014</year></pub-date><pub-date pub-type="pmc-release"><day>30</day><month>11</month><year>2017</year></pub-date><volume>117</volume><issue>2</issue><fpage>292</fpage><lpage>297</lpage><!--elocation-id from pubmed: 10.1016/j.cmpb.2014.07.007--><abstract><p id="P1">The programs on testing the medians or other quantiles of two or more subgroups under complex survey design are limited. In this paper, we introduce programs in both SAS and R to perform such a median/quantile test under complex survey design. A detailed illustration of the computations, macro variable definitions, input and output for the SAS and R programs are also included in the text. Urinary iodine data from National Health and Nutrition Examination Survey (NHANES) are used as examples for comparing medians between females and males as well as comparing the 75<sup>th</sup> percentiles among three salt consumption groups.</p></abstract><kwd-group><kwd>Median</kwd><kwd>Quantile</kwd><kwd>Complex Survey</kwd><kwd>SAS</kwd><kwd>R</kwd></kwd-group></article-meta></front><body><sec id="S1"><title>1. Introduction</title><p id="P2">National complex survey results are the basis of many public health related policies, these results are usually from a complex finite population sample,, possibly stratified clustered and unequally weighted. Therefore, analyses of health survey data obtained with complex sampling designs are extraordinarily important. Natarjan et al. did a search on PubMed (National Library of Medicine) and they found 7699 articles related to &#x0201c;NHANES&#x0201d; (National Health and Nutrition Examination Survey) between the years 2006 and 2011 [<xref rid="R1" ref-type="bibr">1</xref>]. However, inference methods and available software for testing medians or quantiles of 2 or more groups are not well developed for complex survey data. In this paper, we address this issue and introduce a SAS Macro and an R function to perform the quantile tests under complex survey design.</p><p id="P3">Several statistical approaches have been proposed to test for the equality of medians or different quantiles, but these tests do not take into account prior the extension to the complex survey design. Brown and Mood ([<xref rid="R2" ref-type="bibr">2</xref>&#x02013;<xref rid="R3" ref-type="bibr">3</xref>]), Mood [<xref rid="R4" ref-type="bibr">4</xref>&#x02013;<xref rid="R5" ref-type="bibr">5</xref>] and Westenberg [<xref rid="R6" ref-type="bibr">6</xref>] introduced Mood&#x02019;s median test, which is also referred as the joint median test. The median test is a distribution-free procedure and focuses on whether two or more independent samples differ in their median values for a criterion variable. And the median test is a special case of a joint quantile test [<xref rid="R7" ref-type="bibr">7</xref>]. In the meantime, the Wilcoxon rank-sum test (also called the Wilcoxon-Mann-Whitney test) was proposed as an alternative [<xref rid="R8" ref-type="bibr">8</xref>&#x02013;<xref rid="R10" ref-type="bibr">10</xref>]. Few studies extend those different median/rank tests under complex sampling. Williams and Perritt [<xref rid="R11" ref-type="bibr">11</xref>] investigated a simple way to extend Mood&#x02019;s median test to a weighted median test under a complex survey design, but it was restricted to only compare medians. Natarajan et al. [<xref rid="R1" ref-type="bibr">1</xref>] discussed the relation between the proportional odds model and the Wilcoxon rank sum test. By formulating the Wilcoxon test statistics in terms of a score test statistic from the proportional odds model, they extended the Wilcoxon rank-sum test to handle complex samples, obtaining the test statistic as the score test statistic for the group effect from a proportional odds cumulative logistic regression model. Furthermore, Lumley and Scott [<xref rid="R12" ref-type="bibr">12</xref>] investigated a general approach to construct design-based rank tests when comparing two groups within a complex sample. Their approach is incorporated in the R survey package &#x0201c;survey&#x0201d; [<xref rid="R13" ref-type="bibr">13</xref>] but it only applies to testing medians and quantiles between two groups.</p><p id="P4">In summary, the computer programs for testing the equality of different quantiles for two or more groups are limited. In this paper, we present a quantile test based on the extension of mood&#x02019;s median test for two or more groups under a clustered and stratified (complex) survey design by both SAS macro and an R function. The programs will benefit researchers who are working with medians or other quantiles from survey data. Computational methods and theory are introduced in the next section. Section 3 describes the details of the SAS and R programs.. Two examples from NHANES are included to illustrate the quantile test on two or more groups. A brief summary follows in section 5.</p></sec><sec id="S2"><title>2. Methods</title><sec id="S3"><title>2.1 Mood&#x02019;s Median Test</title><p id="P5">Mood&#x02019;s median test compares the medians of observations from two or more samples and is very straightforward to follow. The test assumes that observations are independent both within and between samples, and the distributions of the populations the samples were drawn from all have the same shape.</p><p id="P6">Following the notation of Williams and Perritt [<xref rid="R11" ref-type="bibr">11</xref>], we consider a population of <italic>N</italic> observations with <italic>C</italic> samples, <italic>N</italic><sub>1</sub>, <italic>N</italic><sub>2</sub>, &#x02026;, <italic>N<sub>C</sub></italic>. Define <italic>M</italic> as the median of all <italic>N</italic> observations and <italic>M<sub>i</sub></italic> as the median of the <italic>i</italic> th sample. In median test, we&#x02019;re interested in the following hypotheses.
<disp-formula id="FD1"><mml:math id="M1" display="block" overflow="scroll"><mml:msub><mml:mi>H</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>:</mml:mo><mml:msub><mml:mi>M</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>M</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mo>&#x022ef;</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>M</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>M</mml:mi></mml:math></disp-formula>
<disp-formula id="FD2"><mml:math id="M2" display="block" overflow="scroll"><mml:msub><mml:mi>H</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>:</mml:mo><mml:mtext mathvariant="italic">at least&#x000a0;</mml:mtext><mml:msub><mml:mi>M</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02260;</mml:mo><mml:msub><mml:mi>M</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mtext mathvariant="italic">where&#x000a0;</mml:mtext><mml:mi>i</mml:mi><mml:mo>&#x02260;</mml:mo><mml:mi>j</mml:mi><mml:mo>.</mml:mo></mml:math></disp-formula></p><p id="P7">Furthermore, define <italic>A</italic><sub><italic>i</italic>1</sub> as the number of observations in the <italic>i</italic> th sample less than or equal to <italic>M</italic>. On the other hand, let <italic>A</italic><sub><italic>i</italic>2</sub> denote the number of observations in the <italic>i</italic> th sample greater than <italic>M</italic>.
<table-wrap id="T3" position="anchor" orientation="portrait"><table frame="box" rules="all"><tbody><tr><td align="center" rowspan="1" colspan="1"/><td align="center" rowspan="1" colspan="1"><italic>N</italic><sub>1</sub></td><td align="center" rowspan="1" colspan="1"><italic>N</italic><sub>2</sub></td><td align="center" rowspan="1" colspan="1">&#x022ef;</td><td align="center" rowspan="1" colspan="1"><italic>N<sub>c</sub></italic></td><td align="center" rowspan="1" colspan="1"><italic>N</italic></td></tr><tr><td align="center" rowspan="1" colspan="1">&#x02264; <italic>M</italic></td><td align="center" rowspan="1" colspan="1"><italic>A</italic><sub>11</sub></td><td align="center" rowspan="1" colspan="1"><italic>A</italic><sub>12</sub></td><td align="center" rowspan="1" colspan="1">&#x022ef;</td><td align="center" rowspan="1" colspan="1"><italic>A</italic><sub>1<italic>c</italic></sub></td><td align="center" rowspan="1" colspan="1"><italic>K</italic></td></tr><tr><td align="center" rowspan="1" colspan="1">&#x0003e; <italic>M</italic></td><td align="center" rowspan="1" colspan="1"><italic>A</italic><sub>21</sub></td><td align="center" rowspan="1" colspan="1"><italic>A</italic><sub>22</sub></td><td align="center" rowspan="1" colspan="1">&#x022ef;</td><td align="center" rowspan="1" colspan="1"><italic>A</italic><sub>2<italic>c</italic></sub></td><td align="center" rowspan="1" colspan="1"><italic>K</italic></td></tr></tbody></table></table-wrap>And let 
<inline-formula><mml:math id="M3" overflow="scroll"><mml:msub><mml:mi>A</mml:mi><mml:mn>11</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>A</mml:mi><mml:mn>12</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:mo>&#x022ef;</mml:mo><mml:mo>+</mml:mo><mml:msub><mml:mi>A</mml:mi><mml:mrow><mml:mn>1</mml:mn><mml:mi>c</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>A</mml:mi><mml:mn>21</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>A</mml:mi><mml:mn>22</mml:mn></mml:msub><mml:mo>+</mml:mo><mml:mo>&#x022ef;</mml:mo><mml:mo>+</mml:mo><mml:msub><mml:mi>A</mml:mi><mml:mrow><mml:mn>2</mml:mn><mml:mi>c</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mi>K</mml:mi><mml:mo>=</mml:mo><mml:mfrac><mml:mn>1</mml:mn><mml:mn>2</mml:mn></mml:mfrac><mml:mi>N</mml:mi></mml:math></inline-formula>.</p><p id="P8">If the null hypothesis is true, any given observation will have a probability 0.5 of being greater than the overall median <italic>M</italic>, by definition and regardless of which sample it is from. Therefore, for each sample, the number of observations greater than <italic>M</italic> will have a binomial distribution with <italic>p</italic> = 0.5.</p><p id="P9">Define <italic>P<sub>i</sub></italic> as the probability that a certain observation in the <italic>i</italic> th sample is less than or equal to M. Finally, the median test hypotheses can be transformed as follows:
<disp-formula id="FD3"><mml:math id="M4" display="block" overflow="scroll"><mml:msub><mml:mi>H</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>:</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mo>&#x022ef;</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mn>1</mml:mn><mml:mn>2</mml:mn></mml:mfrac></mml:math></disp-formula>
<disp-formula id="FD4"><mml:math id="M5" display="block" overflow="scroll"><mml:msub><mml:mi>H</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>:</mml:mo><mml:mtext mathvariant="italic">at least&#x000a0;</mml:mtext><mml:msub><mml:mi>P</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02260;</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>&#x02260;</mml:mo><mml:mfrac><mml:mn>1</mml:mn><mml:mn>2</mml:mn></mml:mfrac><mml:mo>,</mml:mo><mml:mtext mathvariant="italic">where&#x000a0;</mml:mtext><mml:mi>i</mml:mi><mml:mo>&#x02260;</mml:mo><mml:mi>j</mml:mi><mml:mo>.</mml:mo></mml:math></disp-formula></p><p id="P10">The above hypotheses can be tested using a large sample chi-square statistic with <italic>C</italic> &#x02212; 1 degrees of freedom.</p></sec><sec id="S4"><title>2.2 Extension to Quantile Test and Complex Survey Samples</title><p id="P11">The median test is a special case of a quantile test [<xref rid="R7" ref-type="bibr">7</xref>]. If we define <italic>Q</italic> as the value of <italic>q</italic> th quantile on the overall population. The contingency table in Section 2.1 can be modified as follows.
<table-wrap id="T4" position="anchor" orientation="portrait"><table frame="box" rules="all"><tbody><tr><td align="center" rowspan="1" colspan="1"/><td align="center" rowspan="1" colspan="1"><italic>N</italic><sub>1</sub></td><td align="center" rowspan="1" colspan="1"><italic>N</italic><sub>2</sub></td><td align="center" rowspan="1" colspan="1">&#x022ef;</td><td align="center" rowspan="1" colspan="1"><italic>N<sub>c</sub></italic></td><td align="center" rowspan="1" colspan="1"><italic>N</italic></td></tr><tr><td align="center" rowspan="1" colspan="1">&#x02264; <italic>Q</italic></td><td align="center" rowspan="1" colspan="1"><italic>A</italic><sub>11</sub></td><td align="center" rowspan="1" colspan="1"><italic>A</italic><sub>12</sub></td><td align="center" rowspan="1" colspan="1">&#x022ef;</td><td align="center" rowspan="1" colspan="1"><italic>A</italic><sub>1<italic>c</italic></sub></td><td align="center" rowspan="1" colspan="1"><italic>K</italic><sub>1</sub></td></tr><tr><td align="center" rowspan="1" colspan="1">&#x0003e; <italic>Q</italic></td><td align="center" rowspan="1" colspan="1"><italic>A</italic><sub>21</sub></td><td align="center" rowspan="1" colspan="1"><italic>A</italic><sub>22</sub></td><td align="center" rowspan="1" colspan="1">&#x022ef;</td><td align="center" rowspan="1" colspan="1"><italic>A</italic><sub>2<italic>c</italic></sub></td><td align="center" rowspan="1" colspan="1"><italic>K</italic><sub>2</sub></td></tr></tbody></table></table-wrap>The hypotheses in a quantile test are:
<disp-formula id="FD5"><mml:math id="M6" display="block" overflow="scroll"><mml:msub><mml:mi>H</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>:</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mo>&#x022ef;</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>q</mml:mi><mml:mo>,</mml:mo><mml:mtext mathvariant="italic">where&#x000a0;</mml:mtext><mml:mi>q</mml:mi><mml:mo>&#x02208;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:mn>0</mml:mn><mml:mo>,</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">)</mml:mo><mml:mo>,</mml:mo></mml:math></disp-formula>
<disp-formula id="FD6"><mml:math id="M7" display="block" overflow="scroll"><mml:msub><mml:mi>H</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>:</mml:mo><mml:mtext mathvariant="italic">at least&#x000a0;</mml:mtext><mml:msub><mml:mi>P</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02260;</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>&#x02260;</mml:mo><mml:mi>q</mml:mi><mml:mo>,</mml:mo><mml:mtext mathvariant="italic">where&#x000a0;</mml:mtext><mml:mi>i</mml:mi><mml:mo>&#x02260;</mml:mo><mml:mi>j</mml:mi><mml:mo>.</mml:mo></mml:math></disp-formula></p><p id="P12">However, extending this framework to a complex survey design remains challenging. A complex sample is a probability sample based on sampling procedures such as stratification, clustering and weighting, and designed to improve statistical efficiency, reduce costs or improve precision for subgroup analyses relative to simple random sampling. And independence of observations and equal probabilities of selection may no longer hold under a complex sampling design.</p><p id="P13">Let us consider a stratified, clustered complex sampling design and define <italic>y<sub>h&#x003b1;i</sub></italic> as the measurements on unit <italic>i</italic> in cluster <italic>&#x003b1;</italic> and in stratum <italic>h</italic>. Also following the notation from Williams and Perritt [<xref rid="R11" ref-type="bibr">11</xref>], given the distribution <italic>F</italic> of <italic>y<sub>h&#x003b1;i</sub></italic> in the entire population, <italic>Q</italic> is the value of the <italic>q</italic>th population quantile such that <italic>F</italic>(<italic>Q</italic> &#x02212;) &#x0003c; <italic>q</italic> &#x02264; <italic>F</italic>(<italic>Q</italic>). Define the sample empirical distribution function as 
<inline-formula><mml:math id="M8" overflow="scroll"><mml:mi>G</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>y</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mo>&#x02211;</mml:mo><mml:mi>h</mml:mi></mml:msub><mml:msub><mml:mo>&#x02211;</mml:mo><mml:mi>&#x003b1;</mml:mi></mml:msub><mml:msub><mml:mo>&#x02211;</mml:mo><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mi>&#x003b1;</mml:mi><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>I</mml:mi><mml:mi>y</mml:mi></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mi>&#x003b1;</mml:mi><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mo>&#x02211;</mml:mo><mml:mi>h</mml:mi></mml:msub><mml:msub><mml:mo>&#x02211;</mml:mo><mml:mi>&#x003b1;</mml:mi></mml:msub><mml:msub><mml:mo>&#x02211;</mml:mo><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mi>&#x003b1;</mml:mi><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:math></inline-formula>, where <italic>w<sub>h&#x003b1;i</sub></italic> is the corresponding weight and <italic>I<sub>y</sub></italic> is the indicator function such that 
<inline-formula><mml:math id="M9" overflow="scroll"><mml:msub><mml:mi>I</mml:mi><mml:mi>y</mml:mi></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mi>&#x003b1;</mml:mi><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mo stretchy="true">{</mml:mo><mml:mtable><mml:mtr><mml:mtd columnalign="center"><mml:mn>1</mml:mn><mml:mtext mathvariant="italic">&#x000a0;if&#x000a0;</mml:mtext><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mi>&#x003b1;</mml:mi><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>&#x02264;</mml:mo><mml:mi>y</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd columnalign="center"><mml:mn>0</mml:mn><mml:mtext mathvariant="italic">&#x000a0;if&#x000a0;</mml:mtext><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mi>&#x003b1;</mml:mi><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>&#x0003e;</mml:mo><mml:mi>y</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:math></inline-formula>.</p><p id="P14">The qth population quantile can be consistently estimated by Q, which satisfies <italic>G</italic>(<italic>Q</italic>&#x02212;)&#x0003c;q&#x02264; <italic>G</italic>(<italic>Q</italic>)</p><p id="P15">To perform the quantile test based on the extended Mood&#x02019;s median test, we want to estimate <italic>P<sub>h&#x003b1;i</sub></italic> as follows: 
<inline-formula><mml:math id="M10" overflow="scroll"><mml:msub><mml:mi>p</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mi>&#x003b1;</mml:mi><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mo>&#x02211;</mml:mo><mml:mi>h</mml:mi></mml:msub><mml:msub><mml:mo>&#x02211;</mml:mo><mml:mi>&#x003b1;</mml:mi></mml:msub><mml:msub><mml:mo>&#x02211;</mml:mo><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mi>&#x003b1;</mml:mi><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>x</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mi>&#x003b1;</mml:mi><mml:mi>i</mml:mi><mml:mo stretchy="false">|</mml:mo><mml:mi>c</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>I</mml:mi><mml:mi>Q</mml:mi></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mi>&#x003b1;</mml:mi><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mo>&#x02211;</mml:mo><mml:mi>h</mml:mi></mml:msub><mml:msub><mml:mo>&#x02211;</mml:mo><mml:mi>&#x003b1;</mml:mi></mml:msub><mml:msub><mml:mo>&#x02211;</mml:mo><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mi>&#x003b1;</mml:mi><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>x</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mi>&#x003b1;</mml:mi><mml:mi>i</mml:mi><mml:mo stretchy="false">|</mml:mo><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:math></inline-formula>, where <italic>I<sub>Q</sub></italic>(<italic>y<sub>h&#x003b1;i</sub></italic>) is the indicator function we defined above, with y replaced by Q, and <italic>x</italic><sub><italic>h&#x003b1;i</italic>|<italic>c</italic></sub>) is the indicator subgroup c for unit <italic>i</italic> in cluster <italic>&#x003b1;</italic> and in stratum <italic>h</italic>. 
<inline-formula><mml:math id="M11" overflow="scroll"><mml:msub><mml:mi>x</mml:mi><mml:mrow><mml:mi>h</mml:mi><mml:mi>&#x003b1;</mml:mi><mml:mi>i</mml:mi><mml:mo stretchy="false">|</mml:mo><mml:mi>c</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mo stretchy="true">{</mml:mo><mml:mtable><mml:mtr><mml:mtd columnalign="center"><mml:mn>1</mml:mn><mml:mtext mathvariant="italic">&#x000a0;if unit is in subgroup&#x000a0;</mml:mtext><mml:mi>c</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd columnalign="center"><mml:mn>0</mml:mn><mml:mtext mathvariant="italic">&#x000a0;otherwise</mml:mtext><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></inline-formula></p><p id="P16">In order to obtain a consistent estimate of the covariance matrix <italic>V</italic> of <italic>p</italic> = [<italic>p</italic><sub>1</sub>, <italic>p</italic><sub>2</sub>, <italic>p</italic><sub>3</sub>, &#x02026;, <italic>p<sub>c</sub></italic>]&#x02032; under a complex survey design, we regress <italic>I<sub>Q</sub></italic>(<italic>y<sub>h&#x003b1;i</sub></italic>) onto <italic>x</italic><sub><italic>h&#x003b1;i</italic>|<italic>c</italic></sub>, using a model that takes the survey design into account. Linear regression and logistic regression give identical point estimates. And based on limited simulations (results not shown) with various quantiles (i.e., 0.50, 0.75, 0.90, 0.95, and 0.99), the variance and covariance estimates from linear regression models differ from those obtained from logistic regression models by less than 0.2%, essentially resulting in no hypothesis testing differences between the two models. So for computational simplicity, we choose to use a linear regression model as suggested by Williams and Perritt [<xref rid="R11" ref-type="bibr">11</xref>]. Therefore, the general hypotheses can be presented as follows:
<disp-formula id="FD7"><mml:math id="M12" display="block" overflow="scroll"><mml:msub><mml:mi>H</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>:</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mo>&#x022ef;</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>q</mml:mi></mml:math></disp-formula>
<disp-formula id="FD8"><mml:math id="M13" display="block" overflow="scroll"><mml:msub><mml:mi>H</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>:</mml:mo><mml:mtext mathvariant="italic">at least&#x000a0;</mml:mtext><mml:msub><mml:mi>P</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x02260;</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>&#x02260;</mml:mo><mml:mi>q</mml:mi><mml:mo>,</mml:mo><mml:mtext mathvariant="italic">where&#x000a0;</mml:mtext><mml:mi>i</mml:mi><mml:mo>&#x02260;</mml:mo><mml:mi>j</mml:mi><mml:mo>.</mml:mo></mml:math></disp-formula>The test statistic for such a quantile test is given by <italic>T</italic> = [<italic>CP</italic>]&#x02032;[<italic>CVC</italic>&#x02032;]<sup>&#x02212;1</sup>[<italic>CP</italic>], where <italic>C</italic> = [<italic>J</italic><sub><italic>C</italic>&#x02212;1</sub>| &#x02212; <italic>I</italic><sub><italic>C</italic>&#x02212;1</sub>], <italic>J</italic><sub><italic>C</italic>&#x02212;1</sub> is a column vector of all ones and <italic>I</italic><sub><italic>C</italic>&#x02212;1</sub> is the identity matrix with dimension <italic>C</italic> &#x02212; 1. <italic>T</italic> is approximately distributed as a chi-squared distribution with <italic>C</italic> &#x02212; 1 degree of freedom under <italic>H</italic><sub>0</sub>.</p></sec></sec><sec id="S5"><title>3. SAS and R Programs</title><p id="P17">Both SAS macro and R program can be used to test the equality of any quantile for 2 or more subgroups, under a clustered, stratified and weighted survey design. In this section, we introduce the input and output information for each program. Before using either program, it is required to calculate the quantile of the variable of interest over the entire population, using popular statistical software such as SUDAAN, SAS, R or STATA.</p><sec id="S6"><title>3.1 SAS macro</title><p id="P18">In the SAS macro, eight parameters, namely <italic>data, analyte, variable, group, quantile, weight, strata</italic> and <italic>cluster</italic> are required for input. The variable data specifies the dataset being analyzed and it is required to have the sampling weight of the variable of interest, strata, cluster, analyte and variable. The macro variable &#x0201c;analyte&#x0201d; is the name of the continuous variable of interest and &#x0201c;variable&#x0201d; is the name of the categorical variable which contains subgroup information; it should range from 1, 2, &#x02026;, group depending on the number of categories. The variable &#x0201c;group&#x0201d; is the total number of groups in the categorical variable. For example, when comparing the urinary iodine levels between females and males, &#x0201c;group&#x0201d;=2. Furthermore, &#x0201c;quantile&#x0201d; is the pre-calculated quantile value of interest; &#x0201c;weight&#x0201d; is the sampling weight assigned to each sample person. It is a measure of the number of people in the population represented by that sample person. The variable &#x0201c;strata&#x0201d; defines homogenous groups. Dividing the population into relatively homogenous groups (strata) and sampling a predetermined number from each stratum will increase precision for a given sample size [<xref rid="R14" ref-type="bibr">14</xref>]. The variable &#x0201c;cluster&#x0201d; names the variables that identify the clusters in a complex survey design. Dividing the population into groups and sampling from a random subset of these groups (e.g. geographical locations) will decrease precision for a given sample size but often increase precision for a given cost [<xref rid="R14" ref-type="bibr">14</xref>].</p><p id="P19">The following output is provided by the SAS macro: (1) P; (2) SE_P; (3) COVV_P and; (4) Chi and (5) P Value. Based on the notation in Section 2, testing the equality of quantiles is comparable to testing for equal proportions. P is a vector with (C&#x02212;1) dimensions. &#x0201c;SE_P&#x0201d; and &#x0201c;COVV_P&#x0201d; are the variance and covariance structure of the P values. &#x0201c;Chi&#x0201d; denotes the test statistic calculated based on T in Section 2 and the corresponding &#x0201c;P Value&#x0201d; shows the significance of the test.</p></sec><sec id="S7"><title>3.2 R Program</title><p id="P20">In R function &#x0201c;test.quan&#x0201d;, we specify 3 variables, namely <italic>dataset, group</italic> and <italic>quantile</italic>. The variable &#x0201c;dataset&#x0201d; is the dataset which contains &#x0201c;variable&#x0201d;, &#x0201c;cluster&#x0201d;, &#x0201c;strata&#x0201d;, &#x0201c;analyte&#x0201d; and &#x0201c;weight&#x0201d; in the exact order we listed. The column names in &#x0201c;dataset&#x0201d; are also case sensitive. Furthermore, &#x0201c;group&#x0201d; is the total level of categorical variables. Finally, the variable &#x0201c;quantile&#x0201d; is defined the same as in the SAS macro, which is a pre-calculated quantile value relative to the entire population of interest. Note that any observations with missing weight should be removed from the dataset and any missing value on any variables should be presented as blank. The output from R will exactly match that from SAS.</p></sec></sec><sec id="S8"><title>4. Examples</title><p id="P21">In this section, we demonstrate two examples with both SAS and R programs input and output in <xref ref-type="table" rid="T1">Tables 1</xref> and <xref ref-type="table" rid="T2">2</xref>. Both examples are from NHANES 2009&#x02013;2010, which is a complex, multistage, area probability sample representative of the US non-institutionalized civilian population during 2009&#x02013;2010 [<xref rid="R14" ref-type="bibr">14</xref>]. All respondents gave their informed consent, and the NHANES protocol was reviewed and approved by the National Center for Health Statistics (NCHS) Research Ethics Review Board. Data collection consisted of: 1) a screening visit; 2) an interview during which a wide battery of health related questions were asked; and 3) an examination consisting of direct standardized physical examinations, including body measurements and blood and urine collection, carried out in a mobile examination center (MEC). In the following examples, we&#x02019;re interested in urinary iodine (UI) measurements. Iodine is very essential for proper thyroid function and controls human biochemical reactions and metabolism. As UI can change dramatically within the same subject each day, the World Health Organization (WHO) defines nutritional iodine sufficiency for a population by median UI concentrations as follows: excessive iodine intake, &#x0003e;300 &#x000b5;g/L; more than adequate intake, 200&#x02013;299 &#x000b5;g/L; adequate intake, 100&#x02013;199 &#x000b5;g/L; mild iodine deficiency, 50&#x02013;99 &#x000b5;g/L; moderate iodine deficiency, 20&#x02013;49 &#x000b5;g/L; and severe iodine deficiency &#x0003c;20 &#x000b5;g/L [<xref rid="R15" ref-type="bibr">15</xref>]. Therefore, comparing the median UIs or certain percentiles of UI between or among possible subgroups is of interest.</p><sec id="S9"><title>4.1 Test the equality of Medians between two groups in NHANES, 2009&#x02013;2010</title><p id="P22">We&#x02019;re very interested in assessing the equality of median UIs between females and males based on NHANES 2009&#x02013;2010. Based on descriptive analysis, the median UI for females is 134.4ug/L (95% CI = (125.4&#x02013;146.3)) and that for males is 152.2ug/L (138.6&#x02013;171.1). Before performing the median test, we also need to calculate the overall median by pooling males and females together, which is 143.5ug/L. As shown in <xref ref-type="table" rid="T1">Table 1</xref>, once we specify the input command in both SAS macro and R function, we achieve the test result from both programs. We conclude that males experience significant higher median UI compared to females based on NHANES 2009&#x02013;2010 (p=0.004).</p></sec><sec id="S10"><title>4.2 Test the equality of 75<sup>th</sup> percentiles among three groups in NHANES, 2007&#x02013;2008</title><p id="P23">In addition, we&#x02019;re interested in investigating whether salt use is associated with 75<sup>th</sup> percentile of UI measurements based on NHANES 2007&#x02013;2008. In NHANES, there is one dietary question related to salt consumption: How often is ordinary salt or seasoned salt added in cooking or preparing foods in your household? Is it never, rarely, occasionally, or very often? And in the analysis, salt consumption is defined as &#x0201c;never or rarely&#x0201d;, &#x0201c;occasionally&#x0201d; and &#x0201c;very often&#x0201d;. And we would like to test the equality of 75<sup>th</sup> percentiles of UI by three salt consumption categories. The 75<sup>th</sup> percentile of UI for &#x0201c;never or rare&#x0201d; group is 291.6ug/L (95% CI=(249.0&#x02013;325.7)), for &#x0201c;occasionally&#x0201d; category is 283.85ug/L (261.1&#x02013;302.7) and for &#x0201c;very often&#x0201d; category is 274.05ug/L (259.1&#x02013;302.7). Before performing the test, we calculated the overall median which is 281.7ug/L. The test indicates there is no significant difference in the 75<sup>th</sup> percentiles of UI based on salt consumption groups (p=0.5).</p></sec></sec><sec id="S11"><title>5. Summary</title><p id="P24">In this paper, we provide computer programs based on an extension of Mood&#x02019;s median test to test the equality of any quantile by subgroups under a complex survey design. We introduce both SAS macro and R function to perform such a test. Two examples demonstrate that our programs work well for various situations. It&#x02019;s known that Mood&#x02019;s median test has been criticized for low power and requires a large sample size to obtain the adequate power. We know that usually a complex survey will provide sufficient sample size so that inadequate power should not be an issue here. Note that the step of calculating the quantile is not included in our programs because it may vary depending on which program is used. For example, SUDAAN and R calculate quantiles differently. If we have a string of data such as 1, 1, 1, 2, 2, 2, 2, 2, 3 with equal sampling weights, SUDAAN gives the median as 1.30, considering the values as continuous and R gives 2, considering the values as discrete [<xref rid="R17" ref-type="bibr">17</xref>].</p></sec><sec id="S12"><title>6. Macro Availability and Software Requirement</title><p id="P25">The programs in SAS and R for quantile tests under a complex survey design are available directly from the authors. The programs were written in SAS V9.3 and R 2.14.2. The R users need to download and install the packages &#x0201c;survey&#x0201d; from CRAN mirror.</p></sec></body><back><ack id="S13"><p id="P26">The authors appreciate unconditional help from Dr. Thomas Lumley, Anthony Damico, Daoying Lin and Dr. Shuo Chen.</p></ack><ref-list><ref id="R1"><label>1</label><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Natarjan</surname><given-names>S</given-names></name><name><surname>Lipsitz</surname><given-names>SR</given-names></name><name><surname>Fitzmaurice</surname><given-names>GM</given-names></name><name><surname>Sinha</surname><given-names>D</given-names></name><name><surname>Ibrahim</surname><given-names>JG</given-names></name><name><surname>Haas</surname><given-names>J</given-names></name><name><surname>Gellad</surname><given-names>W</given-names></name></person-group><article-title>An extension of the Wilcoxon rank sum test for complex sample survey data</article-title><source>Journal of the Royal Statistical Society, Series C</source><volume>61</volume><year>2012</year><fpage>653</fpage><lpage>664</lpage></element-citation></ref><ref id="R2"><label>2</label><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Brown</surname><given-names>GW</given-names></name><name><surname>Mood</surname><given-names>AM</given-names></name></person-group><article-title>Homogeneity of several samples</article-title><source>Amarican Statistician</source><volume>2</volume><year>1948</year><fpage>22</fpage></element-citation></ref><ref id="R3"><label>3</label><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Brown</surname><given-names>GW</given-names></name><name><surname>Mood</surname><given-names>AM</given-names></name></person-group><article-title>On median tests for linear hypotheses</article-title><source>Proceedings of the second Berkeley Symposium on Mathematical Statistics and Probability</source><publisher-name>University of California Press</publisher-name><year>1951</year><fpage>159</fpage><lpage>166</lpage></element-citation></ref><ref id="R4"><label>4</label><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Mood</surname><given-names>AM</given-names></name></person-group><source>Introduction to the Theory of Statistics</source><publisher-name>McGraw-Hill</publisher-name><year>1950</year></element-citation></ref><ref id="R5"><label>5</label><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Mood</surname><given-names>AM</given-names></name></person-group><article-title>On the asymptotic efficiency of certain nonparametric two-sample tests</article-title><source>Ann. Math. Stat</source><volume>25</volume><year>1954</year><fpage>514</fpage><lpage>522</lpage></element-citation></ref><ref id="R6"><label>6</label><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Westenberg</surname><given-names>J</given-names></name></person-group><article-title>Significance test for median and interquartile range in samples from continuous populations of any form</article-title><source>Nederl. Akad. Wetensch., Proc</source><volume>51</volume><year>1948</year><fpage>253</fpage><lpage>261</lpage></element-citation></ref><ref id="R7"><label>7</label><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Chakraborti</surname><given-names>S</given-names></name><name><surname>Laan</surname><given-names>p</given-names></name></person-group><article-title>Precedence tests and confidence bounds for complete data: an overview and some results</article-title><source>The Statistician</source><volume>45</volume><year>1996</year><fpage>351</fpage><lpage>369</lpage></element-citation></ref><ref id="R8"><label>8</label><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kruskal</surname><given-names>WH</given-names></name></person-group><article-title>Historical Notes on the Wilcoxon Unpaired Two-Sample Test</article-title><source>Journal of the American Statistical Association</source><volume>52</volume><year>1957</year><fpage>356</fpage><lpage>360</lpage></element-citation></ref><ref id="R9"><label>9</label><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Wilcoxon</surname><given-names>F</given-names></name></person-group><article-title>Individual comparisons by ranking methods</article-title><source>Biometrics Bulletin</source><volume>1</volume><year>1945</year><fpage>80</fpage><lpage>83</lpage></element-citation></ref><ref id="R10"><label>10</label><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Mann</surname><given-names>HB</given-names></name><name><surname>Whitney</surname><given-names>DR</given-names></name></person-group><article-title>On a Test of Whether one of Two Random Variables is Stochastically Larger than the Other</article-title><source>Annals of Mathematical Statistics</source><volume>18</volume><year>1947</year><fpage>50</fpage><lpage>60</lpage></element-citation></ref><ref id="R11"><label>11</label><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Williams</surname><given-names>RL</given-names></name><name><surname>Perritt</surname><given-names>RL</given-names></name></person-group><article-title>The weighted median test for finite population samples</article-title><source>Proceedings of the section on survey research methods</source><publisher-name>American Statistical Association</publisher-name><publisher-loc>Washington, D.C.</publisher-loc><year>1986</year><fpage>676</fpage><lpage>678</lpage></element-citation></ref><ref id="R12"><label>12</label><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Lumley</surname><given-names>T</given-names></name><name><surname>Scott</surname><given-names>A</given-names></name></person-group><article-title>Two-sample rank tests under complex sampling</article-title><source>Technique Report Department of Statistics</source><publisher-name>University of Auckland</publisher-name><year>2012</year></element-citation></ref><ref id="R13"><label>13</label><element-citation publication-type="web"><collab>R package &#x0201c;Survey&#x0201d;</collab><year>2012</year><comment><ext-link ext-link-type="uri" xlink:href="http://cran.r-project.org/web/packages/survey/index.html">http://cran.r-project.org/web/packages/survey/index.html</ext-link></comment><date-in-citation>Accessed: 02/12/2013</date-in-citation></element-citation></ref><ref id="R14"><label>14</label><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Lumley</surname><given-names>T</given-names></name></person-group><article-title>Analysis of complex survey samples</article-title><source>Journal of Statistical Software</source><volume>9</volume><year>2004</year><fpage>1</fpage><lpage>19</lpage></element-citation></ref><ref id="R15"><label>15</label><element-citation publication-type="web"><collab>About the National Health and Nutrition Examination Survey. U.S. Centers for Disease Control and Prevention</collab><year>2012</year><comment><ext-link ext-link-type="uri" xlink:href="http://www.cdc.gov/nchs/nhanes.htm">http://www.cdc.gov/nchs/nhanes.htm</ext-link></comment><date-in-citation>Last accessed: 02/12/2012</date-in-citation></element-citation></ref><ref id="R16"><label>16</label><element-citation publication-type="journal"><collab>World Health Organization</collab><article-title>Assessment of iodine deficiency disorders and monitoring their eliminationa guide for programme managers</article-title><edition>Third</edition><year>2008</year></element-citation></ref><ref id="R17"><label>17</label><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Lumley</surname><given-names>T</given-names></name></person-group><source>Complex Surveys: a guide to analysis using R</source><publisher-name>John Wiley &#x00026; Sons</publisher-name><year>2011</year></element-citation></ref></ref-list></back><floats-group><table-wrap id="T1" position="float" orientation="portrait"><label>Table 1</label><caption><p id="P27">Test the Equality of Medians between Males and Females in NHANES, 2009&#x02013;2010.</p></caption><table frame="box" rules="cols"><tbody><tr><td align="left" rowspan="1" colspan="1"><bold>Description</bold></td><td align="left" rowspan="1" colspan="1">Test the equality of median urinary iodine between females and males in NHANES 2009&#x02013;2010. &#x0201c;variable&#x0201d; =1 is male while 2 is female. &#x0201c;analyte&#x0201d; denotes the urinary iodine measurements.</td></tr><tr><td align="left" colspan="2" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="left" rowspan="1" colspan="1"><bold>Original Dataset</bold></td><td align="left" rowspan="1" colspan="1">variablecluster&#x02003;strata&#x02003;analyte&#x02003;weight</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">1&#x02003;&#x02003;2&#x02003;&#x02003;86&#x02003;&#x02003;62.9&#x02003;&#x02003;30020.66</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">2&#x02003;&#x02003;2&#x02003;&#x02003;85&#x02003;&#x02003;147.1&#x02003;223481.95</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">1&#x02003;&#x02003;1&#x02003;&#x02003;86&#x02003;&#x02003;201.7&#x02003;30628.62</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">1&#x02003;&#x02003;1&#x02003;&#x02003;75&#x02003;&#x02003;319.7&#x02003;29664.02</td></tr><tr><td align="left" colspan="2" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="left" rowspan="1" colspan="1"><bold>SAS code</bold></td><td align="left" rowspan="1" colspan="1">libname nhanes "D:\data";</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">%include 'D:\Quatile Test\program\Weighted_quatile_test.sas';</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">%test_quan(dataset=nhanes.test1, analyte=analyte, variable=variable, group=2, quantile=143.5, weight=weight, strata=strata, cluster=cluster);</td></tr><tr><td align="left" colspan="2" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="left" rowspan="1" colspan="1"><bold>R code</bold></td><td align="left" rowspan="1" colspan="1">data&#x0003c;- read.csv("D:/data/test1.csv&#x0201d;, header=T)</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">test.quan(dataset=data, group=2, quantile=143.5)</td></tr><tr><td align="left" colspan="2" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="left" rowspan="1" colspan="1"><bold>Output</bold></td><td align="left" rowspan="1" colspan="1">P&#x02003;&#x02003;SE_P&#x02003;&#x02003;COVV_P&#x02003;&#x02003;Chi&#x02003;P_Value</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">0.469 0.0217 0.0005 0.0002 8.261 0.004</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">0.529 0.0174 0.0002 0.0003</td></tr></tbody></table></table-wrap><table-wrap id="T2" position="float" orientation="portrait"><label>Table 2</label><caption><p id="P28">Test the Equality of 75th Percentiles among Three Groups in NHANES, 2007&#x02013;2008</p></caption><table frame="box" rules="cols"><tbody><tr><td align="left" rowspan="1" colspan="1"><bold>Description</bold></td><td align="left" rowspan="1" colspan="1">Test the equality of 75<sup>th</sup> percentile of urinary iodine among three salt consumption groups (never or rare, occasionally and very often). &#x0201c;variable&#x0201d;=1 means never or rare consume salt; 2 means occasionally consume salt and 3 means very often consume salt. &#x0201c;analyte&#x0201d; still denotes urinary iodine.</td></tr><tr><td align="left" colspan="2" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="left" rowspan="1" colspan="1"><bold>Original Dataset</bold></td><td align="left" rowspan="1" colspan="1">&#x02003;<bold>variable</bold>&#x02003;<bold>cluster</bold>&#x02003;<bold>strata</bold>&#x02003;<bold>analyte</bold>&#x02003;<bold>weight</bold></td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">&#x02003;&#x02003;3&#x02003;&#x02003;1&#x02003;&#x02003;60&#x02003;&#x02003;210.1&#x02003;&#x02003;60045.77</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">&#x02003;&#x02003;2&#x02003;&#x02003;1&#x02003;&#x02003;70&#x02003;&#x02003;244.6&#x02003;&#x02003;35353.21</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">&#x02003;&#x02003;3&#x02003;&#x02003;1&#x02003;&#x02003;67&#x02003;&#x02003;&#x02003;364.3&#x02003;&#x02003;10074.15</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">&#x02003;&#x02003;3&#x02003;&#x02003;1&#x02003;&#x02003;70&#x02003;&#x02003;224.3&#x02003;&#x02003;9234.06</td></tr><tr><td align="left" colspan="2" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="left" rowspan="1" colspan="1"><bold>SAS code</bold></td><td align="left" rowspan="1" colspan="1">libname nhanes "D:\data";</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">%include 'D:\Quatile Test\program\Weighted_quatile_test.sas';</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">%test_quan(data=nhanes.test2, analyte=analyte, variable=variable, group=3, quantile=281.7, weight=weight, strata=strata, cluster=cluster);</td></tr><tr><td align="left" colspan="2" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="left" rowspan="1" colspan="1"><bold>R code</bold></td><td align="left" rowspan="1" colspan="1">data&#x0003c;- read.csv("D:/data/test2.csv&#x0201d;, header=T)</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">test.quan(dataset=data, group=2, quantile=281.7)</td></tr><tr><td align="left" colspan="2" valign="bottom" rowspan="1">
<hr/></td></tr><tr><td align="left" rowspan="1" colspan="1"><bold>Output</bold></td><td align="left" rowspan="1" colspan="1">P&#x02003;&#x02003;SE_P&#x02003;&#x02003;COVV_P&#x02003;&#x02003;Chi&#x02003;&#x02003;P_Value</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">0.740 0.0246 0.0006 0.0002 0.0001 1.220&#x02003;0.543</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">0.747 0.0134 0.0002 0.0002 0.0001</td></tr><tr><td align="left" rowspan="1" colspan="1"/><td align="left" rowspan="1" colspan="1">0.760 0.0116 0.0001 0.0001 0.0001</td></tr></tbody></table></table-wrap></floats-group></article>