<?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: Multiply imputed categorical data: How to get frequency and percent estimates with MIANALYZE? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Multiply-imputed-categorical-data-How-to-get-frequency-and/m-p/666428#M31777</link>
    <description>&lt;P&gt;Thanks so much, Steve! It's good to think I chose reasonable workarounds.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;So then the question becomes "Could you use the CLASS statement in PROC MEANS and avoid the need to code up a lot of binary variables?"&amp;nbsp; I think you should try, as it ought to reduce the amount of post-processing.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Oops. I just wrote and am executing 5,000 lines of code. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I appreciate your ideas about judging the MI results. I'll experiment with them. Thanks again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jul 2020 17:12:09 GMT</pubDate>
    <dc:creator>EricVanceMartin</dc:creator>
    <dc:date>2020-07-01T17:12:09Z</dc:date>
    <item>
      <title>Multiply imputed categorical data: How to get frequency and percent estimates with MIANALYZE?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Multiply-imputed-categorical-data-How-to-get-frequency-and/m-p/666188#M31756</link>
      <description>&lt;P&gt;I have a dataset with only a few continuous variables and a large number of ordinal categorical variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have successfully run PROC MI with predictive mean matching for continuous variables and discriminant functions for ordinal categorical variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a native way to get frequency and percent estimates for the imputed data for the categorical variables without turning them into binary dummies?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have seen multiple questions for this online, but no answers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bonus question: You can use trace plots to look at convergence for continuous variables. But is there any output you can use to examine convergence related to the categorical variables (again, unless converted to dummies, I guess).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 19:27:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Multiply-imputed-categorical-data-How-to-get-frequency-and/m-p/666188#M31756</guid>
      <dc:creator>EricVanceMartin</dc:creator>
      <dc:date>2020-06-30T19:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply imputed categorical data: How to get frequency and percent estimates with MIANALYZE?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Multiply-imputed-categorical-data-How-to-get-frequency-and/m-p/666374#M31767</link>
      <description>&lt;P&gt;I think there is an inbetween step here where you analyze the imputations by imputation.&amp;nbsp; What procedure are you using for this analysis?&amp;nbsp; That may inform how MIANALYZE gets results.&amp;nbsp; From there, you may have to do some post-processing to get percent estimates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 13:39:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Multiply-imputed-categorical-data-How-to-get-frequency-and/m-p/666374#M31767</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-07-01T13:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply imputed categorical data: How to get frequency and percent estimates with MIANALYZE?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Multiply-imputed-categorical-data-How-to-get-frequency-and/m-p/666390#M31773</link>
      <description>&lt;P&gt;Thanks so much for your reply, Steve.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, I think I'm doing this in the standard way.&lt;/P&gt;
