<?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 Normalizing Survey Weights in PROC SURVEYLOGISTIC? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Normalizing-Survey-Weights-in-PROC-SURVEYLOGISTIC/m-p/776153#M38017</link>
    <description>&lt;P&gt;I had been using PROC LOGISTIC to run a logistic regression model but then it was rightly pointed out to me that&amp;nbsp;&lt;BR /&gt;if I am using survey weights then I should be using PROC SURVEYLOGISTIC. In the regular PROC LOGISTIC there is an option "NORM" to normalize weights in the weight statement but this does not exist in the PROC SURVEYLOGISTIC - is there another way to do this? Or does this proc do this automatically somehow?&amp;nbsp; (See below sample code).&amp;nbsp;&lt;/P&gt;&lt;P&gt;All I am really trying to do is to output predicted probabilities for the main outcome (SC_ETHRACE_AM) by the main Predictor (V_ASIAN) while controlling for all others (age5, sex, edu-level, etc..). But I need to normalize the weights. Any ideas?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc surveylogistic data=work.SI_v2;
CLASS V_ASIAN (ref='3') AGE5(ref='3') SEX (Ref='1') EDU_LEVEL (ref='4') REGION (ref='3') DLFS (REF='1') / param=ref;
model SC_ETHRACE_AM (event='1')=V_ASIAN age5 sex edu_level region dlfs;
weight wght_per  ;
lsmeans SC_ETHRACE_AM / ilink cl; run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Oct 2021 09:27:56 GMT</pubDate>
    <dc:creator>AlexPaezSilva</dc:creator>
    <dc:date>2021-10-25T09:27:56Z</dc:date>
    <item>
      <title>Normalizing Survey Weights in PROC SURVEYLOGISTIC?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Normalizing-Survey-Weights-in-PROC-SURVEYLOGISTIC/m-p/776153#M38017</link>
      <description>&lt;P&gt;I had been using PROC LOGISTIC to run a logistic regression model but then it was rightly pointed out to me that&amp;nbsp;&lt;BR /&gt;if I am using survey weights then I should be using PROC SURVEYLOGISTIC. In the regular PROC LOGISTIC there is an option "NORM" to normalize weights in the weight statement but this does not exist in the PROC SURVEYLOGISTIC - is there another way to do this? Or does this proc do this automatically somehow?&amp;nbsp; (See below sample code).&amp;nbsp;&lt;/P&gt;&lt;P&gt;All I am really trying to do is to output predicted probabilities for the main outcome (SC_ETHRACE_AM) by the main Predictor (V_ASIAN) while controlling for all others (age5, sex, edu-level, etc..). But I need to normalize the weights. Any ideas?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc surveylogistic data=work.SI_v2;
CLASS V_ASIAN (ref='3') AGE5(ref='3') SEX (Ref='1') EDU_LEVEL (ref='4') REGION (ref='3') DLFS (REF='1') / param=ref;
model SC_ETHRACE_AM (event='1')=V_ASIAN age5 sex edu_level region dlfs;
weight wght_per  ;
lsmeans SC_ETHRACE_AM / ilink cl; run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 09:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Normalizing-Survey-Weights-in-PROC-SURVEYLOGISTIC/m-p/776153#M38017</guid>
      <dc:creator>AlexPaezSilva</dc:creator>
      <dc:date>2021-10-25T09:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Normalizing Survey Weights in PROC SURVEYLOGISTIC?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Normalizing-Survey-Weights-in-PROC-SURVEYLOGISTIC/m-p/776161#M38018</link>
      <description>&lt;P&gt;If you want it to do the exact same thing as in PROC LOGISTIC, you could normalize the weights yourself in a DATA step before your run PROC SURVEYLOGISTIC.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 10:34:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Normalizing-Survey-Weights-in-PROC-SURVEYLOGISTIC/m-p/776161#M38018</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-10-25T10:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: Normalizing Survey Weights in PROC SURVEYLOGISTIC?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Normalizing-Survey-Weights-in-PROC-SURVEYLOGISTIC/m-p/776182#M38019</link>
      <description>&lt;P&gt;Here is a simple example of how to normalize the weights so that they sum to the sample size--you would then use the new weights in the WEIGHT statement in SURVEYLOGISTIC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*Create a Sample Dataset to work with*/&lt;BR /&gt;data test;&lt;BR /&gt;seed=2534565;&lt;BR /&gt;do i=1 to 1000;&lt;BR /&gt;weight=i/7;&lt;BR /&gt;x1=ranuni(seed);&lt;BR /&gt;logit=-2 + 2*x1;&lt;BR /&gt;p=exp(-logit)/(1+exp(-logit));&lt;BR /&gt;if ranuni(seed)&amp;gt;p then y=1; else y=0;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;/*Calculate the sum of the weights*/&lt;BR /&gt;proc means data=test noprint sum;&lt;BR /&gt;var weight;&lt;BR /&gt;output out=weight_sum sum=sum_wt;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;/*Calculate the normalized weight for each observation*/&lt;BR /&gt;data normalize;set test;&lt;BR /&gt;if _n_=1 then set weight_sum;&lt;BR /&gt;normwt=_FREQ_*(weight/sum_wt);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc surveylogistic data=normalize;&lt;BR /&gt;weight normwt;&lt;BR /&gt;title 'SURVEYLOGISTIC with the normalized weights that were created';&lt;BR /&gt;model y=x1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 12:53:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Normalizing-Survey-Weights-in-PROC-SURVEYLOGISTIC/m-p/776182#M38019</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2021-10-25T12:53:21Z</dc:date>
    </item>
  </channel>
</rss>

