<?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: Dealing with Scientific Notation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Dealing-with-Scientific-Notation/m-p/497506#M131879</link>
    <description>&lt;P&gt;There can be many ways to do this.&amp;nbsp; Help yourself by showing us what the starting data look like, and how you where you want the result generated (i.e. in a data set, as a result page, other).&lt;/P&gt;</description>
    <pubDate>Thu, 20 Sep 2018 18:25:26 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2018-09-20T18:25:26Z</dc:date>
    <item>
      <title>Dealing with Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dealing-with-Scientific-Notation/m-p/497505#M131878</link>
      <description>&lt;P&gt;Someone help me how to develop below formula into SAS code. I don't have any idea&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&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="2018-09-20_14-20-00.jpg" style="width: 305px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23420i511ACCF96580250B/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-09-20_14-20-00.jpg" alt="2018-09-20_14-20-00.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 18:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dealing-with-Scientific-Notation/m-p/497505#M131878</guid>
      <dc:creator>ez123</dc:creator>
      <dc:date>2018-09-20T18:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dealing-with-Scientific-Notation/m-p/497506#M131879</link>
      <description>&lt;P&gt;There can be many ways to do this.&amp;nbsp; Help yourself by showing us what the starting data look like, and how you where you want the result generated (i.e. in a data set, as a result page, other).&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 18:25:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dealing-with-Scientific-Notation/m-p/497506#M131879</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-09-20T18:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dealing-with-Scientific-Notation/m-p/497511#M131884</link>
      <description>&lt;P&gt;12 divided by 8 is 1.5.&lt;/P&gt;
&lt;P&gt;Start with a loop to build the sum, and use array processing:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array vars {*} var1-var40;
sum = 0;
do i = 1 to 40;
  sum = sum + (vars{i} - var0) ** 2;
end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now multiply, and take the square root:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;want = sqrt(1.5 * sum);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That's it.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 18:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dealing-with-Scientific-Notation/m-p/497511#M131884</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-09-20T18:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dealing-with-Scientific-Notation/m-p/497512#M131885</link>
      <description>&lt;P&gt;Here are variants of KurtBremser's approach, including test data:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
/* Create test data */
array var[0:40] var0-var40 (5 40*7);

/* Apply the formula */
do i=1 to 40;
  s+(var[i]-var0)**2;
end;
abc=sqrt(12/8*s);

/* Write the result to the log before it's overwritten */
put abc=;

/* Alternative way */
array d[40] _temporary_;
do i=1 to 40;
  d[i]=(var[i]-var0)**2;
end;
abc=sqrt(12/8*sum(of d[*]));

drop i s;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Sep 2018 18:40:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dealing-with-Scientific-Notation/m-p/497512#M131885</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-09-20T18:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dealing-with-Scientific-Notation/m-p/497515#M131886</link>
      <description>&lt;P&gt;Or if a more compact form is wanted:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Editted note:&amp;nbsp; And I forgot to implement the square root.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  array vars {*} var1-var40;
  want= 1.5* (uss(of vars{*}) - 2*var0*sum(of vars{*}) + dim(vars)*var0**2);&lt;BR /&gt;  want = sqrt(want);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which comes from performing the squaring of the term in your formula.&amp;nbsp; Above USS stands for "uncorrected sums of squares".&amp;nbsp; Which means the sum of squared values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 18:58:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dealing-with-Scientific-Notation/m-p/497515#M131886</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-09-20T18:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dealing-with-Scientific-Notation/m-p/497535#M131889</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/204379"&gt;@ez123&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;And if you think it doesn't get any shorter, apply Steiner's translation theorem:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;abc=sqrt(1.5*(css(of vars[*])+dim(vars)*(mean(of vars[*])-var0)**2));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(using mkeintz's array and the corrected sum of squares, CSS).&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 19:27:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dealing-with-Scientific-Notation/m-p/497535#M131889</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-09-20T19:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with Scientific Notation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dealing-with-Scientific-Notation/m-p/497545#M131893</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;KurtBremser...&lt;SPAN class="login-bold"&gt;&amp;nbsp; and who are all replied&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 20:09:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dealing-with-Scientific-Notation/m-p/497545#M131893</guid>
      <dc:creator>ez123</dc:creator>
      <dc:date>2018-09-20T20:09:57Z</dc:date>
    </item>
  </channel>
</rss>

