<?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: How do I calculate the slope from a series of data points? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-the-slope-from-a-series-of-data-points/m-p/146493#M7697</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;BR /&gt;input x y;&lt;BR /&gt;datalines;&lt;BR /&gt;4.20 10&lt;BR /&gt;4.27 20&lt;BR /&gt;4.29 30&lt;BR /&gt;4.58 40&lt;BR /&gt;4.73 50&lt;BR /&gt;4.82 60&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods output parameterEstimates=slope;&lt;BR /&gt;proc reg data=have;&lt;BR /&gt;model y=x;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=slope;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Slope dataset will have intercept and slope.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Oct 2014 20:36:10 GMT</pubDate>
    <dc:creator>stat_sas</dc:creator>
    <dc:date>2014-10-28T20:36:10Z</dc:date>
    <item>
      <title>How do I calculate the slope from a series of data points?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-the-slope-from-a-series-of-data-points/m-p/146491#M7695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OK, so plotting a graph, pretty straightforward:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;X axis = concentration of the chemical (log transformed)&lt;/P&gt;&lt;P&gt;Y axis = percent mortality&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT - how do I calculate the actual slope? Could you offer me code to do that? I am using SAS version 9.3 on a PC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example data points:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x = 4.20, y = 10&lt;/P&gt;&lt;P&gt;x = 4.27, y = 20&lt;/P&gt;&lt;P&gt;x = 4.29, y = 30&lt;/P&gt;&lt;P&gt;x = 4.58, y = 40&lt;/P&gt;&lt;P&gt;x = 4.73, y = 50&lt;/P&gt;&lt;P&gt;x = 4.82, y = 60&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peppy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 20:01:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-the-slope-from-a-series-of-data-points/m-p/146491#M7695</guid>
      <dc:creator>Pepperoni</dc:creator>
      <dc:date>2014-10-28T20:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I calculate the slope from a series of data points?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-the-slope-from-a-series-of-data-points/m-p/146492#M7696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;m = (y2-y1)/(x2-x1) or assuming you have the pairs and want the slope from the previous point;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; slope = (y - lag(y))/(x-lag(x));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 20:13:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-the-slope-from-a-series-of-data-points/m-p/146492#M7696</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-10-28T20:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I calculate the slope from a series of data points?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-the-slope-from-a-series-of-data-points/m-p/146493#M7697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;BR /&gt;input x y;&lt;BR /&gt;datalines;&lt;BR /&gt;4.20 10&lt;BR /&gt;4.27 20&lt;BR /&gt;4.29 30&lt;BR /&gt;4.58 40&lt;BR /&gt;4.73 50&lt;BR /&gt;4.82 60&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods output parameterEstimates=slope;&lt;BR /&gt;proc reg data=have;&lt;BR /&gt;model y=x;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=slope;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Slope dataset will have intercept and slope.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 20:36:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-the-slope-from-a-series-of-data-points/m-p/146493#M7697</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-10-28T20:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I calculate the slope from a series of data points?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-the-slope-from-a-series-of-data-points/m-p/146494#M7698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I couldn't find an easy way to add the slope in to the graph automatically.&amp;nbsp; GPLOT provides the entire regression equation but its at the bottom and not pretty. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input x y;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;4.20 10&lt;/P&gt;&lt;P&gt;4.27 20&lt;/P&gt;&lt;P&gt;4.29 30&lt;/P&gt;&lt;P&gt;4.58 40&lt;/P&gt;&lt;P&gt;4.73 50&lt;/P&gt;&lt;P&gt;4.82 60&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods output parameterEstimates=slope;&lt;/P&gt;&lt;P&gt;proc reg data=have;&lt;/P&gt;&lt;P&gt;model y=x;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select Estimate into :slope from slope where variable='x';&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; scatter x=x y=y;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg x=x y=y/degree=1 curvelabel="Slope=&amp;amp;slope" curvelabelpos=end;&lt;/P&gt;&lt;P&gt;run;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 22:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-the-slope-from-a-series-of-data-points/m-p/146494#M7698</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-10-28T22:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I calculate the slope from a series of data points?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-the-slope-from-a-series-of-data-points/m-p/146495#M7699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the INSET statement to display the slope after you've computed it: &lt;A href="http://blogs.sas.com/content/iml/2013/02/27/slope-of-a-regression-line/" title="http://blogs.sas.com/content/iml/2013/02/27/slope-of-a-regression-line/"&gt; How to use PROC SGPLOT to display the slope and intercept of a regression line - The DO Loop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 18:11:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-the-slope-from-a-series-of-data-points/m-p/146495#M7699</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-10-29T18:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I calculate the slope from a series of data points?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-the-slope-from-a-series-of-data-points/m-p/146496#M7700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all so much! This is so helpful - this will really assist me. I appreciate your time!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Nov 2014 18:58:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-calculate-the-slope-from-a-series-of-data-points/m-p/146496#M7700</guid>
      <dc:creator>Pepperoni</dc:creator>
      <dc:date>2014-11-02T18:58:02Z</dc:date>
    </item>
  </channel>
</rss>