&lt;P&gt;1. Run MI&lt;/P&gt;
&lt;P&gt;2. Run some PROC by imputation&lt;/P&gt;
&lt;P&gt;3. Combine imputations with MIANALYZE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The question is: What PROC goes in Step 2, and what output of this PROC is fed to MIANALYZE? I have read that PROC FREQ does not work for this, though I know PROC MEANS does. What I am doing now is converting each ordinal to binary dummies, running PROC MEANS by imputation, then combining the means with MIANALYZE, giving me the proportion of each value and a standard error.... I think&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would love to know your assessment of this approach, and a more direct way--leaving the variables in their ordinal form--if it exists.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, any thoughts about judging the convergence when using the imputation methods for categorical data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 14:30:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Multiply-imputed-categorical-data-How-to-get-frequency-and/m-p/666390#M31773</guid>
      <dc:creator>EricVanceMartin</dc:creator>
      <dc:date>2020-07-01T14:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply imputed categorical data: How to get frequency and percent estimates with MIANALYZE?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Multiply-imputed-categorical-data-How-to-get-frequency-and/m-p/666421#M31776</link>
      <description>&lt;P&gt;Using PROC MEANS is a good approach, if you had only two categorical variables then another would be PROC UNIVARIATE.&amp;nbsp; You can then post-process the output to get percentages based on the counts.&amp;nbsp; So then the question becomes "Could you use the CLASS statement in PROC MEANS and avoid the need to code up a lot of binary variables?"&amp;nbsp; I think you should try, as it ought to reduce the amount of post-processing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now as far as judging convergence, the best I can come up with is to look at the relative efficiencies.&amp;nbsp; If it is less than 0.99, you should probably look at a different method, but that doesn't say anything about the convergence.&amp;nbsp; There might be a way to use the OUTITER=&amp;lt;dsn&amp;gt; to look at various values through multiple iterations.&amp;nbsp; The documentation says that the dataset type is COV, but I am not sure what that implies in this case.&amp;nbsp; If it is a square matrix, you could look at stabilization of the eigenvalues from iteration to iteration. What would probably be better is to use SGPLOT to generate something where you can look graphically for trends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 16:45:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Multiply-imputed-categorical-data-How-to-get-frequency-and/m-p/666421#M31776</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-07-01T16:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply imputed categorical data: How to get frequency and percent estimates with MIANALYZE?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Multiply-imputed-categorical-data-How-to-get-frequency-and/m-p/666428#M31777</link>
      <description>&lt;P&gt;Thanks so much, Steve! It's good to think I chose reasonable workarounds.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;So then the question becomes "Could you use the CLASS statement in PROC MEANS and avoid the need to code up a lot of binary variables?"&amp;nbsp; I think you should try, as it ought to reduce the amount of post-processing.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Oops. I just wrote and am executing 5,000 lines of code. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I appreciate your ideas about judging the MI results. I'll experiment with them. Thanks again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 17:12:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Multiply-imputed-categorical-data-How-to-get-frequency-and/m-p/666428#M31777</guid>
      <dc:creator>EricVanceMartin</dc:creator>
      <dc:date>2020-07-01T17:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply imputed categorical data: How to get frequency and percent estimates with MIANALYZE?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Multiply-imputed-categorical-data-How-to-get-frequency-and/m-p/667278#M31831</link>
      <description>&lt;P&gt;It shouldn't be necessary to make the conversion and use Proc MEANS.&amp;nbsp; You could just use Proc SURVEYFREQ instead which gives standard errors for both the percentages and the frequencies.&amp;nbsp; You could do something similar to the example below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* Getting Started Example&lt;BR /&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;proc sort data=SIS_Survey;&lt;BR /&gt;by _imputation_;&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 state*Response/wtfreq;&lt;BR /&gt;ods output crosstabs=ctab;&lt;BR /&gt;ods trace on;&lt;BR /&gt;run;&lt;BR /&gt;proc print;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;/*Sort the data by the TABLES variable which is called RESPONSE here*/&lt;BR /&gt;proc sort;&lt;BR /&gt;by state response _imputation_;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;/*Run MIANALYZE with STDERR option for percentages*/&lt;BR /&gt;proc mianalyze data=ctab;&lt;BR /&gt;by state response;*this would be the TABLES variable;&lt;BR /&gt;modeleffects percent;&lt;BR /&gt;stderr stdErr;&lt;BR /&gt;title 'Results of for Proportions';&lt;BR /&gt;run;&lt;BR /&gt;/*Run MIANALYZE with STDERR option for Frequencies*/&lt;BR /&gt;proc mianalyze data=ctab;&lt;BR /&gt;by state response;*this would be the TABLES variable;&lt;BR /&gt;modeleffects WgtFreq;&lt;BR /&gt;stderr StdDev;&lt;BR /&gt;title 'Results of for Frequencies';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 19:28:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Multiply-imputed-categorical-data-How-to-get-frequency-and/m-p/667278#M31831</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2020-07-06T19:28:09Z</dc:date>
    </item>
  </channel>
</rss>

