<?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 MIANALYZE FROM PROC SURVEYFREQ in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-MIANALYZE-FROM-PROC-SURVEYFREQ/m-p/858854#M339338</link>
    <description>&lt;P&gt;The error is very clear, it is missing values for the stated variable for By groups. Note that every single one of your Total lines in the output set from Surveyfreq meets this condition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that using BY and WHERE in the surveyprocs may be a bit of a valid analysis problem as complex weights are likely not applied correctly. Adding your by and where variables as Domains or table variables and selecting the proper records is generally the better approach.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Feb 2023 00:21:20 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-02-15T00:21:20Z</dc:date>
    <item>
      <title>PROC MIANALYZE FROM PROC SURVEYFREQ</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-MIANALYZE-FROM-PROC-SURVEYFREQ/m-p/858847#M339334</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am looking for help pooling frequencies and percentages of categorical variables from PROC SURVEYFREQ in PROC MIANALYZE. I've attached the codes below. I've also attached the error in the log and the dataset with frequency and percentages. Thank you so much.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sort data=des.apoe; by _imputation_ ;run;
proc surveyfreq data=des.apoe;
stratum raestrat;
cluster raehsamp;
weight r7wtresp;
by _imputation_;
where wave=7;
tables alc smoke gender race_eth maritalstat;
ods output ONEWAY=catoutfull;
run;&lt;BR /&gt;/**POOL STATISTICS**/&lt;BR /&gt;proc sort data=CATOUTFULL; by _IMPUTATION_ TABLE ;run;
proc mianalyze data=CATOUTFULL (WHERE=(Table= "Table Alc"));
title 'ALCOHOL';
by _IMPUTATION_ TABLE;
modeleffects percent ; 
stderr stderr ;
run;&lt;/CODE&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 22:21:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-MIANALYZE-FROM-PROC-SURVEYFREQ/m-p/858847#M339334</guid>
      <dc:creator>nep87</dc:creator>
      <dc:date>2023-02-14T22:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: PROC MIANALYZE FROM PROC SURVEYFREQ</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-MIANALYZE-FROM-PROC-SURVEYFREQ/m-p/858854#M339338</link>
      <description>&lt;P&gt;The error is very clear, it is missing values for the stated variable for By groups. Note that every single one of your Total lines in the output set from Surveyfreq meets this condition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that using BY and WHERE in the surveyprocs may be a bit of a valid analysis problem as complex weights are likely not applied correctly. Adding your by and where variables as Domains or table variables and selecting the proper records is generally the better approach.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 00:21:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-MIANALYZE-FROM-PROC-SURVEYFREQ/m-p/858854#M339338</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-02-15T00:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: PROC MIANALYZE FROM PROC SURVEYFREQ</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-MIANALYZE-FROM-PROC-SURVEYFREQ/m-p/858860#M339343</link>
      <description>&lt;P&gt;Thank you. Besides that, I figured out that I had to run the surveyfreq by imputation. Just in case someone might need this I have copied the codes below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc surveyfreq data=DES.Dsrtlongfull;
STRATUM RAESTRAT;
CLUSTER RAEHSAMP;
WEIGHT R7WTRESP;
by _imputation_;
where wave=7;
tables ALC gender/ nototal ;
ods output ONEWAY=CATOUTFULL;
run;
************************************************************************;
PROC PRINT DATA=CATOUTFULL;RUN;
/**POOL STATISTICS**/
proc sort data=CATOUTFULL; by alc _IMPUTATION_  ;run;
proc mianalyze data=CATOUTFULL;
by alc;
title 'ALCOHOL';
modeleffects percent; 
stderr stdErr;
run;
proc mianalyze data=CATOUTFULL;
by alc;
title 'ALCOHOL';
modeleffects Frequency; 
stderr stdDev;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2023 03:36:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-MIANALYZE-FROM-PROC-SURVEYFREQ/m-p/858860#M339343</guid>
      <dc:creator>nep87</dc:creator>
      <dc:date>2023-02-15T03:36:50Z</dc:date>
    </item>
  </channel>
</rss>

