<?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 Comparing number with missing variable, and basic linear regression question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Comparing-number-with-missing-variable-and-basic-linear/m-p/714151#M220427</link>
    <description>&lt;P&gt;Hi SAS Users,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am new to SAS, so I have two questions disturbing me quite a bit:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. With the code below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data screen8;
   set aus_merge2;
   if  s3 ge 0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And there are some missing observations in variable &lt;STRONG&gt;s3&lt;/STRONG&gt; in dataset &lt;STRONG&gt;aus_merge2&lt;/STRONG&gt;. I am wondering if, in dataset &lt;STRONG&gt;screen8&lt;/STRONG&gt;, SAS will delete all observations smaller than 0 and &lt;STRONG&gt;all missing observation &lt;/STRONG&gt;from&amp;nbsp;&lt;STRONG&gt;aus_merge2?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;2. &lt;/STRONG&gt;In a linear regression using OLS:&amp;nbsp;&lt;STRONG&gt; y = ax1 + bx2&amp;nbsp; + cx3 +...&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;so, in the&lt;STRONG&gt; same observation, &lt;/STRONG&gt;when&lt;STRONG&gt; any in y, x1,x2,x3, x4 is missing, the program will ignore totally this observation?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Many thanks and warm regards,&lt;/STRONG&gt;&lt;/P&gt;
&lt;DIV id="eJOY__extension_root" class="eJOY__extension_root_class" style="all: unset;"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Tue, 26 Jan 2021 03:36:02 GMT</pubDate>
    <dc:creator>Phil_NZ</dc:creator>
    <dc:date>2021-01-26T03:36:02Z</dc:date>
    <item>
      <title>Comparing number with missing variable, and basic linear regression question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-number-with-missing-variable-and-basic-linear/m-p/714151#M220427</link>
      <description>&lt;P&gt;Hi SAS Users,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am new to SAS, so I have two questions disturbing me quite a bit:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. With the code below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data screen8;
   set aus_merge2;
   if  s3 ge 0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And there are some missing observations in variable &lt;STRONG&gt;s3&lt;/STRONG&gt; in dataset &lt;STRONG&gt;aus_merge2&lt;/STRONG&gt;. I am wondering if, in dataset &lt;STRONG&gt;screen8&lt;/STRONG&gt;, SAS will delete all observations smaller than 0 and &lt;STRONG&gt;all missing observation &lt;/STRONG&gt;from&amp;nbsp;&lt;STRONG&gt;aus_merge2?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;2. &lt;/STRONG&gt;In a linear regression using OLS:&amp;nbsp;&lt;STRONG&gt; y = ax1 + bx2&amp;nbsp; + cx3 +...&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;so, in the&lt;STRONG&gt; same observation, &lt;/STRONG&gt;when&lt;STRONG&gt; any in y, x1,x2,x3, x4 is missing, the program will ignore totally this observation?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Many thanks and warm regards,&lt;/STRONG&gt;&lt;/P&gt;
&lt;DIV id="eJOY__extension_root" class="eJOY__extension_root_class" style="all: unset;"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 26 Jan 2021 03:36:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-number-with-missing-variable-and-basic-linear/m-p/714151#M220427</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-01-26T03:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing number with missing variable, and basic linear regression question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-number-with-missing-variable-and-basic-linear/m-p/714157#M220430</link>
      <description>&lt;P&gt;1) Numeric variable, missing value is the lowest value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; You can check for missing value by:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;     &amp;nbsp; if var eq . then ... /* compare to a dot */
/* or by */
      if missing(var) then ...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; 2) An outcome of computation with missing value is missing value,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;except&amp;nbsp; when using&amp;nbsp;&lt;STRONG&gt;sum(of var1, var2, .....)&lt;/STRONG&gt; then it will ignore missing&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;values and treat then as zero, or in some procedures where you can&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; choose an option how to treat missing value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 05:00:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-number-with-missing-variable-and-basic-linear/m-p/714157#M220430</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-01-26T05:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing number with missing variable, and basic linear regression question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-number-with-missing-variable-and-basic-linear/m-p/714166#M220438</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;thank you for your dedicated answer. So, you mean, missing observation even smaller than negative value as you say it is the lowest value, did I explain you properly ?&lt;/P&gt;
&lt;DIV id="eJOY__extension_root" class="eJOY__extension_root_class" style="all: unset;"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 26 Jan 2021 07:19:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-number-with-missing-variable-and-basic-linear/m-p/714166#M220438</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-01-26T07:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing number with missing variable, and basic linear regression question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-number-with-missing-variable-and-basic-linear/m-p/714169#M220441</link>
      <description>&lt;P&gt;True,&amp;nbsp;&lt;SPAN&gt;missing value is even smaller than any negative value.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 07:41:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-number-with-missing-variable-and-basic-linear/m-p/714169#M220441</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-01-26T07:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing number with missing variable, and basic linear regression question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-number-with-missing-variable-and-basic-linear/m-p/714172#M220444</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thank you for your confirm, a further question is what is this code for ?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;       if var eq . then ... /* compare to a dot */
/* or by */
      if missing(var) then ...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Because of the missing observation will display ".", but why you let "..." compare to the dot ( I do not know why we need to compare to the dot) ? Thank you!&lt;/P&gt;
&lt;DIV id="eJOY__extension_root" class="eJOY__extension_root_class" style="all: unset;"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 26 Jan 2021 07:45:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-number-with-missing-variable-and-basic-linear/m-p/714172#M220444</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-01-26T07:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing number with missing variable, and basic linear regression question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-number-with-missing-variable-and-basic-linear/m-p/714184#M220456</link>
      <description>&lt;P&gt;A missing value is displayed as a dot without the quotation marks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use ...to say " add any wanted code " following the THEN.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 08:19:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-number-with-missing-variable-and-basic-linear/m-p/714184#M220456</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-01-26T08:19:36Z</dc:date>
    </item>
  </channel>
</rss>

