<?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: SAS Regression Loop in Set of 20 Observations in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814157#M321378</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The downside of the SET POINT=, in my experience, is that it can generate a lot more input/ouput activity than necessary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each obs in this case would be read in 20 times.&amp;nbsp; The actual input activity would be mitigated of course by operating system caching.&amp;nbsp; But window size 90?&amp;nbsp; Then read each obs 90 times.&amp;nbsp; At some point this will have a major impact on performance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In anticipation of that possibility, I would STONGLY recommend use of a memory-resident technique, so that each obs is read in once, but written out 20 times.&amp;nbsp; That's the main purpose of suggesting _TEMPORARY_ arrays to store the rolling series of X1, X2, and Y.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 May 2022 18:57:16 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2022-05-18T18:57:16Z</dc:date>
    <item>
      <title>SAS Regression Loop in Set of 20 Observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814053#M321328</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a sample of 40 observations. The plan is to:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Take the first 20 observations (i.e., obs 1 to 20).&lt;/LI&gt;
&lt;LI&gt;Run a regression&lt;/LI&gt;
&lt;LI&gt;Keep the result&lt;/LI&gt;
&lt;LI&gt;Take the next 20 observation (i.e., obs 2 to 21).&lt;/LI&gt;
&lt;LI&gt;Repeat until you reach the maximum (i.e., obs 21 to obs 40).&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help will be greatly appreciated. If possible, I would like to keep the line as little as possible as I have quite a lot of observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;David&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x1 x2 y;
datalines;
69	0.901225752	0.535917754
26	0.979065064	0.328516725
21	0.462043623	0.928984209
70	0.372254307	0.020944067
26	0.70178162	0.015753384
22	0.755669857	0.287674489
45	0.621848244	0.876177263
23	0.049950103	0.524321342
75	0.323187042	0.458245799
62	0.988737694	0.528055761
59	0.047655873	0.637754194
59	0.499943648	0.997049298
25	0.597043632	0.556921095
92	0.679854964	0.433165676
29	0.686543133	0.720057785
35	0.861474371	0.344762962
79	0.591574823	0.876250534
53	0.741976868	0.430488835
71	0.146723447	0.605425714
75	0.435811738	0.861299126
96	0.785859466	0.717045755
99	0.520055579	0.784497337
58	0.394083913	0.712998746
61	0.875958722	0.667760878
15	0.561292166	0.836592031
56	0.652887463	0.236309836
9	0.344428535	0.224147253
6	0.785126736	0.435528686
72	0.847421203	0.160322663
78	0.663642034	0.466674263
83	0.333921138	0.029331531
77	0.486751999	0.706800698
92	0.801502963	0.788823137
9	0.578615463	0.347239912
41	0.053458445	0.094070384
68	0.251134914	0.103399917
2	0.49184594	0.102494486
97	0.120083405	0.055981267
78	0.5423958	0.181672902
17	0.834739212	0.142969285
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 18 May 2022 13:15:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814053#M321328</guid>
      <dc:creator>DavidLie</dc:creator>
      <dc:date>2022-05-18T13:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Regression Loop in Set of 20 Observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814072#M321330</link>
      <description>&lt;P&gt;You want rolling window regressions, with window size of 20.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before I get into the code for doing this, how many regressions do you expect to produce.&amp;nbsp; For 1,000 observations, you are asking for 981 regressions.&amp;nbsp; So you better decide how you want the output of those regressions produced (I don't think you want 981 regression reports in the form of printouts).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is code to produce a data set of two windows (1-20 and 2-21), identified as windows W=1 and W=2 respectively:&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let window_size=20;
data have;
input x1 x2 y;
datalines;
69	0.901225752	0.535917754
26	0.979065064	0.328516725
21	0.462043623	0.928984209
70	0.372254307	0.020944067
26	0.70178162	0.015753384
22	0.755669857	0.287674489
45	0.621848244	0.876177263
23	0.049950103	0.524321342
75	0.323187042	0.458245799
62	0.988737694	0.528055761
59	0.047655873	0.637754194
59	0.499943648	0.997049298
25	0.597043632	0.556921095
92	0.679854964	0.433165676
29	0.686543133	0.720057785
35	0.861474371	0.344762962
79	0.591574823	0.876250534
53	0.741976868	0.430488835
71	0.146723447	0.605425714
75	0.435811738	0.861299126
96	0.785859466	0.717045755
99	0.520055579	0.784497337
58	0.394083913	0.712998746
61	0.875958722	0.667760878
15	0.561292166	0.836592031
56	0.652887463	0.236309836
9	0.344428535	0.224147253
6	0.785126736	0.435528686
72	0.847421203	0.160322663
78	0.663642034	0.466674263
83	0.333921138	0.029331531
77	0.486751999	0.706800698
92	0.801502963	0.788823137
9	0.578615463	0.347239912
41	0.053458445	0.094070384
68	0.251134914	0.103399917
2	0.49184594	0.102494486
97	0.120083405	0.055981267
78	0.5423958	0.181672902
17	0.834739212	0.142969285
run;
data rolling_windows (drop=i) / view=rolling_windows;
  array _y  {&amp;amp;window_size} _temporary_;
  array _x1 {&amp;amp;window_size} _temporary_;
  array _x2 {&amp;amp;window_size} _temporary_;

  set have ;
  _y{mod(_n_,&amp;amp;window_size)+1}=y;
  _x1{mod(_n_,&amp;amp;window_size)+1}=x1;
  _x2{mod(_n_,&amp;amp;window_size)+1}=x2;

  if _n_&amp;gt;=20;
  W+1 ;    /*window number*/
  do i=1 to &amp;amp;window_size;
    y=_y{i};
    x1=_x1{i};
    x2=_x2{i};
    output;
  end;
  if w=2 then stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Take a look at the resulting data set view, and decide what PROC REG can do for you that you want for the 2 windows, and what format you want to see the results of PROC REG (i.e. what should the resulting dataset look like).&amp;nbsp; &amp;nbsp;Then one can construct some sort of&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=rolling_windows ..... ;
  by W;
  model ... ;
  ... other proc reg statements .... ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Run a few of the above with PROC REG statements you determine that you need.&amp;nbsp; Then get back to us.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, the larger the window size, the longer this takes.&amp;nbsp; Even though there are maringally fewer windows, the PROC REG has to calculate SSCP for more observations - meaning each observation enters into more proc regs.&amp;nbsp; One could consider generating rolling SSCP's, but I wouldn't recommend that at this poin.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edtted note:&amp;nbsp; Oh yes, is this a single series?&amp;nbsp; Or is there some sort of ID that changes over the course of the data stream?&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 14:28:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814072#M321330</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2022-05-18T14:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Regression Loop in Set of 20 Observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814073#M321331</link>
      <description>&lt;P&gt;Your favorite internet search engine finds lots of hits for "Rolling window regression in SAS"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code has already been written for this, so you don't have to write it yourself.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 14:31:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814073#M321331</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-18T14:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Regression Loop in Set of 20 Observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814086#M321334</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/25583"&gt;@DavidLie&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You didn't specify but I assume the output of each loop is the regression coefficients and fit statistics.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see below an example macro which takes the input data and preferred step size to create a loop of regressions which get collapsed into a single performance table. Is that what you were after?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Create Data;
data have;
input x1 x2 y ;
datalines;
69 0.901225752 0.535917754
26 0.979065064 0.328516725
21 0.462043623 0.928984209
70 0.372254307 0.020944067
26 0.70178162 0.015753384
22 0.755669857 0.287674489
45 0.621848244 0.876177263
23 0.049950103 0.524321342
75 0.323187042 0.458245799
62 0.988737694 0.528055761
59 0.047655873 0.637754194
59 0.499943648 0.997049298
25 0.597043632 0.556921095
92 0.679854964 0.433165676
29 0.686543133 0.720057785
35 0.861474371 0.344762962
79 0.591574823 0.876250534
53 0.741976868 0.430488835
71 0.146723447 0.605425714
75 0.435811738 0.861299126
96 0.785859466 0.717045755
99 0.520055579 0.784497337
58 0.394083913 0.712998746
61 0.875958722 0.667760878
15 0.561292166 0.836592031
56 0.652887463 0.236309836
9 0.344428535 0.224147253
6 0.785126736 0.435528686
72 0.847421203 0.160322663
78 0.663642034 0.466674263
83 0.333921138 0.029331531
77 0.486751999 0.706800698
92 0.801502963 0.788823137
9 0.578615463 0.347239912
41 0.053458445 0.094070384
68 0.251134914 0.103399917
2 0.49184594 0.102494486
97 0.120083405 0.055981267
78 0.5423958 0.181672902
17 0.834739212 0.142969285
;
run;

*Define Macro;
%macro regressionLoop(input,step,out);
%let tblin=work.have;

*add rownumber to input table;
data indx;
set &amp;amp;input;
rownum+1;
run;

*get row count;
proc sql noprint; select count(*) into :numRecs from &amp;amp;input;quit;

%let stepping = %eval(&amp;amp;step - 1);

*derive query parameters;
data ranges(keep=start_num end_num);
cnt = &amp;amp;step;
do while(cnt lt &amp;amp;numRecs+1);
start_num+1;
end_num = start_num + &amp;amp;stepping;
cnt+1;
output;
end;
run;

*get number of loops needed by step;
proc sql noprint; select count(*) into :numQueries from ranges;quit;
%put("starting loop");

%put("number of loops: &amp;amp;numQueries");

*loop build regressions;
%do i=1 %to &amp;amp;numQueries;
%put("loop number &amp;amp;i");

*get upper limit;
proc sql noprint; select end_num into :upper from ranges where start_num = &amp;amp;&amp;amp;i.;quit;

*get dataset based on range;
proc sql noprint; create table regIn as 
select x1,x2,y from indx where rownum between &amp;amp;&amp;amp;i. and &amp;amp;upper.;quit; 

*generate regression;
proc reg data=regIn alpha=0.05  outest=outest   noprint;
	model y=x1 x2/ aic bic edf;
	run;
quit;

data reg_&amp;amp;&amp;amp;i.;
set outest;
_MODEL_ = "Range &amp;amp;&amp;amp;i. - %cmpres(&amp;amp;upper.)";
run;

%end;

%put("ending loop");

*collect reg tables into output table;

data &amp;amp;out;
set reg_1 - reg_%cmpres(&amp;amp;numQueries.);
run;

%mend regressionLoop;

*Call Macro;
%regressionLoop(have,20,out_stats);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output looks something like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HarrySnart_0-1652885247590.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71607i421BFF0C663B69D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HarrySnart_0-1652885247590.png" alt="HarrySnart_0-1652885247590.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 14:49:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814086#M321334</guid>
      <dc:creator>HarrySnart</dc:creator>
      <dc:date>2022-05-18T14:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Regression Loop in Set of 20 Observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814129#M321353</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/25583"&gt;@DavidLie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a sample of 40 observations. The plan is to:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Take the first 20 observations (i.e., obs 1 to 20).&lt;/LI&gt;
&lt;LI&gt;Run a regression&lt;/LI&gt;
&lt;LI&gt;Keep the result&lt;/LI&gt;
&lt;LI&gt;Take the next 20 observation (i.e., obs 2 to 21).&lt;/LI&gt;
&lt;LI&gt;Repeat until you reach the maximum (i.e., obs 21 to obs 40).&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help will be greatly appreciated. If possible, I would like to keep the line as little as possible as I have quite a lot of observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;David&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x1 x2 y;
datalines;
69	0.901225752	0.535917754
26	0.979065064	0.328516725
21	0.462043623	0.928984209
70	0.372254307	0.020944067
26	0.70178162	0.015753384
22	0.755669857	0.287674489
45	0.621848244	0.876177263
23	0.049950103	0.524321342
75	0.323187042	0.458245799
62	0.988737694	0.528055761
59	0.047655873	0.637754194
59	0.499943648	0.997049298
25	0.597043632	0.556921095
92	0.679854964	0.433165676
29	0.686543133	0.720057785
35	0.861474371	0.344762962
79	0.591574823	0.876250534
53	0.741976868	0.430488835
71	0.146723447	0.605425714
75	0.435811738	0.861299126
96	0.785859466	0.717045755
99	0.520055579	0.784497337
58	0.394083913	0.712998746
61	0.875958722	0.667760878
15	0.561292166	0.836592031
56	0.652887463	0.236309836
9	0.344428535	0.224147253
6	0.785126736	0.435528686
72	0.847421203	0.160322663
78	0.663642034	0.466674263
83	0.333921138	0.029331531
77	0.486751999	0.706800698
92	0.801502963	0.788823137
9	0.578615463	0.347239912
41	0.053458445	0.094070384
68	0.251134914	0.103399917
2	0.49184594	0.102494486
97	0.120083405	0.055981267
78	0.5423958	0.181672902
17	0.834739212	0.142969285
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You want to create a data set (or view) with each observation group identified with a variable that can be used in a BY statement for the stat proc you want to call.&amp;nbsp; That will be more efficient that looping the whole process as you describe above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   infile cards expandtabs;
   _obs_=_n_;
   input x1 x2 y;
   datalines;
69	0.901225752	0.535917754
26	0.979065064	0.328516725
21	0.462043623	0.928984209
70	0.372254307	0.020944067
26	0.70178162	0.015753384
22	0.755669857	0.287674489
45	0.621848244	0.876177263
23	0.049950103	0.524321342
75	0.323187042	0.458245799
62	0.988737694	0.528055761
59	0.047655873	0.637754194
59	0.499943648	0.997049298
25	0.597043632	0.556921095
92	0.679854964	0.433165676
29	0.686543133	0.720057785
35	0.861474371	0.344762962
79	0.591574823	0.876250534
53	0.741976868	0.430488835
71	0.146723447	0.605425714
75	0.435811738	0.861299126
96	0.785859466	0.717045755
99	0.520055579	0.784497337
58	0.394083913	0.712998746
61	0.875958722	0.667760878
15	0.561292166	0.836592031
56	0.652887463	0.236309836
9	0.344428535	0.224147253
6	0.785126736	0.435528686
72	0.847421203	0.160322663
78	0.663642034	0.466674263
83	0.333921138	0.029331531
77	0.486751999	0.706800698
92	0.801502963	0.788823137
9	0.578615463	0.347239912
41	0.053458445	0.094070384
68	0.251134914	0.103399917
2	0.49184594	0.102494486
97	0.120083405	0.055981267
78	0.5423958	0.181672902
17	0.834739212	0.142969285
;
run;


%let s = 20; /*sample size*/
data analysis / view=analysis;;
   s = &amp;amp;s;
   f = 1;
   l = s;
   do w = 1 by 1 while(l le nobs);
      do i = f to l while(l le nobs);
         set have nobs=nobs point=i;      
         output;
         end;
      f = f+1;
      l = l+1;
      end;
   call symputx('w',w-1);
   stop;
   run;
%put NOTE: &amp;amp;=w;
sasfile have load;
proc reg noprint data=analysis outest=est;
   by w;
   model y = x: / aic bic edf;
   run;
sasfile have close;
proc print data=est;
   run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 755px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71610iD28612FDB5491FD6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&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>Wed, 18 May 2022 17:12:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814129#M321353</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2022-05-18T17:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Regression Loop in Set of 20 Observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814157#M321378</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The downside of the SET POINT=, in my experience, is that it can generate a lot more input/ouput activity than necessary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each obs in this case would be read in 20 times.&amp;nbsp; The actual input activity would be mitigated of course by operating system caching.&amp;nbsp; But window size 90?&amp;nbsp; Then read each obs 90 times.&amp;nbsp; At some point this will have a major impact on performance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In anticipation of that possibility, I would STONGLY recommend use of a memory-resident technique, so that each obs is read in once, but written out 20 times.&amp;nbsp; That's the main purpose of suggesting _TEMPORARY_ arrays to store the rolling series of X1, X2, and Y.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 18:57:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814157#M321378</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2022-05-18T18:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Regression Loop in Set of 20 Observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814158#M321379</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;This is why I used SASFILE to load HAVE into memory.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 19:02:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814158#M321379</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2022-05-18T19:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Regression Loop in Set of 20 Observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814159#M321380</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;This is why I used SASFILE to load HAVE into memory.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Oops.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 19:04:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Regression-Loop-in-Set-of-20-Observations/m-p/814159#M321380</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2022-05-18T19:04:18Z</dc:date>
    </item>
  </channel>
</rss>

