<?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: Requesting_helpplot prediction intervals and confidence intervals for multiple independent varia in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Requesting-helpplot-prediction-intervals-and-confidence/m-p/504592#M25940</link>
    <description>&lt;P&gt;One way to show a bivariate regression is to do panelling. For example, the relationship of Cholesterol with Age and Weight&amp;nbsp;in the SASHELP.HEART dataset can be illustrated by showing the relationship of Cholesterol with Weight within separate Age groups:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data heart;
set sashelp.heart;
where ageAtStart between 30 and 59.99;
/* 10-year age groups for graph panels */
ageGrp = floor(AgeAtStart/10)*10 + 5;
/* Second order term for the regression */
ageWeight = ageAtStart*weight;
/* Real data */
data = "Heart";
output; 

/* Add extra data for age group line drawing */
ageAtStart = ageGrp;
ageWeight = ageAtStart*weight;
call missing(cholesterol);
data = "Graph";
output; 

label ageWeight = "Age*Weight";
keep weight height ageAtStart ageGrp cholesterol ageWeight data;
run;

proc reg data=heart plots=none;
model cholesterol = weight ageAtStart ageWeight / alpha=0.1;
output out=heartPred p=pred lcl=lcl ucl=ucl;
run;

/* Create separate columns for drawing regression lines */
data heartGraph;
set heartPred;
if data = "Graph" then do;
    predValue = pred;
    lclValue = lcl;
    uclValue = ucl;
    end;
run;

proc sort data=heartGraph; by AgeGrp weight;run;

proc format;
value ageGrp
35 = "30-39"
45 = "40-49"
55 = "50-59";
run;

ods graphics / width=20cm height=12cm antialiasmax=200000;
proc sgpanel data=heartGraph noautolegend;
format ageGrp ageGrp.;
panelby ageGrp / rows=1;
band x=weight upper=uclValue lower=lclValue;
series x=weight y=predValue / lineattrs=(color=red thickness=2);
scatter x=weight y=cholesterol;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPanel6.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24040i44ECA0BB00814438/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPanel6.png" alt="SGPanel6.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hth.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Oct 2018 04:46:57 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2018-10-16T04:46:57Z</dc:date>
    <item>
      <title>Requesting_helpplot prediction intervals and confidence intervals for multiple independent variables</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Requesting-helpplot-prediction-intervals-and-confidence/m-p/504497#M25937</link>
      <description>&lt;P&gt;&lt;SPAN&gt;data sample;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input x1 x2 y;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;datalines;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 1 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2 2 4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3 3 6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4 4 8&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My objective is to build a regression model for y against x1 and x2;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;* For y versus x1, plot the regression model, prediction interval for individual response, and confidence interval for the mean response;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;* For y versus x2, plot the regression model, prediction interval for individual response, and confidence interval for the mean response;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;* Below, I attempted to plot prediction interval and confidence interval using PRED and CONF as defined/shown in the following links;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;* &lt;A href="https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_reg_sect017.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_reg_sect017.htm&lt;/A&gt; ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;* &lt;A href="https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_reg_sect036.htm#statug.reg.dtLegGraphicsb" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_reg_sect036.htm#statug.reg.dtLegGraphicsb&lt;/A&gt; ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;* However, PRED and CONF cannot handle multiple independent variables;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;I am wondering if ODS could plot prediction intervals and confidence intervals for multiple independent variables;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc reg data = sample;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;title "Plot of Confidence Interval and Prediction Interval for Regression Model of Y Versus X";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;model Y = X;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;plot Y*X / CONF PRED;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 21:19:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Requesting-helpplot-prediction-intervals-and-confidence/m-p/504497#M25937</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-15T21:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting_helpplot prediction intervals and confidence intervals for multiple independent varia</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Requesting-helpplot-prediction-intervals-and-confidence/m-p/504503#M25938</link>
      <description>&lt;P&gt;Something like this perhaps?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data sample;
input x1  y x2;
datalines;
1.2 1 2.2
2.3 2 3.8
2.8 3 5.9
3.9 4 8.3
;
run;

proc sgplot data=sample;
   reg x=x1 y=y/ cli='X1 I' clm='X1 Mean'
                 lineattrs=(color=red)
   ;
   reg x=x2 y=y/ cli='X2 I' clm='X2 Mean'
                 lineattrs=(color=blue)
   ;
run;&lt;/PRE&gt;
&lt;P&gt;I used a different data set as your examples were 1) colinear and had insufficient variability to show any confidence limits and 2) plotted directly on top of each other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 21:59:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Requesting-helpplot-prediction-intervals-and-confidence/m-p/504503#M25938</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-15T21:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting_helpplot prediction intervals and confidence intervals for multiple independent varia</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Requesting-helpplot-prediction-intervals-and-confidence/m-p/504567#M25939</link>
      <description>&lt;P&gt;Thank you Sir&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;I'm afraid I beg your pardon to give a day to respond as I play with my team mate at my college lab tomorrow and take his opinion as well. I am basically writing to acknowledge the help. As always not the 1st or last of receiving your help, many thanks. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 02:19:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Requesting-helpplot-prediction-intervals-and-confidence/m-p/504567#M25939</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-16T02:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting_helpplot prediction intervals and confidence intervals for multiple independent varia</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Requesting-helpplot-prediction-intervals-and-confidence/m-p/504592#M25940</link>
      <description>&lt;P&gt;One way to show a bivariate regression is to do panelling. For example, the relationship of Cholesterol with Age and Weight&amp;nbsp;in the SASHELP.HEART dataset can be illustrated by showing the relationship of Cholesterol with Weight within separate Age groups:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data heart;
