<?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: proc freq with multiple imputation in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-freq-with-multiple-imputation/m-p/722596#M35013</link>
    <description>&lt;P&gt;Yes.&amp;nbsp; You would have to combine the actual Chi-Square statistics from each of the tables.&amp;nbsp; Dr. Paul Allison has a macro on his website that will compute the combined Chi-Square statistics.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sas.upenn.edu/~allison/combchi.sas" target="_blank"&gt;https://www.sas.upenn.edu/~allison/combchi.sas&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Mar 2021 15:07:21 GMT</pubDate>
    <dc:creator>SAS_Rob</dc:creator>
    <dc:date>2021-03-01T15:07:21Z</dc:date>
    <item>
      <title>proc freq with multiple imputation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-freq-with-multiple-imputation/m-p/671680#M32106</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with a multiple imputed dataset and I want to make a frequency table of the responders. With the statement I use, I get frequency tables for every imputed dataset separately, but how do I combine these results in 1 final result using proc mi analyze?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc freq data = test;&lt;BR /&gt;tables responders*intervention ;&lt;BR /&gt;BY _Imputation_;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the help.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 06:44:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-freq-with-multiple-imputation/m-p/671680#M32106</guid>
      <dc:creator>ablond</dc:creator>
      <dc:date>2020-07-23T06:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq with multiple imputation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-freq-with-multiple-imputation/m-p/671767#M32112</link>
      <description>&lt;P&gt;Because Proc FREQ does not report a standard error for the frequency, you would not be able to combine the estimates in Proc MIANALYZE.&amp;nbsp; Instead you must use Proc SURVEYFREQ.&amp;nbsp; Below is an example.&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;title 'School Information System Survey';&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;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;proc print;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&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 of for Weighted Frequency';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 11:16:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-freq-with-multiple-imputation/m-p/671767#M32112</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2020-07-23T11:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq with multiple imputation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-freq-with-multiple-imputation/m-p/722593#M35012</link>
      <description>&lt;P&gt;Thank you for this reply, it worked!&lt;/P&gt;&lt;P&gt;Now I had another question. Is it possible to perform a chi-square test and have a p-value for the imputed frequency data (comparing responders to non responders )?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 14:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-freq-with-multiple-imputation/m-p/722593#M35012</guid>
      <dc:creator>ablond</dc:creator>
      <dc:date>2021-03-01T14:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq with multiple imputation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-freq-with-multiple-imputation/m-p/722596#M35013</link>
      <description>&lt;P&gt;Yes.&amp;nbsp; You would have to combine the actual Chi-Square statistics from each of the tables.&amp;nbsp; Dr. Paul Allison has a macro on his website that will compute the combined Chi-Square statistics.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sas.upenn.edu/~allison/combchi.sas" target="_blank"&gt;https://www.sas.upenn.edu/~allison/combchi.sas&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 15:07:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-freq-with-multiple-imputation/m-p/722596#M35013</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2021-03-01T15:07:21Z</dc:date>
    </item>
  </channel>
</rss>

