<?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: Force in Needed Observation in Proc Freq in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Force-in-Needed-Observation-in-Proc-Freq/m-p/351595#M63948</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/135825"&gt;@jl1005&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Sorry, I don't think I fully understood preloadfmt when I used it. So I would need to do a proc format above, and define each class?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, you need some way to tell SAS what values are possible, especially if they're not in your data. How else would it even know those values exist ?&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2017 10:36:51 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-04-20T10:36:51Z</dc:date>
    <item>
      <title>Force in Needed Observation in Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Force-in-Needed-Observation-in-Proc-Freq/m-p/351500#M63936</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on creating transition matrices, but now am running into issues. Previoulsy, I had posted&amp;nbsp;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Proc-Freq-Results-as-Data-Table/m-p/344373#M79133" target="_blank"&gt;this topic&lt;/A&gt;&amp;nbsp;to output the datasets. But now that I'm narrowing down the input datasets, there are times where not all possible combinations occur, which then throws off using them to simulate down the road. Here's the code that was being used to originally create them:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data = &amp;amp;team._a_class_&amp;amp;i;	
	tables new_start_bases_cd*new_end_bases_cd / noprint sparse out=need1a;
	tables new_start_bases_cd / noprint out=need1b;
	run;
data need2;
	  merge need1a  need1b (rename=(count=row_total));
	  by new_start_bases_cd;
	  percent=count/row_total;
	  drop count row_total;
	run;
proc transpose data=need2 out=&amp;amp;team._a_class_&amp;amp;i._data (drop=_name_ _label_) prefix=percent_;
	  by new_start_bases_cd;
	  var percent;
	  id new_end_bases_cd;	 
	run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The macro variables are in there in order to repeat this 15 times and for different teams, in order to simplify the process. Ideally, the output would be a 24 row, by 32 column data table. But since the datasets have been narrowed down, there are instances where its 20x26 or 23x27.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So is there a way to force the number of rows and column in the output, even if they would be filled with all 0's?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 01:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Force-in-Needed-Observation-in-Proc-Freq/m-p/351500#M63936</guid>
      <dc:creator>jl1005</dc:creator>
      <dc:date>2017-04-20T01:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Force in Needed Observation in Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Force-in-Needed-Observation-in-Proc-Freq/m-p/351532#M63937</link>
      <description>&lt;P&gt;If you need all the levels you need to have them defined somewhere at least once.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This can be a dataset or manually but it has to exist somewhere. The ways to account for this are to use PRELOADFMT or to merge it with a master dataset that has all the combinations defined already.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 03:45:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Force-in-Needed-Observation-in-Proc-Freq/m-p/351532#M63937</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-20T03:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Force in Needed Observation in Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Force-in-Needed-Observation-in-Proc-Freq/m-p/351533#M63938</link>
      <description>&lt;P&gt;There are a number of methods available for both proc frequency and proc means. Take a look at:&amp;nbsp;&lt;A href="https://www.pharmasug.org/proceedings/2012/CC/PharmaSUG-2012-CC26.pdf" target="_blank"&gt;https://www.pharmasug.org/proceedings/2012/CC/PharmaSUG-2012-CC26.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 03:49:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Force-in-Needed-Observation-in-Proc-Freq/m-p/351533#M63938</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-04-20T03:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Force in Needed Observation in Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Force-in-Needed-Observation-in-Proc-Freq/m-p/351541#M63941</link>
      <description>&lt;P&gt;I tried the preloadfmt approach, but still wasn't getting the missing variable combinations. Do you think it would be easier to create a master dataset with all the possible combinations and merge that with the dataset that's then used to create the matrix?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the code I had tried:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data= min_h_class_15 out=min_h_class_15_tab;
	class new_start_bases_cd new_end_bases_cd / preloadfmt;
	TABLE new_start_bases_cd * ROWPCTN , new_end_bases_cd / printmiss;
	run;
proc transpose data=min_h_class_15_tab out=min_h_class_15_data_trans (drop=_name_) prefix=percent_;;
	by new_start_bases_cd;
	var pctn_10;
	id new_end_bases_cd;
	run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The transpose is just to get it into a data table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 04:46:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Force-in-Needed-Observation-in-Proc-Freq/m-p/351541#M63941</guid>
      <dc:creator>jl1005</dc:creator>
      <dc:date>2017-04-20T04:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Force in Needed Observation in Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Force-in-Needed-Observation-in-Proc-Freq/m-p/351542#M63942</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/135825"&gt;@jl1005&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I tried the preloadfmt approach, but still wasn't getting the missing variable combinations. Do you think it would be easier to create a master dataset with all the possible combinations and merge that with the dataset that's then used to create the matrix?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the code I had tried:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data= min_h_class_15 out=min_h_class_15_tab;
	class new_start_bases_cd new_end_bases_cd / preloadfmt;
	TABLE new_start_bases_cd * ROWPCTN , new_end_bases_cd / printmiss;
	run;
proc transpose data=min_h_class_15_tab out=min_h_class_15_data_trans (drop=_name_) prefix=percent_;;
	by new_start_bases_cd;
	var pctn_10;
	id new_end_bases_cd;
	run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The transpose is just to get it into a data table.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Where's the format?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 04:51:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Force-in-Needed-Observation-in-Proc-Freq/m-p/351542#M63942</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-20T04:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Force in Needed Observation in Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Force-in-Needed-Observation-in-Proc-Freq/m-p/351548#M63943</link>
      <description>&lt;P&gt;Sorry, I don't think I fully understood preloadfmt when I used it. So I would need to do a proc format above, and define each class?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 05:25:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Force-in-Needed-Observation-in-Proc-Freq/m-p/351548#M63943</guid>
      <dc:creator>jl1005</dc:creator>
      <dc:date>2017-04-20T05:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Force in Needed Observation in Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Force-in-Needed-Observation-in-Proc-Freq/m-p/351595#M63948</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/135825"&gt;@jl1005&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Sorry, I don't think I fully understood preloadfmt when I used it. So I would need to do a proc format above, and define each class?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, you need some way to tell SAS what values are possible, especially if they're not in your data. How else would it even know those values exist ?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 10:36:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Force-in-Needed-Observation-in-Proc-Freq/m-p/351595#M63948</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-20T10:36:51Z</dc:date>
    </item>
  </channel>
</rss>

