<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic &amp;quot;Filtering&amp;quot; data for analysis with DOMAIN statements in Programming 1 and 2</title>
    <link>https://communities.sas.com/t5/Programming-1-and-2/quot-Filtering-quot-data-for-analysis-with-DOMAIN-statements/m-p/878120#M1367</link>
    <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;I am working with the NHANES 2011-2018 data and I am trying to exclude the "Don't Know", "Refused", and missing responses from the analysis. Following the suggestions in &lt;A href="https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYFREQ-DOMAIN-for-subgroup-analyses/td-p/817169" target="_blank" rel="noopener"&gt;this thread&lt;/A&gt;, I created a variable, &lt;FONT face="monospace"&gt;ANALYSIS&lt;/FONT&gt;&amp;nbsp;for the observations I wanted to include in my analysis:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA data.DSdec_cd;
    SET data.DSdec;
    KEEP RIAGENDR RIDAGEYR DMDYRSUS
         DMDEDUC2 INDFMPIR ACD040
         SDMVSTRA SDMVPSU WTINT10YR
         FSDHH ANALYSIS;
    IF (DMDYRSUS IN (1:9)
        AND
        DMDEDUC2 IN (1:5)
        AND
        INDFMPIR ge 0
        AND
        ACD040 IN (1:5)
        AND
        FSDHH IN (1:4))
      THEN ANALYSIS = 1;
    ELSE ANALYSIS = 0;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, the following SURVEYLOGISTIC procedure:&lt;/P&gt;&lt;PRE&gt;PROC SURVEYLOGISTIC data = data.DSdec_cd order = data NOMCAR;&lt;BR /&gt;    DOMAIN ANALYSIS ("1");&lt;BR /&gt;    STRATA SDMVSTRA;&lt;BR /&gt;    CLUSTER SDMVPSU;&lt;BR /&gt;    WEIGHT WTINT10YR;&lt;BR /&gt;    CLASS RIAGENDR (REF = LAST)&lt;BR /&gt;          DMDYRSUS (REF = FIRST)&lt;BR /&gt;          DMDEDUC2 (REF = FIRST)&lt;BR /&gt;          ACD040 (REF = FIRST)&lt;BR /&gt;          FSDHH (REF = FIRST) / PARAM = REF;&lt;BR /&gt;    MODEL FSDHH  = RIAGENDR&lt;BR /&gt;                   RIDAGEYR&lt;BR /&gt;                   ACD040 / CLODDS;&lt;BR /&gt;    ODS SELECT Domain2.CLOdds;&lt;BR /&gt;RUN;&lt;/PRE&gt;&lt;P&gt;It still includes the "Don't Know" (7) and "Refused" (9) categories. I don't understand why they are still included or if it's possible to exclude them from the analysis or at least the output. I've used WHERE statements to subset the data, but I understand that that is not the way to restrict the analysis to a subset of the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also wondering how to get Wald confidence limits with SURVEYLOGISTIC,&amp;nbsp; as the documentation say that I can but does not do by default.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 29 May 2023 23:40:17 GMT</pubDate>
    <dc:creator>MichaelMcG</dc:creator>
    <dc:date>2023-05-29T23:40:17Z</dc:date>
    <item>
      <title>"Filtering" data for analysis with DOMAIN statements</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/quot-Filtering-quot-data-for-analysis-with-DOMAIN-statements/m-p/878120#M1367</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;I am working with the NHANES 2011-2018 data and I am trying to exclude the "Don't Know", "Refused", and missing responses from the analysis. Following the suggestions in &lt;A href="https://communities.sas.com/t5/Statistical-Procedures/PROC-SURVEYFREQ-DOMAIN-for-subgroup-analyses/td-p/817169" target="_blank" rel="noopener"&gt;this thread&lt;/A&gt;, I created a variable, &lt;FONT face="monospace"&gt;ANALYSIS&lt;/FONT&gt;&amp;nbsp;for the observations I wanted to include in my analysis:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA data.DSdec_cd;
    SET data.DSdec;
    KEEP RIAGENDR RIDAGEYR DMDYRSUS
         DMDEDUC2 INDFMPIR ACD040
         SDMVSTRA SDMVPSU WTINT10YR
         FSDHH ANALYSIS;
    IF (DMDYRSUS IN (1:9)
        AND
        DMDEDUC2 IN (1:5)
        AND
        INDFMPIR ge 0
        AND
        ACD040 IN (1:5)
        AND
        FSDHH IN (1:4))
      THEN ANALYSIS = 1;
    ELSE ANALYSIS = 0;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, the following SURVEYLOGISTIC procedure:&lt;/P&gt;&lt;PRE&gt;PROC SURVEYLOGISTIC data = data.DSdec_cd order = data NOMCAR;&lt;BR /&gt;    DOMAIN ANALYSIS ("1");&lt;BR /&gt;    STRATA SDMVSTRA;&lt;BR /&gt;    CLUSTER SDMVPSU;&lt;BR /&gt;    WEIGHT WTINT10YR;&lt;BR /&gt;    CLASS RIAGENDR (REF = LAST)&lt;BR /&gt;          DMDYRSUS (REF = FIRST)&lt;BR /&gt;          DMDEDUC2 (REF = FIRST)&lt;BR /&gt;          ACD040 (REF = FIRST)&lt;BR /&gt;          FSDHH (REF = FIRST) / PARAM = REF;&lt;BR /&gt;    MODEL FSDHH  = RIAGENDR&lt;BR /&gt;                   RIDAGEYR&lt;BR /&gt;                   ACD040 / CLODDS;&lt;BR /&gt;    ODS SELECT Domain2.CLOdds;&lt;BR /&gt;RUN;&lt;/PRE&gt;&lt;P&gt;It still includes the "Don't Know" (7) and "Refused" (9) categories. I don't understand why they are still included or if it's possible to exclude them from the analysis or at least the output. I've used WHERE statements to subset the data, but I understand that that is not the way to restrict the analysis to a subset of the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also wondering how to get Wald confidence limits with SURVEYLOGISTIC,&amp;nbsp; as the documentation say that I can but does not do by default.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 29 May 2023 23:40:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/quot-Filtering-quot-data-for-analysis-with-DOMAIN-statements/m-p/878120#M1367</guid>
      <dc:creator>MichaelMcG</dc:creator>
      <dc:date>2023-05-29T23:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: "Filtering" data for analysis with DOMAIN statements</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/quot-Filtering-quot-data-for-analysis-with-DOMAIN-statements/m-p/878127#M1368</link>
      <description>&lt;P&gt;WHICH Variables have the unwanted "Don't Know" or "Refused" categories?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What your analysis variable does is segregate observations, it does not remove any values of "Don't Know" or&amp;nbsp; "Refused".&lt;/P&gt;
