<?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 PLOTS=FREQPLOT - Labels applied inconsistenly in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-PLOTS-FREQPLOT-Labels-applied-inconsistenly/m-p/778556#M81185</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc freq data=kb.data_01 ORDER=FREQ ;
	/* 	where timepoint = "fu_1_arm_2"; */
	/* 	 by timepoint ; */
	table
		source
		location_pn
		oral_meds_yn
		top_meds_yn
		aes_yn
		aes_sev
		aes_hc
		aes_acn
		aes_out
		dose freq
		adherence
		satisfaction
		saf_effec / plots=freqplot (scale=percent);

	/* 	FORMAT advise yes_no_fmt.; */

	TITLE "Descriptive Statistics for Categorical Measures";
	ods output onewayfreqs=want_freq;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;NOTE: ODS statements in the SAS Studio environment may disable some output features.&lt;BR /&gt;69 &lt;BR /&gt;70 /*&lt;BR /&gt;70 ! -------------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;70 ! -------- */&lt;BR /&gt;71 Proc freq data=kb.data_01 ORDER=FREQ ;&lt;BR /&gt;72 /* where timepoint = "fu_1_arm_2"; */&lt;BR /&gt;73 /* by timepoint ; */&lt;BR /&gt;74 table&lt;BR /&gt;75 source&lt;BR /&gt;76 location_pn&lt;BR /&gt;77 oral_meds_yn&lt;BR /&gt;78 top_meds_yn&lt;BR /&gt;79 aes_yn&lt;BR /&gt;80 aes_sev&lt;BR /&gt;81 aes_hc&lt;BR /&gt;82 aes_acn&lt;BR /&gt;83 aes_out&lt;BR /&gt;84 dose freq&lt;BR /&gt;85 adherence&lt;BR /&gt;86 satisfaction&lt;BR /&gt;87 saf_effec / plots=freqplot (scale=percent);&lt;BR /&gt;88 &lt;BR /&gt;89 /* FORMAT advise yes_no_fmt.; */&lt;BR /&gt;90 &lt;BR /&gt;91 TITLE "Descriptive Statistics for Categorical Measures";&lt;BR /&gt;92 ods output onewayfreqs=want_freq;&lt;BR /&gt;93 RUN;&lt;BR /&gt;&lt;BR /&gt;NOTE: No plots are displayed for the table of aes_sev because all data are missing.&lt;BR /&gt;NOTE: No plots are displayed for the table of aes_hc because all data are missing.&lt;BR /&gt;NOTE: No plots are displayed for the table of aes_acn because all data are missing.&lt;BR /&gt;NOTE: No plots are displayed for the table of aes_out because all data are missing.&lt;BR /&gt;NOTE: The data set WORK.WANT_FREQ has 34 observations and 33 variables.&lt;BR /&gt;NOTE: There were 40 observations read from the data set KB.DATA_01.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 0.92 seconds&lt;BR /&gt;user cpu time 0.59 seconds&lt;BR /&gt;system cpu time 0.05 seconds&lt;BR /&gt;memory 11379.96k&lt;BR /&gt;OS Memory 37428.00k&lt;BR /&gt;Timestamp 11/04/2021 05:25:07 PM&lt;BR /&gt;Step Count 180 Switch Count 60&lt;BR /&gt;Page Faults 0&lt;BR /&gt;Page Reclaims 4726&lt;BR /&gt;Page Swaps 0&lt;BR /&gt;Voluntary Context Switches 1662&lt;BR /&gt;Involuntary Context Switches 18&lt;BR /&gt;Block Input Operations 0&lt;BR /&gt;Block Output Operations 6072&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;94 &lt;BR /&gt;95 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;105&lt;/P&gt;</description>
    <pubDate>Thu, 04 Nov 2021 17:26:47 GMT</pubDate>
    <dc:creator>_maldini_</dc:creator>
    <dc:date>2021-11-04T17:26:47Z</dc:date>
    <item>
      <title>PROC FREQ PLOTS=FREQPLOT - Labels applied inconsistenly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-PLOTS-FREQPLOT-Labels-applied-inconsistenly/m-p/778542#M81183</link>
      <description>&lt;P&gt;Why are variable labels being applied inconsistently when using&amp;nbsp;PROC FREQ PLOTS=FREQPLOT (See images). All labels are coded and applied the exact same way in a DATA step. All variables are included in one PROC FREQ, but some labels appear at the bottom of the freq plots and others don't. Any ideas?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-11-04 at 9.50.49 AM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65415i1C2F4E0A16C5AA3C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-11-04 at 9.50.49 AM.png" alt="Screen Shot 2021-11-04 at 9.50.49 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-11-04 at 9.51.54 AM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65416iE6E8759D6ECCE0D8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-11-04 at 9.51.54 AM.png" alt="Screen Shot 2021-11-04 at 9.51.54 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, unrelated question, is there a way to have each level of a categorical variable appear as a row in a proc freq table &lt;U&gt;regardless of whether its values are missing&lt;/U&gt;? In other words, if the variable has 4 levels&amp;nbsp;(i.e., poor, good, very good, excellent) and there are only responses for 2 levels&amp;nbsp;(i.e., very good, excellent), how can you include rows for "poor" and "neutral" w/ counts of "0", instead of simply not including those rows in the table? I'd like to be able to visualize all the possible responses, even if there are none for a given response.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-11-04 at 9.58.05 AM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65417i18B255AF40AA69D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-11-04 at 9.58.05 AM.png" alt="Screen Shot 2021-11-04 at 9.58.05 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 17:02:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-PLOTS-FREQPLOT-Labels-applied-inconsistenly/m-p/778542#M81183</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2021-11-04T17:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ PLOTS=FREQPLOT - Labels applied inconsistenly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-PLOTS-FREQPLOT-Labels-applied-inconsistenly/m-p/778553#M81184</link>
      <description>Show your code and log. I suspect when the label is too long to fit on the graph it defaults to the variable name but it usually puts a note in the log when that happens.</description>
      <pubDate>Thu, 04 Nov 2021 17:21:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-PLOTS-FREQPLOT-Labels-applied-inconsistenly/m-p/778553#M81184</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-11-04T17:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ PLOTS=FREQPLOT - Labels applied inconsistenly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-PLOTS-FREQPLOT-Labels-applied-inconsistenly/m-p/778556#M81185</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc freq data=kb.data_01 ORDER=FREQ ;
	/* 	where timepoint = "fu_1_arm_2"; */
	/* 	 by timepoint ; */
	table
		source
		location_pn
		oral_meds_yn
		top_meds_yn
		aes_yn
		aes_sev
		aes_hc
		aes_acn
		aes_out
		dose freq
		adherence
		satisfaction
		saf_effec / plots=freqplot (scale=percent);

	/* 	FORMAT advise yes_no_fmt.; */

	TITLE "Descriptive Statistics for Categorical Measures";
	ods output onewayfreqs=want_freq;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;NOTE: ODS statements in the SAS Studio environment may disable some output features.&lt;BR /&gt;69 &lt;BR /&gt;70 /*&lt;BR /&gt;70 ! -------------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;70 ! -------- */&lt;BR /&gt;71 Proc freq data=kb.data_01 ORDER=FREQ ;&lt;BR /&gt;72 /* where timepoint = "fu_1_arm_2"; */&lt;BR /&gt;73 /* by timepoint ; */&lt;BR /&gt;74 table&lt;BR /&gt;75 source&lt;BR /&gt;76 location_pn&lt;BR /&gt;77 oral_meds_yn&lt;BR /&gt;78 top_meds_yn&lt;BR /&gt;79 aes_yn&lt;BR /&gt;80 aes_sev&lt;BR /&gt;81 aes_hc&lt;BR /&gt;82 aes_acn&lt;BR /&gt;83 aes_out&lt;BR /&gt;84 dose freq&lt;BR /&gt;85 adherence&lt;BR /&gt;86 satisfaction&lt;BR /&gt;87 saf_effec / plots=freqplot (scale=percent);&lt;BR /&gt;88 &lt;BR /&gt;89 /* FORMAT advise yes_no_fmt.; */&lt;BR /&gt;90 &lt;BR /&gt;91 TITLE "Descriptive Statistics for Categorical Measures";&lt;BR /&gt;92 ods output onewayfreqs=want_freq;&lt;BR /&gt;93 RUN;&lt;BR /&gt;&lt;BR /&gt;NOTE: No plots are displayed for the table of aes_sev because all data are missing.&lt;BR /&gt;NOTE: No plots are displayed for the table of aes_hc because all data are missing.&lt;BR /&gt;NOTE: No plots are displayed for the table of aes_acn because all data are missing.&lt;BR /&gt;NOTE: No plots are displayed for the table of aes_out because all data are missing.&lt;BR /&gt;NOTE: The data set WORK.WANT_FREQ has 34 observations and 33 variables.&lt;BR /&gt;NOTE: There were 40 observations read from the data set KB.DATA_01.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 0.92 seconds&lt;BR /&gt;user cpu time 0.59 seconds&lt;BR /&gt;system cpu time 0.05 seconds&lt;BR /&gt;memory 11379.96k&lt;BR /&gt;OS Memory 37428.00k&lt;BR /&gt;Timestamp 11/04/2021 05:25:07 PM&lt;BR /&gt;Step Count 180 Switch Count 60&lt;BR /&gt;Page Faults 0&lt;BR /&gt;Page Reclaims 4726&lt;BR /&gt;Page Swaps 0&lt;BR /&gt;Voluntary Context Switches 1662&lt;BR /&gt;Involuntary Context Switches 18&lt;BR /&gt;Block Input Operations 0&lt;BR /&gt;Block Output Operations 6072&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;94 &lt;BR /&gt;95 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;105&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 17:26:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-PLOTS-FREQPLOT-Labels-applied-inconsistenly/m-p/778556#M81185</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2021-11-04T17:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ PLOTS=FREQPLOT - Labels applied inconsistenly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-PLOTS-FREQPLOT-Labels-applied-inconsistenly/m-p/778597#M81186</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/36911"&gt;@_maldini_&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, unrelated question, is there a way to have each level of a categorical variable appear as a row in a proc freq table &lt;U&gt;regardless of whether its values are missing&lt;/U&gt;? In other words, if the variable has 4 levels&amp;nbsp;(i.e., poor, good, very good, excellent) and there are only responses for 2 levels&amp;nbsp;(i.e., very good, excellent), how can you include rows for "poor" and "neutral" w/ counts of "0", instead of simply not including those rows in the table? I'd like to be able to visualize all the possible responses, even if there are none for a given response.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-11-04 at 9.58.05 AM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65417i18B255AF40AA69D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-11-04 at 9.58.05 AM.png" alt="Screen Shot 2021-11-04 at 9.58.05 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not with Proc Freq.&lt;/P&gt;
