<?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 generated confidence Intervals for 2-year Lagged Predicted Values? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-generated-confidence-Intervals-for-2-year-Lagged/m-p/350273#M18365</link>
    <description>&lt;P&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The abovementioned code gives a regression equation as follows,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Outcome = Constant + Beta*Exposure&lt;/P&gt;&lt;P&gt;Outcome = 83.23453 + 1.45002*Exposure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I want to predict Outcome for 2005, then it would be 122.4 (83.23453+ 1.45002*(27)). However, if I lag the exposure by 2-year period, then it would be 100.6 (83.23453+ 1.45002*(12)). SAS does the former automatically, but I need to automate the latter because I need the corresponding confidence intervals for the predicted values based on 2-year exposure lag. I hope this clarified the question.&lt;/P&gt;</description>
    <pubDate>Sat, 15 Apr 2017 15:41:21 GMT</pubDate>
    <dc:creator>ImSame</dc:creator>
    <dc:date>2017-04-15T15:41:21Z</dc:date>
    <item>
      <title>How do I generated confidence Intervals for 2-year Lagged Predicted Values?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-generated-confidence-Intervals-for-2-year-Lagged/m-p/350265#M18363</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My dataset is in the following format&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Year Exposure Outcome&lt;/P&gt;&lt;P&gt;2001 10 35&lt;/P&gt;&lt;P&gt;2002 23 45&lt;/P&gt;&lt;P&gt;2003 12 78&lt;/P&gt;&lt;P&gt;2004 17 70&lt;/P&gt;&lt;P&gt;2005 27 80&lt;/P&gt;&lt;P&gt;2006 59 100&lt;/P&gt;&lt;P&gt;2007 39 190&lt;/P&gt;&lt;P&gt;2008 20 391&lt;/P&gt;&lt;P&gt;2009 60 192&lt;/P&gt;&lt;P&gt;2010 10 53&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both Exposure and Outcome are continuous variables. I have constructed a simple linear regression model with Exposure as the independent variable and Outcome as the dependent variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on the results of the linear regression, I have manually generated predicted values of the Outcome for given exposure values with 2-year lag period (e.g. prediction for 2003 based on 2001 exposure). How can I automate this process in SAS because I need the corresponding 95% confidence intervals for the predicted values?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Apr 2017 15:20:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-generated-confidence-Intervals-for-2-year-Lagged/m-p/350265#M18363</guid>
      <dc:creator>ImSame</dc:creator>
      <dc:date>2017-04-15T15:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I generated confidence Intervals for 2-year Lagged Predicted Values?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-generated-confidence-Intervals-for-2-year-Lagged/m-p/350268#M18364</link>
      <description>&lt;P&gt;The simple linear regression can be done like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Year Exposure Outcome;
datalines;
2001 10 35
2002 23 45
2003 12 78
2004 17 70
2005 27 80
2006 59 100
2007 39 190
2008 20 391
2009 60 192
2010 10 53
;

proc reg data = have;
model Outcome = Exposure / cli clm;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Though I am not sure what you are askeing regardring lagging values? Do you want to lag values of outcome before of after the regression analysis?&lt;/P&gt;</description>
      <pubDate>Sat, 15 Apr 2017 15:28:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-generated-confidence-Intervals-for-2-year-Lagged/m-p/350268#M18364</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-04-15T15:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I generated confidence Intervals for 2-year Lagged Predicted Values?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-generated-confidence-Intervals-for-2-year-Lagged/m-p/350273#M18365</link>
      <description>&lt;P&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The abovementioned code gives a regression equation as follows,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Outcome = Constant + Beta*Exposure&lt;/P&gt;&lt;P&gt;Outcome = 83.23453 + 1.45002*Exposure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I want to predict Outcome for 2005, then it would be 122.4 (83.23453+ 1.45002*(27)). However, if I lag the exposure by 2-year period, then it would be 100.6 (83.23453+ 1.45002*(12)). SAS does the former automatically, but I need to automate the latter because I need the corresponding confidence intervals for the predicted values based on 2-year exposure lag. I hope this clarified the question.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Apr 2017 15:41:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-generated-confidence-Intervals-for-2-year-Lagged/m-p/350273#M18365</guid>
      <dc:creator>ImSame</dc:creator>
      <dc:date>2017-04-15T15:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I generated confidence Intervals for 2-year Lagged Predicted Values?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-generated-confidence-Intervals-for-2-year-Lagged/m-p/350340#M18368</link>
      <description>&lt;P&gt;Use lag2() funtion, after got the predict value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input Year Exposure Outcome;
datalines;
2001 10 35
2002 23 45
2003 12 78
2004 17 70
2005 27 80
2006 59 100
2007 39 190
2008 20 391
2009 60 192
2010 10 53
;
run;

proc reg data = have noprint;
model Outcome = Exposure ;
output out=pred p=p lcl=low ucl=upper;
quit;
data want;
 set pred;
 lag2_p=lag2(p);
 lag2_low=lag2(low);
 lag2_upper=lag2(upper);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 16 Apr 2017 02:58:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-generated-confidence-Intervals-for-2-year-Lagged/m-p/350340#M18368</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-04-16T02:58:41Z</dc:date>
    </item>
  </channel>
</rss>