&lt;P&gt;From the documentation for the DOMAIN statement for Surveylogistic: (emphasis added). So you get an analysis of the subpopulation where analysis = 1 and all of the observations.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xis-refProc"&gt;
&lt;DIV id="statug.surveylogistic.domainstmt" class="AAsection"&gt;
&lt;P&gt;The DOMAIN statement requests analysis for domains (subpopulations) &lt;FONT color="#FF00FF"&gt;&lt;STRONG&gt;in addition&lt;/STRONG&gt; &lt;/FONT&gt;to analysis for the entire study population.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Typically you set the variables to MISSING, which means the observations will be excluded from the model OR recode them to another category you do want to include.&lt;/P&gt;
&lt;P&gt;Setting to missing would be something like&lt;/P&gt;
&lt;PRE&gt;If var in (7, 9) then call missing(var);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 00:44:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/quot-Filtering-quot-data-for-analysis-with-DOMAIN-statements/m-p/878127#M1368</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-05-30T00:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: "Filtering" data for analysis with DOMAIN statements</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/quot-Filtering-quot-data-for-analysis-with-DOMAIN-statements/m-p/878144#M1369</link>
      <description>&lt;P&gt;You could use the "where=" filter on your input dataset to proc surveylogistic, as in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SURVEYLOGISTIC data = data.DSdec_cd (where=(analysis=1)) order = data NOMCAR;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And then you wouldn't need the DOMAIN statement.&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 03:03:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/quot-Filtering-quot-data-for-analysis-with-DOMAIN-statements/m-p/878144#M1369</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2023-05-30T03:03:48Z</dc:date>
    </item>
  </channel>
</rss>

