<?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: Piecewise regression in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/893854#M353107</link>
    <description>&lt;P&gt;I don't have time value for the interval= option!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2023 17:20:44 GMT</pubDate>
    <dc:creator>LOLO12</dc:creator>
    <dc:date>2023-09-12T17:20:44Z</dc:date>
    <item>
      <title>Piecewise regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/881285#M348222</link>
      <description>Hello,&lt;BR /&gt;I have a math problem that is not straight forward. I have data where the slope is not increasing or decreasing. It is flat some time and then increasing or decreasing. This type of data called piecewise linear regression. I suppose to calculate the slopes and only keep the slope where it is significant change and not flat. The issue all solutions online present some codes that I suppose to decide manually.&lt;BR /&gt;I need to decide in the slope automatically bc I have 20 subjects and they have 5 treatments and 3 conditions. Please let me know if you can help I can send a dummy data.</description>
      <pubDate>Sat, 17 Jun 2023 18:49:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/881285#M348222</guid>
      <dc:creator>LOLO12</dc:creator>
      <dc:date>2023-06-17T18:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Piecewise regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/881288#M348224</link>
      <description>&lt;P&gt;Example of piecewise regression in SAS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_nlin_examples01.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_nlin_examples01.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jun 2023 20:15:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/881288#M348224</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-06-17T20:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Piecewise regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/881289#M348225</link>
      <description>&lt;P&gt;Your question is also known as&lt;/P&gt;
&lt;UL class="lia-list-style-type-square"&gt;
&lt;LI&gt;segmented regression&lt;/LI&gt;
&lt;LI&gt;change point models&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Segmented regression models in SAS &lt;BR /&gt;By Rick Wicklin on The DO Loop December 14, 2020&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2020/12/14/segmented-regression-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2020/12/14/segmented-regression-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;A segmented regression model is a piecewise regression model that has two or more sub-models, each defined on a separate domain for the explanatory variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS/STAT User's Guide&lt;BR /&gt;The MCMC Procedure&lt;BR /&gt;Example 80.12 Change Point Models&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_037/statug/statug_mcmc_examples18.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/v_037/statug/statug_mcmc_examples18.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jun 2023 20:28:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/881289#M348225</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-06-17T20:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Piecewise regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/893838#M353098</link>
      <description>&lt;P&gt;these only demonstrate if the model is quadratic and not linear. I need it for a linear equation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 16:11:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/893838#M353098</guid>
      <dc:creator>LOLO12</dc:creator>
      <dc:date>2023-09-12T16:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Piecewise regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/893842#M353100</link>
      <description>&lt;P&gt;Do you have many repeated measurements for your patients?&lt;/P&gt;
&lt;P&gt;Are the repeated measurements equally spaced and forming a time series?&lt;BR /&gt;You could also work with so-called "structural break detection"-methods in time series analysis.&lt;/P&gt;
&lt;P&gt;You can detect changing level , changing slope , changing regressor influence , changing variability , changing seasonality , ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 16:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/893842#M353100</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-09-12T16:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Piecewise regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/893846#M353103</link>
      <description>&lt;P&gt;it is equally spaced and structured.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not familiar with Time series. Do you have an example?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 16:41:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/893846#M353103</guid>
      <dc:creator>LOLO12</dc:creator>
      <dc:date>2023-09-12T16:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Piecewise regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/893848#M353104</link>
      <description>&lt;P&gt;SAS® 9.4 and SAS® Viya® 3.5 Programming Documentation&lt;BR /&gt;SAS/ETS 15.3 User's Guide&lt;BR /&gt;The UCM Procedure&lt;BR /&gt;Example 42.7 Detection of Level Shift&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/etsug/etsug_ucm_examples07.htm" target="_blank" rel="noopener"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/etsug/etsug_ucm_examples07.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;(checkbreak option in LEVEL statement of PROC UCM)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The UCM procedure analyzes and forecasts equally spaced univariate time series data by using an unobserved components model (UCM). The UCMs are also called&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;EM&gt;structural models&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;in the time series literature.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 16:50:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/893848#M353104</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-09-12T16:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Piecewise regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/893854#M353107</link>
      <description>&lt;P&gt;I don't have time value for the interval= option!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 17:20:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/893854#M353107</guid>
      <dc:creator>LOLO12</dc:creator>
      <dc:date>2023-09-12T17:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Piecewise regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/893938#M353138</link>
      <description>&lt;P&gt;You can make a row number and use interval=day (space between adjacent observations = 1) :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Like here :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.class; set sashelp.class; rownum=_N_; run;

proc ucm data=work.class;
   id rownum interval=day;
   model height;
   irregular;
   level plot=smooth checkbreak;
   estimate;
  *forecast plot=decomp;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;[EDIT] &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;Do you have a datetime variable for your measurements?&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;In that case, and if the (equal) interval in-between measurements is not a typical one (like day, week, 10-days, month, ...), then you can make a &lt;FONT color="#008000"&gt;&lt;STRONG&gt;custom interval&lt;/STRONG&gt;&lt;/FONT&gt; and specify that one in interval= option.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 21:02:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Piecewise-regression/m-p/893938#M353138</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-09-12T21:02:36Z</dc:date>
    </item>
  </channel>
</rss>

