<?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: Finding Predcied values with confidence level based on the regression model in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65828#M3148</link>
    <description>Also, PROC PLM is designed to be used with several procedures, such as MIXED, GLIMMIX, and others, but not with REG.</description>
    <pubDate>Wed, 25 May 2011 13:17:41 GMT</pubDate>
    <dc:creator>lvm</dc:creator>
    <dc:date>2011-05-25T13:17:41Z</dc:date>
    <item>
      <title>Finding Predcied values with confidence level based on the regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65821#M3141</link>
      <description>Hello ,&lt;BR /&gt;
&lt;BR /&gt;
Could you please suggest me how do I obtain the estimate for a new observation if I add it in my model from the regression model that I have.Suppose that the regression equation is :-&lt;BR /&gt;
&lt;BR /&gt;
Y = a+b*A+c*B+d*C ; where Y is dependent variable of interest and A,B and C are the varaibles that are in my model.Also, previously I had dropped 2 variables from the model , D and E.Now if i want to find the estimate for Y and the 95% C.I. for this estimate for a new observation with new values for A,B,C,D, and E then what should I use.&lt;BR /&gt;
&lt;BR /&gt;
The code i used :-&lt;BR /&gt;
&lt;BR /&gt;
/*95% Confidence Limits for the Score*/&lt;BR /&gt;
DATA ci_new;&lt;BR /&gt;
 set sc.sales (DROP = D E);&lt;BR /&gt;
PROC UNIVARIATE data = ci_new; &lt;BR /&gt;
	VAR Y;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
then only i get the mean of the Y and C.I. for it. But if I plug in the vlaues of A,B, and C in the model that I have then i get a value that doesnt even fall in this inteval.&lt;BR /&gt;
&lt;BR /&gt;
My objective is to estimate the value of Y using the model that I have viz. Y = a+b*A+c*B+d*C  and 95% C.I. limits for this estimate.&lt;BR /&gt;
&lt;BR /&gt;
Kindly  guide,&lt;BR /&gt;
markc</description>
      <pubDate>Tue, 09 Mar 2010 06:07:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65821#M3141</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-09T06:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Predcied values with confidence level based on the regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65822#M3142</link>
      <description>Mark, you need to use PROC REG for regression. &lt;BR /&gt;
&lt;BR /&gt;
PROC UNIVARIATE doesn't do regression.&lt;BR /&gt;
&lt;BR /&gt;
If you had already fit the model, then the way to get predicted value and confidence interval for the new observation is simply to append the new observation to your data set, with Y missing but with A B and C non-missing at whatever value you desire, and then fit the regression again. The output data set will contain the predicted value and confidence interval for all of your data, and for the new observation.&lt;BR /&gt;
&lt;BR /&gt;
Regarding the code you posted...even though it doesn't solve the problem, I suggest a simplification should you ever need PROC UNIVARIATE&lt;BR /&gt;
&lt;BR /&gt;
PROC UNIVARIATE data = sc.sales(drop=D E);&lt;BR /&gt;
VAR Y;&lt;BR /&gt;
RUN;</description>
      <pubDate>Tue, 09 Mar 2010 14:03:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65822#M3142</guid>
      <dc:creator>Paige</dc:creator>
      <dc:date>2010-03-09T14:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Predcied values with confidence level based on the regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65823#M3143</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I just found this thread using the search engine and decided to warm it up, rather than start a new one.&lt;BR /&gt;
&lt;BR /&gt;
I have quite the same question as Mark, however since my initial regression is based on a huge data set, appendnig new observations and rerun the regression each time I get some new observations is impossible simply due to time issues (A regression run takes about 4 hours).&lt;BR /&gt;
&lt;BR /&gt;
I currently extract the regression coefficients using the outest= option and apply them to my prediction data set using Proc Score. However, I only get the predicted values like that, without individual confidence limits, which would be highly desirable.&lt;BR /&gt;
&lt;BR /&gt;
I already thought about computing them by hand, however I don't have an idea how to compute the necessary hat values (h_i) without using PROC IML, which we haven't licensed &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
I would very appreciate any help!

Message was edited by: IljaMett</description>
      <pubDate>Thu, 19 May 2011 12:18:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65823#M3143</guid>
      <dc:creator>IljaMett</dc:creator>
      <dc:date>2011-05-19T12:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Predcied values with confidence level based on the regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65824#M3144</link>
      <description>Do you know the values of the independent variables that you will want predictions for prior to running the regression?  If so, simply append them as observations, with the dependent variable set to missing (=.).  The output data set should contain predicted values, standard errors, confidence limits, etc. for all observations in the dataset, so these can quickly be extracted.&lt;BR /&gt;
