<?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 Multilevel Regression and Poststratification in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Multilevel-Regression-and-Poststratification/m-p/231548#M54578</link>
    <description>&lt;P&gt;I'm trying do multilevel regression and poststratification based on this paper:&amp;nbsp;&lt;A href="http://aje.oxfordjournals.org/content/179/8/1025.short" target="_blank"&gt;http://aje.oxfordjournals.org/content/179/8/1025.short&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I stuck the model prediction&amp;nbsp;step now.&amp;nbsp;I found their lecture note online&amp;nbsp;(online note: &lt;A href="http://www.cste2.org/webinars/webinarpdfs/GeospatialDataMethods82313.pdf)" target="_blank"&gt;http://www.cste2.org/webinars/webinarpdfs/GeospatialDataMethods82313.pdf)&lt;/A&gt; and try to modify it because I focused&amp;nbsp;on county-level not census track block.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My codes as following:&lt;/P&gt;&lt;P&gt;proc GLIMMIX data=brfss.b12c_sr noclprint;&lt;BR /&gt;class FIPS_C state Ragegrp sex Rrace4&lt;BR /&gt;Rrurality2 ad_mean;&lt;BR /&gt;model MH (EVENT='1') =&lt;BR /&gt;Ragegrp&lt;BR /&gt;sex&lt;BR /&gt;Rrace4&lt;BR /&gt;Rrurality2 ad_mean&lt;BR /&gt;/dist=binary solution;&lt;BR /&gt;random state fips_c(state) / solution;&lt;BR /&gt;weight rw;&lt;BR /&gt;ods output&lt;BR /&gt;parameterEstimates=beta_fixed&lt;BR /&gt;SolutionR=beta_random;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MACRO SIMU(outcome=, year=);&lt;BR /&gt;%do i=1 %to 1000;&lt;BR /&gt;data temp1; set beta&amp;amp;year._&amp;amp;outcome;&lt;BR /&gt;xbeta=int+int_se*rannor(ABS(INT(RAND('UNIFORM')*100000)))&lt;BR /&gt;+agegrp+age_se*rannor(ABS(INT(RAND('UNIFORM')*100000)))&lt;BR /&gt;+sexgrp+sex_se*rannor(ABS(INT(RAND('UNIFORM')*100000)))&lt;BR /&gt;+race4+race4_se*rannor(ABS(INT(RAND('UNIFORM')*100000)))&lt;BR /&gt;+fips_c+fips_c_se*rannor(ABS(INT(RAND('UNIFORM')*100000)))&lt;BR /&gt;+state+state_se*rannor(ABS(INT(RAND('UNIFORM')*100000)))&lt;BR /&gt;+ad_mean*(ad_mean+ad_mean_se*rannor(ABS(INT(RAND('UNIFORM')*100000))))&lt;BR /&gt;;&lt;BR /&gt;p=exp(xbeta)/(1+exp(xbeta));&lt;BR /&gt;keep fips_c pop p;&lt;BR /&gt;run;&lt;BR /&gt;*summarize obesity by block (or county, or congressional district);&lt;BR /&gt;proc sql;&lt;BR /&gt;create table temp2 as&lt;BR /&gt;select distinct fips_c, sum(pop) as pop, (sum(p*pop)/sum(pop))*100 as &amp;amp;outcome&lt;BR /&gt;from temp1&lt;BR /&gt;group by fips_C;&lt;BR /&gt;quit;&lt;BR /&gt;proc append base=temp3 data=temp2 force;run;&lt;BR /&gt;%MEND;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it shows error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: There were 1 unclosed %DO statements. The macro SIMU will not be compiled.&lt;BR /&gt;ERROR: A dummy macro will be compiled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone ever done it before or know how should I modify&amp;nbsp;it? Thank you so much!&lt;/P&gt;</description>
    <pubDate>Sun, 25 Oct 2015 15:20:31 GMT</pubDate>
    <dc:creator>Lynnctc</dc:creator>
    <dc:date>2015-10-25T15:20:31Z</dc:date>
    <item>
      <title>Multilevel Regression and Poststratification</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multilevel-Regression-and-Poststratification/m-p/231548#M54578</link>
      <description>&lt;P&gt;I'm trying do multilevel regression and poststratification based on this paper:&amp;nbsp;&lt;A href="http://aje.oxfordjournals.org/content/179/8/1025.short" target="_blank"&gt;http://aje.oxfordjournals.org/content/179/8/1025.short&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I stuck the model prediction&amp;nbsp;step now.&amp;nbsp;I found their lecture note online&amp;nbsp;(online note: &lt;A href="http://www.cste2.org/webinars/webinarpdfs/GeospatialDataMethods82313.pdf)" target="_blank"&gt;http://www.cste2.org/webinars/webinarpdfs/GeospatialDataMethods82313.pdf)&lt;/A&gt; and try to modify it because I focused&amp;nbsp;on county-level not census track block.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My codes as following:&lt;/P&gt;&lt;P&gt;proc GLIMMIX data=brfss.b12c_sr noclprint;&lt;BR /&gt;class FIPS_C state Ragegrp sex Rrace4&lt;BR /&gt;Rrurality2 ad_mean;&lt;BR /&gt;model MH (EVENT='1') =&lt;BR /&gt;Ragegrp&lt;BR /&gt;sex&lt;BR /&gt;Rrace4&lt;BR /&gt;Rrurality2 ad_mean&lt;BR /&gt;/dist=binary solution;&lt;BR /&gt;random state fips_c(state) / solution;&lt;BR /&gt;weight rw;&lt;BR /&gt;ods output&lt;BR /&gt;parameterEstimates=beta_fixed&lt;BR /&gt;SolutionR=beta_random;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MACRO SIMU(outcome=, year=);&lt;BR /&gt;%do i=1 %to 1000;&lt;BR /&gt;data temp1; set beta&amp;amp;year._&amp;amp;outcome;&lt;BR /&gt;xbeta=int+int_se*rannor(ABS(INT(RAND('UNIFORM')*100000)))&lt;BR /&gt;+agegrp+age_se*rannor(ABS(INT(RAND('UNIFORM')*100000)))&lt;BR /&gt;+sexgrp+sex_se*rannor(ABS(INT(RAND('UNIFORM')*100000)))&lt;BR /&gt;+race4+race4_se*rannor(ABS(INT(RAND('UNIFORM')*100000)))&lt;BR /&gt;+fips_c+fips_c_se*rannor(ABS(INT(RAND('UNIFORM')*100000)))&lt;BR /&gt;+state+state_se*rannor(ABS(INT(RAND('UNIFORM')*100000)))&lt;BR /&gt;+ad_mean*(ad_mean+ad_mean_se*rannor(ABS(INT(RAND('UNIFORM')*100000))))&lt;BR /&gt;;&lt;BR /&gt;p=exp(xbeta)/(1+exp(xbeta));&lt;BR /&gt;keep fips_c pop p;&lt;BR /&gt;run;&lt;BR /&gt;*summarize obesity by block (or county, or congressional district);&lt;BR /&gt;proc sql;&lt;BR /&gt;create table temp2 as&lt;BR /&gt;select distinct fips_c, sum(pop) as pop, (sum(p*pop)/sum(pop))*100 as &amp;amp;outcome&lt;BR /&gt;from temp1&lt;BR /&gt;group by fips_C;&lt;BR /&gt;quit;&lt;BR /&gt;proc append base=temp3 data=temp2 force;run;&lt;BR /&gt;%MEND;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it shows error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: There were 1 unclosed %DO statements. The macro SIMU will not be compiled.&lt;BR /&gt;ERROR: A dummy macro will be compiled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone ever done it before or know how should I modify&amp;nbsp;it? Thank you so much!&lt;/P&gt;</description>
      <pubDate>Sun, 25 Oct 2015 15:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multilevel-Regression-and-Poststratification/m-p/231548#M54578</guid>
      <dc:creator>Lynnctc</dc:creator>
      <dc:date>2015-10-25T15:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Multilevel Regression and Poststratification</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multilevel-Regression-and-Poststratification/m-p/231569#M54581</link>
      <description>&lt;P&gt;The error message states that your&amp;nbsp;DO block started with&amp;nbsp;statement&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%do i=1 %to 1000;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;is never terminated by a &lt;STRONG&gt;%end;&lt;/STRONG&gt; statement. I guess it should be inserted just before&amp;nbsp;&lt;STRONG&gt;%MEND;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2015 00:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multilevel-Regression-and-Poststratification/m-p/231569#M54581</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-10-26T00:27:48Z</dc:date>
    </item>
  </channel>
</rss>