&lt;P&gt;Procs Report, Tabulate and Means/Summary support an option called PRELOADFMT which will display all the values that appear in a finite-list format applied to a variable when proper syntax is used and you have defined a format with all the values you want to appear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider, if a data set does not have a specific value for any record where is SAS supposed to know that value should be reported on? Somewhere you will have to provide that information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A brief example:&lt;/P&gt;
&lt;PRE&gt;data example;
   input scale $;
datalines;
poor
good
;

Proc format library=work;
value $scale
'poor'     ='Poor'     
'good'     ='Good'     
'very good'='Very good'
'excellent'='Excellent'
;
run;

proc tabulate data=example;
   class scale/preloadfmt;
   format scale $scale.;
   table scale,
         n colpctn
         /printmiss ;
run;&lt;/PRE&gt;
&lt;P&gt;Key elements: 1) a format&amp;nbsp; 2) a procedure that supports Preloadfmt 3) proper syntax, in this case the option for the variable to use the preloaded format, associate the format you want with the variable (note: you could have a format that combines levels into a single displayed text) and any other syntax elements need, in this case the Printmiss option to print the missing levels of the format.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 20:31:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-PLOTS-FREQPLOT-Labels-applied-inconsistenly/m-p/778597#M81186</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-11-04T20:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ PLOTS=FREQPLOT - Labels applied inconsistenly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-PLOTS-FREQPLOT-Labels-applied-inconsistenly/m-p/779102#M81187</link>
      <description>&lt;P&gt;You can either shorten the label or widen the plot.&lt;/P&gt;
&lt;P&gt;To widen the plot, use the ODS GRAPHICS statement:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ODS GRAPHICS/ width=1000px height=500px;&amp;nbsp;&lt;/STRONG&gt; &amp;nbsp; /* adjust the values as needed */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To change the label, use the LABEL statement inside the PROC FREQ code:&lt;/P&gt;
&lt;P&gt;proc freq;&lt;BR /&gt;&lt;STRONG&gt;label source="Describe the location of your pain";&lt;/STRONG&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;SPAN style="font-family: inherit;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 12:07:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-PLOTS-FREQPLOT-Labels-applied-inconsistenly/m-p/779102#M81187</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-11-08T12:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ PLOTS=FREQPLOT - Labels applied inconsistenly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-PLOTS-FREQPLOT-Labels-applied-inconsistenly/m-p/779630#M81195</link>
      <description>Thanks!</description>
      <pubDate>Wed, 10 Nov 2021 19:30:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-PLOTS-FREQPLOT-Labels-applied-inconsistenly/m-p/779630#M81195</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2021-11-10T19:30:39Z</dc:date>
    </item>
  </channel>
</rss>

