<?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: Automatic linear calculation in SAS Software for Learning Community</title>
    <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853936#M899</link>
    <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;( sorry, but it's not clear to me what you want exactly )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Previous program had method=step.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Now I changed method=step into method=join.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.class;
 set sashelp.class;
 datum = _N_;
 if mod(_N_,3) NE 0 then do; weight=.; height=.; end;
run;

PROC EXPAND data=work.class out=work.class_out 
            method=join EXTRAPOLATE from=day to=day;
 id datum;
 convert weight = weight_out ;
 convert height = height_out ;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
    <pubDate>Sun, 15 Jan 2023 21:16:16 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2023-01-15T21:16:16Z</dc:date>
    <item>
      <title>Automatic linear calculation</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853066#M869</link>
      <description>&lt;P&gt;&lt;BR /&gt;I have -&lt;BR /&gt;A list of months called "priod" from month 1 to month 360 in varying leaps - sometimes of three months, sometimes half a year, sometimes a year. At the same time there is a column called "b" and accordingly a product price for each such period. These two variables I mentioned are in a table called CHANGE_PERIOD.&lt;BR /&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;priod&lt;BR /&gt;1&lt;BR /&gt;3&lt;BR /&gt;6&lt;BR /&gt;12&lt;BR /&gt;24&lt;BR /&gt;36&lt;/P&gt;&lt;P&gt;60&lt;/P&gt;&lt;P&gt;120.....&lt;/P&gt;&lt;P&gt;until 360&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;b&lt;/P&gt;&lt;P&gt;10&lt;BR /&gt;30&lt;BR /&gt;30&lt;BR /&gt;60&lt;/P&gt;&lt;P&gt;70&lt;/P&gt;&lt;P&gt;90&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want-&lt;BR /&gt;Create a new column called "New" for those 360 months, where in this column the price changes every month in a linear calculation of what the price would have been if the change had happened every month. Example of what I need:&lt;BR /&gt;period_new&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;5&lt;BR /&gt;6&lt;BR /&gt;7&lt;BR /&gt;8&lt;BR /&gt;9&lt;BR /&gt;10&lt;BR /&gt;until 360&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;b&lt;BR /&gt;10&lt;BR /&gt;20&lt;BR /&gt;30&lt;BR /&gt;30&lt;/P&gt;&lt;P&gt;30&lt;/P&gt;&lt;P&gt;.............. 360 prices&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 14:15:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853066#M869</guid>
      <dc:creator>ziv</dc:creator>
      <dc:date>2023-01-10T14:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic linear calculation</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853376#M870</link>
      <description>&lt;P&gt;SAS/ETS User's Guide&lt;BR /&gt;The EXPAND Procedure&lt;BR /&gt;Interpolating Missing Values&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/etsug/etsug_expand_gettingstarted04.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/etsug/etsug_expand_gettingstarted04.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Requesting Different Interpolation Methods&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/etsug/etsug_expand_gettingstarted05.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/etsug/etsug_expand_gettingstarted05.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Svolba, Gerhard, 2021.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Have-a-look-at-your-TIMESERIES-data-from-a-bird-s-eye-view/ta-p/717449" target="_self"&gt;Have a look at your TIMESERIES data from a bird's-eye view - Profile their missing value structure&lt;/A&gt;, SAS Communities&lt;/P&gt;
&lt;P&gt;Svolba, Gerhard, 2021.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Replace-MISSING-VALUES-in-TIMESERIES-DATA-using-PROC-EXPAND-and/ta-p/714806" target="_self"&gt;Replace MISSING VALUES in TIMESERIES DATA using PROC EXPAND and PROC TIMESERIES&lt;/A&gt;, SAS Communities&lt;/P&gt;
&lt;P&gt;Svolba, Gerhard, 2021.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Using-the-TIMESERIES-procedure-to-check-the-continuity-of-your/ta-p/714678" target="_self"&gt;Using the TIMESERIES procedure to check the continuity of your timeseries data&lt;/A&gt;, SAS Communities&lt;/P&gt;
&lt;P&gt;Svolba, Gerhard, 2021.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/The-structure-of-MISSING-VALUES-in-your-data-get-a-clearer/ta-p/712770" target="_self"&gt;The structure of MISSING VALUES in your data - get a clearer picture with the %MV_PROFILING macro&lt;/A&gt;, SAS Communities&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 23:39:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853376#M870</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-01-11T23:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic linear calculation</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853409#M871</link>
      <description>&lt;P&gt;Hi, first of all, thank you very much for your reply.&lt;BR /&gt;I did not find a place that explains how to fill in the gaps with a linear change.&lt;BR /&gt;In the examples you sent, I saw that they show how to return the previous figure, average, value 0, etc.&lt;BR /&gt;Thanks, Ziv&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 09:14:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853409#M871</guid>
      <dc:creator>ziv</dc:creator>
      <dc:date>2023-01-12T09:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic linear calculation</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853416#M872</link>
      <description>&lt;P&gt;Is this what you want (linear interpolation with method=join in PROC EXPAND)?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
datum='01OCT2022'd; value=0;    output;
datum='01JAN2023'd; value=1000; output;
run;

PROC EXPAND data=have out=want method=join to=month;
 id datum;
 convert value;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 11:05:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853416#M872</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-01-12T11:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic linear calculation</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853432#M873</link>
      <description>&lt;P&gt;I need the missing values to be automatically linear, for example everything between 3 and 6 should be 0.91&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;&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="להשתמש.jpeg" style="width: 311px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79312i9769A6CCDEC51C6E/image-dimensions/311x1193?v=v2" width="311" height="1193" role="button" title="להשתמש.jpeg" alt="להשתמש.jpeg" /&gt;&lt;/span&gt;&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>Thu, 12 Jan 2023 12:17:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853432#M873</guid>
      <dc:creator>ziv</dc:creator>
      <dc:date>2023-01-12T12:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic linear calculation</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853434#M874</link>
      <description>&lt;P&gt;I need the missing values to be automatically linear, for example everything between 1 and 12 should be 0.91&amp;nbsp;&lt;/P&gt;&lt;P&gt; thanks evryone ;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="להשתמש.jpeg" style="width: 248px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79313iA0A240A1C8773E89/image-dimensions/248x951?v=v2" width="248" height="951" role="button" title="להשתמש.jpeg" alt="להשתמש.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 12:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853434#M874</guid>
      <dc:creator>ziv</dc:creator>
      <dc:date>2023-01-12T12:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic linear calculation</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853442#M875</link>
      <description>&lt;P&gt;You want this ??&lt;BR /&gt;I already know the answer , because I have just (5 seconds ago) seen your screenshot.&lt;BR /&gt;The answer is &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;NO&lt;/STRONG&gt;&lt;/FONT&gt; --&amp;gt; You do NOT want the below , but I am still publishing the program&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
date='01JAN2022'd; value=1;  output;
date='01DEC2022'd; value=12; output;
run;

proc timedata data=have out=want
              print=(/*scalars*/ arrays);
              id date interval=month acc=t format=yymmdd.;
              vars value;
              outarrays  myvalue;
              *outscalars mystats;

	   do t = 1 to 1;
		myvalue[t] = value[t];
       end;
       do t = 2 to dim(value);
		myvalue[t] = (12-1)/10;
       end;

run;
QUIT;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 14:08:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853442#M875</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-01-12T14:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic linear calculation</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853444#M876</link>
      <description>&lt;P&gt;Screenshot made it clear to me.&lt;BR /&gt;What you want is the "LAST VALUE CARRIED FORWARD" missing value imputation.&lt;BR /&gt;You can look in this communities for LACF or "LAST VALUE CARRIED FORWARD" , you will find many hits.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For numeric variables , it's extremely easy.&lt;BR /&gt;Just use PROC EXPAND with &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;method=step&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; for missing value interpolation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need an example?&lt;/P&gt;
&lt;P&gt;BR,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 14:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853444#M876</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-01-12T14:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic linear calculation</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853480#M877</link>
      <description>&lt;P&gt;Actually yes, I would love an example.&lt;BR /&gt;I'm new with sas,&lt;/P&gt;&lt;P&gt;thank you very very &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 15:55:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853480#M877</guid>
      <dc:creator>ziv</dc:creator>
      <dc:date>2023-01-12T15:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic linear calculation</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853549#M883</link>
      <description>&lt;P&gt;Here you are :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.class;
 set sashelp.class;
 datum = _N_;
 if mod(_N_,3) NE 0 then do; weight=.; height=.; end;
run;

PROC EXPAND data=work.class out=work.class_out 
            method=step EXTRAPOLATE from=day to=day;
 id datum;
 convert weight = weight_out ;
 convert height = height_out ;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 19:19:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853549#M883</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-01-12T19:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic linear calculation</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853899#M898</link>
      <description>&lt;P&gt;Thanks, but that's still not what I meant.&lt;BR /&gt;In your command between 5-7 he will put the value that was before -5&lt;BR /&gt;I want him to apply 6, a linear increase/decrease in this case an increase.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jan 2023 07:02:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853899#M898</guid>
      <dc:creator>ziv</dc:creator>
      <dc:date>2023-01-15T07:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic linear calculation</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853936#M899</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;( sorry, but it's not clear to me what you want exactly )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Previous program had method=step.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Now I changed method=step into method=join.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.class;
 set sashelp.class;
 datum = _N_;
 if mod(_N_,3) NE 0 then do; weight=.; height=.; end;
run;

PROC EXPAND data=work.class out=work.class_out 
            method=join EXTRAPOLATE from=day to=day;
 id datum;
 convert weight = weight_out ;
 convert height = height_out ;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jan 2023 21:16:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Automatic-linear-calculation/m-p/853936#M899</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-01-15T21:16:16Z</dc:date>
    </item>
  </channel>
</rss>

