<?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 Re: Pooling frequencies after multiple imputation in SAS in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Pooling-frequencies-after-multiple-imputation-in-SAS/m-p/693170#M33448</link>
    <description>&lt;P&gt;In order to combine point estimates for any statistic in a multiple imputation setting, you must have a standard error associated with that point estimate.&amp;nbsp;&amp;nbsp;&lt;SPAN class="cs53F207AF"&gt;The issue with using Proc FREQ is that it does not give you standard errors for either the percentages or the frequencies. &amp;nbsp;My suggestion would be to use Proc SURVEYFREQ instead and combine the results similar to the approach in the attached example.&amp;nbsp; Note that you must use the WTFREQ option on the TABLES statement even if you do not have a WEIGHT statement in order to get a standard error.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* Generate Data */&lt;/P&gt;
&lt;P&gt;proc format;&lt;BR /&gt;value ResponseCode 1 = 'Very Unsatisfied'&lt;BR /&gt;2 = 'Unsatisfied'&lt;BR /&gt;3 = 'Neutral'&lt;BR /&gt;4 = 'Satisfied'&lt;BR /&gt;5 = 'Very Satisfied';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc format;&lt;BR /&gt;value UserCode 1 = 'New Customer'&lt;BR /&gt;0 = 'Renewal Customer';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc format;&lt;BR /&gt;value SchoolCode 1 = 'Middle School'&lt;BR /&gt;2 = 'High School';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc format;&lt;BR /&gt;value DeptCode 0 = 'Faculty'&lt;BR /&gt;1 = 'Admin/Guidance';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data SIS_Survey;&lt;BR /&gt;format Response ResponseCode.;&lt;BR /&gt;format NewUser UserCode.;&lt;BR /&gt;format SchoolType SchoolCode.;&lt;BR /&gt;format Department DeptCode.;&lt;BR /&gt;do _imputation_=1 to 2;&lt;BR /&gt;drop j;&lt;BR /&gt;retain seed1 111;&lt;BR /&gt;retain seed2 222;&lt;BR /&gt;retain seed3 333;&lt;/P&gt;
&lt;P&gt;State = 'GA';&lt;/P&gt;
&lt;P&gt;NewUser = 1;&lt;BR /&gt;do School=1 to 71;&lt;/P&gt;
&lt;P&gt;call rantbl( seed1, .45, .55, SchoolType );&lt;/P&gt;
&lt;P&gt;Department = 0;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 25 + x * 2;&lt;BR /&gt;do j=1 to 2;&lt;BR /&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .16, .21, .30, .24, .09, Response);&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .18, .23, .30, .22, .07, Response);&lt;BR /&gt;output; end;&lt;BR /&gt;output;&lt;/P&gt;
&lt;P&gt;Department = 1;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 15 + x * 1.5;&lt;BR /&gt;do j=1 to 2;&lt;BR /&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .10, .15, .33, .28, .14, Response );&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .13, .20, .30, .26, .11, Response);&lt;BR /&gt;output; end;&lt;BR /&gt;end;&lt;/P&gt;
&lt;P&gt;NewUser = 0;&lt;BR /&gt;do School=72 to 134;&lt;/P&gt;
&lt;P&gt;call rantbl( seed1, .45, .55, SchoolType );&lt;/P&gt;
&lt;P&gt;Department = 0;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 25 + x * 2;&lt;BR /&gt;do j=1 to 2;&lt;BR /&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .16, .21, .30, .24, .09, Response);&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .18, .23, .30, .22, .07, Response);&lt;BR /&gt;output; end;&lt;BR /&gt;output;&lt;/P&gt;
&lt;P&gt;Department = 1;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 15 + x * 1.5;&lt;BR /&gt;do j=1 to 2;&lt;BR /&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .10, .15, .33, .28, .14, Response );&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .13, .20, .30, .26, .11, Response);&lt;BR /&gt;output; end;&lt;BR /&gt;end;&lt;/P&gt;
&lt;P&gt;State = 'NC';&lt;/P&gt;
&lt;P&gt;NewUser = 1;&lt;BR /&gt;do School = 135 to 218;&lt;/P&gt;
&lt;P&gt;call rantbl( seed1, .45, .55, SchoolType );&lt;/P&gt;
&lt;P&gt;Department = 0;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 25 + x * 2;&lt;/P&gt;
&lt;P&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .16, .21, .30, .24, .09, Response);&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .18, .23, .30, .22, .07, Response);&lt;BR /&gt;output; output;&lt;BR /&gt;output;&lt;/P&gt;
&lt;P&gt;Department = 1;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 15 + x * 1.5;&lt;/P&gt;
&lt;P&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .10, .15, .33, .28, .14, Response );&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .13, .20, .30, .26, .11, Response);&lt;BR /&gt;output; output;&lt;BR /&gt;end;&lt;/P&gt;
&lt;P&gt;NewUser = 0;&lt;BR /&gt;do School = 219 to 274;&lt;/P&gt;
&lt;P&gt;call rantbl( seed1, .45, .55, SchoolType );&lt;/P&gt;
&lt;P&gt;Department = 0;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 25 + x * 2;&lt;BR /&gt;do j=1 to 2;&lt;BR /&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .16, .21, .30, .24, .09, Response);&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .18, .23, .30, .22, .07, Response);&lt;BR /&gt;output; end;&lt;BR /&gt;output;&lt;/P&gt;
&lt;P&gt;Department = 1;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 15 + x * 1.5;&lt;/P&gt;
&lt;P&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .10, .15, .33, .28, .14, Response );&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .13, .20, .30, .26, .11, Response);&lt;BR /&gt;output; output;&lt;BR /&gt;end;&lt;/P&gt;
&lt;P&gt;State = 'SC';&lt;/P&gt;
&lt;P&gt;NewUser = 1;&lt;BR /&gt;do School = 275 to 328;&lt;/P&gt;
&lt;P&gt;call rantbl( seed1, .45, .55, SchoolType );&lt;/P&gt;
&lt;P&gt;Department = 0;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 25 + x * 2;&lt;BR /&gt;do j=1 to 2;&lt;BR /&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .16, .21, .30, .24, .09, Response);&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .18, .23, .30, .22, .07, Response);&lt;BR /&gt;output; end;&lt;BR /&gt;output;&lt;/P&gt;
&lt;P&gt;Department = 1;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 15 + x * 1.5;&lt;/P&gt;
&lt;P&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .10, .15, .33, .28, .14, Response );&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .13, .20, .30, .26, .11, Response);&lt;BR /&gt;output; output;&lt;BR /&gt;end;&lt;/P&gt;
&lt;P&gt;NewUser = 0;&lt;BR /&gt;do School = 329 to 370;&lt;/P&gt;
&lt;P&gt;call rantbl( seed1, .45, .55, SchoolType );&lt;/P&gt;
&lt;P&gt;Department = 0;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 25 + x * 2;&lt;BR /&gt;do j=1 to 2;&lt;BR /&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .16, .21, .30, .24, .09, Response);&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .18, .23, .30, .22, .07, Response);&lt;BR /&gt;output; end;&lt;BR /&gt;output;&lt;/P&gt;
&lt;P&gt;Department = 1;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 15 + x * 1.5;&lt;/P&gt;
&lt;P&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .10, .15, .33, .28, .14, Response );&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .13, .20, .30, .26, .11, Response);&lt;BR /&gt;output; output;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;/*Run SURVEYFREQ by _IMPUTATION_ assuming the MI step is already done*/&lt;BR /&gt;proc surveyfreq data=SIS_Survey;&lt;BR /&gt;by _imputation_;&lt;BR /&gt;tables Response*schooltype/wtfreq;&lt;BR /&gt;ods output CrossTabs=mi_ctab;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;/*Sort the data by the TABLES variables which is called RESPONSE here*/&lt;BR /&gt;proc sort data=mi_ctab;&lt;BR /&gt;by response schooltype _imputation_;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;/*Run MIANALYZE with STDERR option*/&lt;BR /&gt;proc mianalyze data=mi_ctab;&lt;BR /&gt;by response schooltype;*this would be the TABLES variable;&lt;BR /&gt;modeleffects wgtfreq;&lt;BR /&gt;stderr stdDev;&lt;BR /&gt;title 'Results for Weighted Frequency';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="cs53F207AF"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs53F207AF"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Oct 2020 13:21:25 GMT</pubDate>
    <dc:creator>SAS_Rob</dc:creator>
    <dc:date>2020-10-21T13:21:25Z</dc:date>
    <item>
      <title>Pooling frequencies after multiple imputation in SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Pooling-frequencies-after-multiple-imputation-in-SAS/m-p/693098#M33442</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have imputed data using multiple imputation using PROC MI in SAS, generating n imputed datasets. Now, I would like to report a baseline table with imputed values. However, I cannot find the right SAS code to do so. I've used PROC FREQ using a BY _ imputation _ statement, to get n baseline tables. I want to combine these n tables into just one, with pooled frequencies for every category of the covariates.&lt;/P&gt;&lt;P&gt;Apparently this is fairly easy in SPSS but not in SAS. I found some topics suggesting PROC MIANALYZE, which might be a solution, but the examples I found only considered estimates in for example regression models. Does someone have a suggestion on how to combine the frequencies from n imputed datasets into one pooled baseline table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 09:47:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Pooling-frequencies-after-multiple-imputation-in-SAS/m-p/693098#M33442</guid>
      <dc:creator>LisavH</dc:creator>
      <dc:date>2020-10-21T09:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Pooling frequencies after multiple imputation in SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Pooling-frequencies-after-multiple-imputation-in-SAS/m-p/693170#M33448</link>
      <description>&lt;P&gt;In order to combine point estimates for any statistic in a multiple imputation setting, you must have a standard error associated with that point estimate.&amp;nbsp;&amp;nbsp;&lt;SPAN class="cs53F207AF"&gt;The issue with using Proc FREQ is that it does not give you standard errors for either the percentages or the frequencies. &amp;nbsp;My suggestion would be to use Proc SURVEYFREQ instead and combine the results similar to the approach in the attached example.&amp;nbsp; Note that you must use the WTFREQ option on the TABLES statement even if you do not have a WEIGHT statement in order to get a standard error.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* Generate Data */&lt;/P&gt;
