<?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 windorize without replacing missing data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/windorize-without-replacing-missing-data/m-p/111856#M292433</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I need to windorize data. I am using the following code to do so. However, it replaces the missing values too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; proc &lt;/SPAN&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: Courier New;"&gt;univariate&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=acc_data &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; cash CF Lev Q DVC AT B2M LagAT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=_winsor&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;pctlpts&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;99&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;pctlpre&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=__cash __CF __Lev __Q __DVC __AT __B2M __LagAT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;data acc_data_win (drop=_:);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; acc_data;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; _n_=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; _winsor;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; wlo&amp;nbsp; {*} __cash1 __CF1 __Lev1 __Q1 __DVC1 __AT1 __B2M1 __LagAT1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; whi&amp;nbsp; {*} __cash99 __CF99 __Lev99 __Q99 __DVC99 __AT99 __B2M99 __LagAT99;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; wval {*} wcash wCF wLev wQ wDVC wAT wB2M wLagAT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; val&amp;nbsp;&amp;nbsp; {*} cash CF Lev Q DVC AT B2M LagAT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; _V=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; dim(val);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Any suggestion to avoid replacing missing values and windorize only the non missing values.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Waqar&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Jun 2013 12:50:11 GMT</pubDate>
    <dc:creator>Waqar</dc:creator>
    <dc:date>2013-06-19T12:50:11Z</dc:date>
    <item>
      <title>windorize without replacing missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/windorize-without-replacing-missing-data/m-p/111856#M292433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I need to windorize data. I am using the following code to do so. However, it replaces the missing values too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; proc &lt;/SPAN&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: Courier New;"&gt;univariate&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=acc_data &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; cash CF Lev Q DVC AT B2M LagAT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=_winsor&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;pctlpts&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;99&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;pctlpre&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;=__cash __CF __Lev __Q __DVC __AT __B2M __LagAT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;data acc_data_win (drop=_:);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; acc_data;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; _n_=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; _winsor;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; wlo&amp;nbsp; {*} __cash1 __CF1 __Lev1 __Q1 __DVC1 __AT1 __B2M1 __LagAT1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; whi&amp;nbsp; {*} __cash99 __CF99 __Lev99 __Q99 __DVC99 __AT99 __B2M99 __LagAT99;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; wval {*} wcash wCF wLev wQ wDVC wAT wB2M wLagAT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; val&amp;nbsp;&amp;nbsp; {*} cash CF Lev Q DVC AT B2M LagAT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; _V=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; dim(val);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Any suggestion to avoid replacing missing values and windorize only the non missing values.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Waqar&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 12:50:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/windorize-without-replacing-missing-data/m-p/111856#M292433</guid>
      <dc:creator>Waqar</dc:creator>
      <dc:date>2013-06-19T12:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: windorize without replacing missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/windorize-without-replacing-missing-data/m-p/111857#M292434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To avoid replacing missing values, you must exclude missing values from the lower range (they rank as minus infinity) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;do _V=1 to dim(val);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if . &amp;lt; val{_V} &amp;lt; wlo{_V} then val{_V} = wlo{_V};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if val{_V} &amp;gt; whi{_V} then val{_V} = whi{_V};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you might need a retain statement on the _winsor variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 14:53:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/windorize-without-replacing-missing-data/m-p/111857#M292434</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-06-19T14:53:30Z</dc:date>
    </item>
  </channel>
</rss>