set sashelp.heart;
where ageAtStart between 30 and 59.99;
/* 10-year age groups for graph panels */
ageGrp = floor(AgeAtStart/10)*10 + 5;
/* Second order term for the regression */
ageWeight = ageAtStart*weight;
/* Real data */
data = "Heart";
output; 

/* Add extra data for age group line drawing */
ageAtStart = ageGrp;
ageWeight = ageAtStart*weight;
call missing(cholesterol);
data = "Graph";
output; 

label ageWeight = "Age*Weight";
keep weight height ageAtStart ageGrp cholesterol ageWeight data;
run;

proc reg data=heart plots=none;
model cholesterol = weight ageAtStart ageWeight / alpha=0.1;
output out=heartPred p=pred lcl=lcl ucl=ucl;
run;

/* Create separate columns for drawing regression lines */
data heartGraph;
set heartPred;
if data = "Graph" then do;
    predValue = pred;
    lclValue = lcl;
    uclValue = ucl;
    end;
run;

proc sort data=heartGraph; by AgeGrp weight;run;

proc format;
value ageGrp
35 = "30-39"
45 = "40-49"
55 = "50-59";
run;

ods graphics / width=20cm height=12cm antialiasmax=200000;
proc sgpanel data=heartGraph noautolegend;
format ageGrp ageGrp.;
panelby ageGrp / rows=1;
band x=weight upper=uclValue lower=lclValue;
series x=weight y=predValue / lineattrs=(color=red thickness=2);
scatter x=weight y=cholesterol;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPanel6.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24040i44ECA0BB00814438/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPanel6.png" alt="SGPanel6.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hth.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 04:46:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Requesting-helpplot-prediction-intervals-and-confidence/m-p/504592#M25940</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-10-16T04:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting_helpplot prediction intervals and confidence intervals for multiple independent varia</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Requesting-helpplot-prediction-intervals-and-confidence/m-p/504744#M25945</link>
      <description>&lt;P&gt;Good morning&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;, Thank you Sir. I have just made it to my lab and I couldn't acknowledge your post last nightas I slept off. I will work my mate and positively come back to the thread to let you know how we tried and our progress.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 14:55:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Requesting-helpplot-prediction-intervals-and-confidence/m-p/504744#M25945</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-16T14:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting_helpplot prediction intervals and confidence intervals for multiple independent varia</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Requesting-helpplot-prediction-intervals-and-confidence/m-p/505189#M25981</link>
      <description>&lt;P&gt;Sir&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;, Let us know how to thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HEADER class="r_P D_F W_6D6F p_R P_Zjgzuf ir_0"&gt;
&lt;DIV class="o_h D_F em_0 E_fq7 ek_BB" data-test-id="address-info"&gt;
&lt;DIV class="D_F en_0"&gt;&lt;STRONG&gt;&lt;SPAN class="u_b en_0 C4_Z2aVTcY" data-test-id="message-from"&gt;&lt;SPAN class="D_F rtlI_rtlI_dz_sSg " data-test-id="email-pill"&gt;Scully, Jim&lt;SPAN class="u_N C_Z1VRpVF"&gt;&amp;nbsp;&amp;lt;JSCULLY2@mail.depaul.edu&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV class="d_6FIA i_6FIA D_F eo_HB"&gt;&lt;STRONG&gt;&lt;SPAN class="u_b E_eo6 C_Z1TsNWR"&gt;To:&lt;/SPAN&gt;&lt;SPAN class="D_F rtlI_rtlI_dz_sSg " data-test-id="email-pill"&gt;&lt;SPAN class="C4_Z2aVTcY" data-test-id="message-to"&gt;S Naveen&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="E_fq7"&gt;,&lt;/SPAN&gt;&lt;SPAN class="D_F rtlI_rtlI_dz_sSg " data-test-id="email-pill"&gt;&lt;SPAN class="C4_Z2aVTcY" data-test-id="message-to"&gt;scja0711@gmail.com&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="en_0 s_6Fd5 H_6Fd5 M_3gJOe cdPFi_Z281SGl O_cMr O4_cMu"&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV class="D_F en_0 M_3gJOe A_6Eb4 C_Z1VRpVF" data-test-id="message-date"&gt;&lt;STRONG&gt;Oct 17 at 10:58 AM&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV class="D_F ab_CI Y_68F4 en_0 cdPFi_ZpQYvz H_6MGW W_6MGW lv_1IWXzk h_Z13pql2 h4_2d9T5e"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/HEADER&gt;
&lt;DIV data-test-id="message-body-container"&gt;
&lt;DIV data-test-id="message-view-body"&gt;
&lt;DIV class="msg-body P_wpofO iy_A" data-test-id="message-view-body-content"&gt;
&lt;DIV class="jb_0 X_6MGW N_6Fd5"&gt;
&lt;DIV&gt;
&lt;DIV id="yiv4838304193"&gt;
&lt;DIV dir="ltr"&gt;
&lt;DIV id="yiv4838304193divtagdefaultwrapper" dir="ltr"&gt;
&lt;P&gt;Naveen,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;'s code performed beautifully.&amp;nbsp;I did not know&amp;nbsp;proc&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;sgplot supported a reg statement with cli and clm options. Please pass my gratitude to ballardw.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Currently, trying to understand and attempt&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&amp;nbsp;code in detail&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jim Scully&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 17 Oct 2018 16:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Requesting-helpplot-prediction-intervals-and-confidence/m-p/505189#M25981</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-17T16:07:19Z</dc:date>
    </item>
  </channel>
</rss>