&lt;BR /&gt;
Steve Denham</description>
      <pubDate>Mon, 23 May 2011 15:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65824#M3144</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2011-05-23T15:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Predcied values with confidence level based on the regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65825#M3145</link>
      <description>Sorry, I don't know the independent values in advance. If I would, then it wouldn't be a new data set, i guess? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Any other ideas, someone?</description>
      <pubDate>Tue, 24 May 2011 10:47:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65825#M3145</guid>
      <dc:creator>IljaMett</dc:creator>
      <dc:date>2011-05-24T10:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Predcied values with confidence level based on the regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65826#M3146</link>
      <description>How many independent variables are you dealing with?  Are there a priori values that you will be interested in?  A cartesian join of all the values generates a new data set, to be appended to the source data, with missing dependent values.  If you are only interested in particular values that arise after gathering more data, then you are stuck with re-running everything.&lt;BR /&gt;
&lt;BR /&gt;
Steve Denham</description>
      <pubDate>Tue, 24 May 2011 15:28:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65826#M3146</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2011-05-24T15:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Predcied values with confidence level based on the regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65827#M3147</link>
      <description>If you are using sas 9.22 (really, 9.2 with TS2M3 release version), you may have a way, if you can do the regression with PROC GLM instead of with PROC REG. There is now a post-model-fitting procedure called PLM. It is designed for performing tests (contrasts, etc.) after fitting a complex model, often with many random effects and large data sets. PLM can also be used for getting predictions of the response variable, using the SCORE statement. Here is a simple example. You can read more about it in the documentation.&lt;BR /&gt;
Remember, you need 9.22 for this to run.&lt;BR /&gt;
data a;  *--data for fitting the model;&lt;BR /&gt;
input x1 x2 y;&lt;BR /&gt;
datalines;&lt;BR /&gt;
0 5 2&lt;BR /&gt;
1  5 4&lt;BR /&gt;
2  4 3&lt;BR /&gt;
3 4 6&lt;BR /&gt;
4 3 6&lt;BR /&gt;
5 3 5&lt;BR /&gt;
6 3 8&lt;BR /&gt;
7 2 10&lt;BR /&gt;
8 1 9&lt;BR /&gt;
9 3 9&lt;BR /&gt;
;&lt;BR /&gt;
data test; *--this is the new data for getting predictions post-model fitting;&lt;BR /&gt;
input x1 x2;&lt;BR /&gt;
datalines;&lt;BR /&gt;
0.5 4&lt;BR /&gt;
1 1&lt;BR /&gt;
2 7&lt;BR /&gt;
2 8&lt;BR /&gt;
2 9&lt;BR /&gt;
3 0&lt;BR /&gt;
3 1&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
proc print data=a;run;&lt;BR /&gt;
proc glm data=a; *--fit model;&lt;BR /&gt;
model y = x1 x2 / solution;&lt;BR /&gt;
store sasuser.a_analysis / label='test';  *--new option with 9.22 (Item Store);&lt;BR /&gt;
run;&lt;BR /&gt;
proc plm source=sasuser.a_analysis;  *--new procedure, using Item Store;&lt;BR /&gt;
score data=test out=test_out predicted stderr  lclm uclm lcl ucl; *--get predictions;&lt;BR /&gt;
run;&lt;BR /&gt;
proc print data=test_out;&lt;BR /&gt;
run;</description>
      <pubDate>Wed, 25 May 2011 13:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65827#M3147</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2011-05-25T13:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Predcied values with confidence level based on the regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65828#M3148</link>
      <description>Also, PROC PLM is designed to be used with several procedures, such as MIXED, GLIMMIX, and others, but not with REG.</description>
      <pubDate>Wed, 25 May 2011 13:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65828#M3148</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2011-05-25T13:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Predcied values with confidence level based on the regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65829#M3149</link>
      <description>Hi Ivm,&lt;BR /&gt;
&lt;BR /&gt;
thx for your tip, that sounds reasonable. Actually, we don't have the correct SAS version here yet, but we might probably get it soon.&lt;BR /&gt;
I'll take a look on the procedure.</description>
      <pubDate>Fri, 27 May 2011 10:47:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65829#M3149</guid>
      <dc:creator>IljaMett</dc:creator>
      <dc:date>2011-05-27T10:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Predcied values with confidence level based on the regression model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65830#M3150</link>
      <description>If you can do the regression in REG, you should be able to do it in GLM. With the use of the new STORE statement, you create a permanent file (the Item Store) on your hard drive that contains all the needed information for later calculations (very cool). Then, you don't have to ever run the GLM procedure again (unless you want a different model). You simply run the new PLM procedure that accesses your Item Store and new X data file, and the relevant statistics (contrasts, predictions) are calculated. &lt;BR /&gt;
You do need 9.22 or later; hopefully you get it soon. You can read more at:&lt;BR /&gt;
&lt;A href="http://support.sas.com/resources/papers/proceedings10/258-2010.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings10/258-2010.pdf&lt;/A&gt;</description>
      <pubDate>Fri, 27 May 2011 12:41:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Finding-Predcied-values-with-confidence-level-based-on-the/m-p/65830#M3150</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2011-05-27T12:41:26Z</dc:date>
    </item>
  </channel>
</rss>