&lt;P&gt;proc format;&lt;BR /&gt;value ResponseCode 1 = 'Very Unsatisfied'&lt;BR /&gt;2 = 'Unsatisfied'&lt;BR /&gt;3 = 'Neutral'&lt;BR /&gt;4 = 'Satisfied'&lt;BR /&gt;5 = 'Very Satisfied';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc format;&lt;BR /&gt;value UserCode 1 = 'New Customer'&lt;BR /&gt;0 = 'Renewal Customer';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc format;&lt;BR /&gt;value SchoolCode 1 = 'Middle School'&lt;BR /&gt;2 = 'High School';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc format;&lt;BR /&gt;value DeptCode 0 = 'Faculty'&lt;BR /&gt;1 = 'Admin/Guidance';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data SIS_Survey;&lt;BR /&gt;format Response ResponseCode.;&lt;BR /&gt;format NewUser UserCode.;&lt;BR /&gt;format SchoolType SchoolCode.;&lt;BR /&gt;format Department DeptCode.;&lt;BR /&gt;do _imputation_=1 to 2;&lt;BR /&gt;drop j;&lt;BR /&gt;retain seed1 111;&lt;BR /&gt;retain seed2 222;&lt;BR /&gt;retain seed3 333;&lt;/P&gt;
&lt;P&gt;State = 'GA';&lt;/P&gt;
&lt;P&gt;NewUser = 1;&lt;BR /&gt;do School=1 to 71;&lt;/P&gt;
&lt;P&gt;call rantbl( seed1, .45, .55, SchoolType );&lt;/P&gt;
&lt;P&gt;Department = 0;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 25 + x * 2;&lt;BR /&gt;do j=1 to 2;&lt;BR /&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .16, .21, .30, .24, .09, Response);&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .18, .23, .30, .22, .07, Response);&lt;BR /&gt;output; end;&lt;BR /&gt;output;&lt;/P&gt;
&lt;P&gt;Department = 1;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 15 + x * 1.5;&lt;BR /&gt;do j=1 to 2;&lt;BR /&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .10, .15, .33, .28, .14, Response );&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .13, .20, .30, .26, .11, Response);&lt;BR /&gt;output; end;&lt;BR /&gt;end;&lt;/P&gt;
&lt;P&gt;NewUser = 0;&lt;BR /&gt;do School=72 to 134;&lt;/P&gt;
&lt;P&gt;call rantbl( seed1, .45, .55, SchoolType );&lt;/P&gt;
&lt;P&gt;Department = 0;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 25 + x * 2;&lt;BR /&gt;do j=1 to 2;&lt;BR /&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .16, .21, .30, .24, .09, Response);&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .18, .23, .30, .22, .07, Response);&lt;BR /&gt;output; end;&lt;BR /&gt;output;&lt;/P&gt;
&lt;P&gt;Department = 1;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 15 + x * 1.5;&lt;BR /&gt;do j=1 to 2;&lt;BR /&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .10, .15, .33, .28, .14, Response );&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .13, .20, .30, .26, .11, Response);&lt;BR /&gt;output; end;&lt;BR /&gt;end;&lt;/P&gt;
&lt;P&gt;State = 'NC';&lt;/P&gt;
&lt;P&gt;NewUser = 1;&lt;BR /&gt;do School = 135 to 218;&lt;/P&gt;
&lt;P&gt;call rantbl( seed1, .45, .55, SchoolType );&lt;/P&gt;
&lt;P&gt;Department = 0;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 25 + x * 2;&lt;/P&gt;
&lt;P&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .16, .21, .30, .24, .09, Response);&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .18, .23, .30, .22, .07, Response);&lt;BR /&gt;output; output;&lt;BR /&gt;output;&lt;/P&gt;
&lt;P&gt;Department = 1;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 15 + x * 1.5;&lt;/P&gt;
&lt;P&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .10, .15, .33, .28, .14, Response );&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .13, .20, .30, .26, .11, Response);&lt;BR /&gt;output; output;&lt;BR /&gt;end;&lt;/P&gt;
&lt;P&gt;NewUser = 0;&lt;BR /&gt;do School = 219 to 274;&lt;/P&gt;
&lt;P&gt;call rantbl( seed1, .45, .55, SchoolType );&lt;/P&gt;
&lt;P&gt;Department = 0;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 25 + x * 2;&lt;BR /&gt;do j=1 to 2;&lt;BR /&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .16, .21, .30, .24, .09, Response);&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .18, .23, .30, .22, .07, Response);&lt;BR /&gt;output; end;&lt;BR /&gt;output;&lt;/P&gt;
&lt;P&gt;Department = 1;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 15 + x * 1.5;&lt;/P&gt;
&lt;P&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .10, .15, .33, .28, .14, Response );&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .13, .20, .30, .26, .11, Response);&lt;BR /&gt;output; output;&lt;BR /&gt;end;&lt;/P&gt;
&lt;P&gt;State = 'SC';&lt;/P&gt;
&lt;P&gt;NewUser = 1;&lt;BR /&gt;do School = 275 to 328;&lt;/P&gt;
&lt;P&gt;call rantbl( seed1, .45, .55, SchoolType );&lt;/P&gt;
&lt;P&gt;Department = 0;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 25 + x * 2;&lt;BR /&gt;do j=1 to 2;&lt;BR /&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .16, .21, .30, .24, .09, Response);&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .18, .23, .30, .22, .07, Response);&lt;BR /&gt;output; end;&lt;BR /&gt;output;&lt;/P&gt;
&lt;P&gt;Department = 1;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 15 + x * 1.5;&lt;/P&gt;
&lt;P&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .10, .15, .33, .28, .14, Response );&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .13, .20, .30, .26, .11, Response);&lt;BR /&gt;output; output;&lt;BR /&gt;end;&lt;/P&gt;
&lt;P&gt;NewUser = 0;&lt;BR /&gt;do School = 329 to 370;&lt;/P&gt;
&lt;P&gt;call rantbl( seed1, .45, .55, SchoolType );&lt;/P&gt;
&lt;P&gt;Department = 0;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 25 + x * 2;&lt;BR /&gt;do j=1 to 2;&lt;BR /&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .16, .21, .30, .24, .09, Response);&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .18, .23, .30, .22, .07, Response);&lt;BR /&gt;output; end;&lt;BR /&gt;output;&lt;/P&gt;
&lt;P&gt;Department = 1;&lt;BR /&gt;call rannor( seed3, x );&lt;BR /&gt;SamplingWeight = 15 + x * 1.5;&lt;/P&gt;
&lt;P&gt;if ( SchoolType = 1 ) then&lt;BR /&gt;call rantbl( seed2, .10, .15, .33, .28, .14, Response );&lt;BR /&gt;else&lt;BR /&gt;call rantbl( seed2, .13, .20, .30, .26, .11, Response);&lt;BR /&gt;output; output;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;/*Run SURVEYFREQ by _IMPUTATION_ assuming the MI step is already done*/&lt;BR /&gt;proc surveyfreq data=SIS_Survey;&lt;BR /&gt;by _imputation_;&lt;BR /&gt;tables Response*schooltype/wtfreq;&lt;BR /&gt;ods output CrossTabs=mi_ctab;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;/*Sort the data by the TABLES variables which is called RESPONSE here*/&lt;BR /&gt;proc sort data=mi_ctab;&lt;BR /&gt;by response schooltype _imputation_;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;/*Run MIANALYZE with STDERR option*/&lt;BR /&gt;proc mianalyze data=mi_ctab;&lt;BR /&gt;by response schooltype;*this would be the TABLES variable;&lt;BR /&gt;modeleffects wgtfreq;&lt;BR /&gt;stderr stdDev;&lt;BR /&gt;title 'Results for Weighted Frequency';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="cs53F207AF"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="cs53F207AF"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 13:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Pooling-frequencies-after-multiple-imputation-in-SAS/m-p/693170#M33448</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2020-10-21T13:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Pooling frequencies after multiple imputation in SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Pooling-frequencies-after-multiple-imputation-in-SAS/m-p/693254#M33450</link>
      <description>&lt;P&gt;Hi SAS_Rob,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply.&amp;nbsp; I had found this SAS-code earlier on in my search but somehow the code did not work then. But I tried the code again and now it works! So thank you very much!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realized I was close to another solution as well: the weighted frequencies of PROC MIANALYZE are the same as when performing PROC UNIVARIATE and dividing the frequency counts by the &lt;EM&gt;n&lt;/EM&gt; imputations. Some example coding with treatment being binary (no, yes) and gender also being binary (male, female):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*To obtain frequencies per category of the outcome variable;
proc univariate data=mi_data freq;
class treatment; *To obtain the cumulative frequency omit this line;
var gender;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 17:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Pooling-frequencies-after-multiple-imputation-in-SAS/m-p/693254#M33450</guid>
      <dc:creator>LisavH</dc:creator>
      <dc:date>2020-10-21T17:10:13Z</dc:date>
    </item>
  </channel>
</rss>

