<?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: Tail of Normal Density Curve Extends Below 0 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928759#M365449</link>
    <description>&lt;P&gt;Sorry about that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;, I shared code below in another response.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 May 2024 21:47:06 GMT</pubDate>
    <dc:creator>Adele3</dc:creator>
    <dc:date>2024-05-16T21:47:06Z</dc:date>
    <item>
      <title>Tail of Normal Density Curve Extends Below 0</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928740#M365443</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I produced a histogram for a single continuous variable (minimum value=0, mean=31, SD=14) using PROC SGPLOT. I included a normal density curve for the distribution, as well as a normal density curve for the same continuous variable from a standard population for comparison (lowest possible value=0, mean=43, SD=26.0).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Given the lowest possible value is 0, I am not sure why the left tail of my normal curves extend past 0, and do not intersect at 0. Any insight would be very much appreciated! Thank you:)&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 20:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928740#M365443</guid>
      <dc:creator>Adele3</dc:creator>
      <dc:date>2024-05-16T20:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Tail of Normal Density Curve Extends Below 0</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928755#M365445</link>
      <description>&lt;P&gt;Code.&lt;/P&gt;
&lt;P&gt;Can't tell what happened without the code.&lt;/P&gt;
&lt;P&gt;Which will need to include the data used for the histogram.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 21:20:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928755#M365445</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-05-16T21:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Tail of Normal Density Curve Extends Below 0</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928756#M365446</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/464202"&gt;@Adele3&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/464202"&gt;@Adele3&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Given the lowest possible value is 0, I am not sure why the left tail of my normal curves extend past 0, and do not intersect at 0.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;While the lowest possible value of your&amp;nbsp;&lt;SPAN&gt;continuous variable&amp;nbsp;may be 0, there is no lower limit to the values of a normal distribution. You can use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n1rnj32uvtwnvfn1kwnsg9d6w6h7.htm" target="_blank" rel="noopener"&gt;CDF function&lt;/A&gt; to compute the probability that a random variable with a normal distribution (with mean &lt;FONT face="symbol"&gt;m&lt;/FONT&gt; and standard deviation &lt;FONT face="symbol"&gt;s&lt;/FONT&gt;) takes a negative value:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
p1=cdf('normal',0,31,14);
p2=cdf('normal',0,43,26);
put (p:)(=/);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Result:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;p1=0.0134045654
p2=0.0490793878&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;So, using the mean and SD values you mentioned, these probabilities are small, but clearly positive.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A normal distribution may &lt;EM&gt;approximate&lt;/EM&gt; the distribution of your variable quite well regardless of the discrepancy for negative values. But there are also continuous distributions whose probability density is exactly zero for negative values. They may or may not provide a better approximation.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 21:21:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928756#M365446</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-05-16T21:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Tail of Normal Density Curve Extends Below 0</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928757#M365447</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for taking the time to share these details - I really appreciate it!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since a standard normal distribution is continuous I believe it can theoretically extend indefinitely, however I am still not clear why a random variable within my normal distributions could take a negative value when this is not plausible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You shared that&amp;nbsp;&lt;SPAN&gt;there are continuous distributions whose probability density is exactly zero for negative values, am I able to specify in my code that random negative values are not plausible?&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC SGPLOT DATA=test; 
     HISTOGRAM score1 / FILLATTRS=(COLOR=LIGGR);
     DENSITY score1 / TYPE=normal LINEATTRS=(COLOR=black pattern=1) NAME="normal" LEGENDLABEL="normal curve 1";
     DENSITY score1 / TYPE=normal (MU=43 SIGMA=26) LINEATTRS=(COLOR=black pattern=2) NAME="standard" &lt;BR /&gt;                           LEGENDLABEL="normal curve 2";
     KEYLEGEND "normal" "standard" / LOCATION=inside POSITION=topright ACROSS=1; 
     XAXIS LABEL='score' MIN=0 OFFSETMIN=0.05 MAX=120;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 21:45:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928757#M365447</guid>
      <dc:creator>Adele3</dc:creator>
      <dc:date>2024-05-16T21:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Tail of Normal Density Curve Extends Below 0</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928759#M365449</link>
      <description>&lt;P&gt;Sorry about that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;, I shared code below in another response.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 21:47:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928759#M365449</guid>
      <dc:creator>Adele3</dc:creator>
      <dc:date>2024-05-16T21:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Tail of Normal Density Curve Extends Below 0</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928761#M365451</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/464202"&gt;@Adele3&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Sorry about that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;, I shared code below in another response.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;However there is no data.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 21:54:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928761#M365451</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-05-16T21:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Tail of Normal Density Curve Extends Below 0</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928773#M365454</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/464202"&gt;@Adele3&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am still not clear why a random variable within my normal distributions could take a negative value when this is not plausible.&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Those normal distributions are only &lt;EM&gt;approximations&lt;/EM&gt;. They will &lt;EM&gt;not&lt;/EM&gt; match &lt;EM&gt;exactly&lt;/EM&gt; the (unknown) distribution of your SCORE1 variable. The same is true for other theoretical distributions (including strictly positive distributions). This is a very common situation. Nobody will conclude that your scores might be negative&amp;nbsp;sometimes or that the normal approximation is invalid because of that minor and unavoidable discrepancy. If, for example, rainfall data are approximated by a normal distribution, it goes without saying that nevertheless rainfall is always non-negative.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your PROC SGPLOT step you can only try to avoid displaying negative tick marks (e.g., by using the MIN=0 option of the XAXIS statement, as you have done already, or with options of the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/grstatproc/n17xrpcduau1f8n1c1nhe477pv18.htm#n1vm03quwjchpan1tly8hdq6bdlf" target="_blank" rel="noopener"&gt;HISTOGRAM statement&lt;/A&gt;). You cannot force the normal density curves through the origin, though, as this would contradict their definition.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 23:21:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928773#M365454</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-05-16T23:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Tail of Normal Density Curve Extends Below 0</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928787#M365460</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;, you have been very helpful!&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 03:15:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tail-of-Normal-Density-Curve-Extends-Below-0/m-p/928787#M365460</guid>
      <dc:creator>Adele3</dc:creator>
      <dc:date>2024-05-17T03:15:23Z</dc:date>
    </item>
  </channel>
</rss>

