<?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: Values of x-variable used in effectplot in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Values-of-x-variable-used-in-effectplot/m-p/590215#M28854</link>
    <description>&lt;P&gt;You may get a better answer if you can show the code for one of the regressions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2019 21:28:15 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-09-19T21:28:15Z</dc:date>
    <item>
      <title>Values of x-variable used in effectplot</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Values-of-x-variable-used-in-effectplot/m-p/590101#M28850</link>
      <description>&lt;P&gt;Hello..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm running multiple multivariable linear regression models (same set of covariates, changing primary predictor) using proc glm and then using the effectplot command in proc plm to plot the models. I would like to also have a single plot with all models overlaid on it. After reading through posts here, I figured that the best option for me was to output the predicted data from within the proc plm command , merge all of them and then try to plot them using sgplot. I'm running my glm on an N of 90 and have 10 variables in the model- 2 are continuous, the rest are categorical. There are no missing data in this file.&lt;/P&gt;&lt;P&gt;Things were moving reasonably well till I looked at the data output from the plm command. The data output from proc plm&amp;nbsp; 'FitPlot' has an N of 200. I recognize the first and last values of my primary predictor X variable. Based on some of the posts here, I think that the procedure is somehow taking a set of values from the X-variable and using them in the model to predict the outcome- Is this the case? If so, does this somehow dictate the increase in N from the original data?&lt;/P&gt;&lt;P&gt;I feel like I understand why the actual x values are not used (but would like to confirm this)- the resulting prediction would a be a 'jittered' scatter of points and would produce a jagged line. Is this so?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 16:24:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Values-of-x-variable-used-in-effectplot/m-p/590101#M28850</guid>
      <dc:creator>sas_epi</dc:creator>
      <dc:date>2019-09-19T16:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Values of x-variable used in effectplot</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Values-of-x-variable-used-in-effectplot/m-p/590215#M28854</link>
      <description>&lt;P&gt;You may get a better answer if you can show the code for one of the regressions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 21:28:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Values-of-x-variable-used-in-effectplot/m-p/590215#M28854</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-19T21:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Values of x-variable used in effectplot</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Values-of-x-variable-used-in-effectplot/m-p/590223#M28855</link>
      <description>&lt;P&gt;Thank you for comment, ballardw. The code is below. This works- I get the plot that I want. My confusion is on the difference in the N that the glm model is running (N=90) and the N for the data that plm outputs (n=200)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc glm data=finaldata plots=(diagnostics residuals(smooth));&lt;BR /&gt;class year (ref="2011") gender(ref="F") site(ref="DU") bmi_cat (ref="Normal") matrace (ref="NH White") education (ref="Bachelors or higher") income (ref="100- &amp;lt;200 K") parity(ref="1");&lt;BR /&gt;model totscore= ph1 site bmi_cat matrace education income matage gender year parity/solution CLPARM;&lt;BR /&gt;store ph1pred;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc plm restore= ph1pred;&lt;BR /&gt;effectplot fit(x= ph1) / at(gender="F") at(site="DU") at(matrace="NH White") at(bmi_cat="Normal") at(education="Bachelors or higher") at(income="100- &amp;lt;200 K") at(parity="1") at(year="2011");&lt;BR /&gt;ods output FitPlot= ph1pred;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data ph1pred;&lt;BR /&gt;set ph1pred (keep= _XCONT1 _PREDICTED);&lt;BR /&gt;rename _XCONT1= ph1;&lt;BR /&gt;rename _PREDICTED= totscore;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;....... running the same model 14 times with different 'ph' variables and producing output data, I merged them to get a data set with all predicted data. Then plot as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sgplot data= finalpred;&lt;BR /&gt;series x=ph1 y=totscore1 ;&lt;BR /&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;BR /&gt;series x=ph14 y=totscore14;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yaxis grid values=(1.5 to 4.5 by .5);&lt;BR /&gt;xaxis label="ph";&lt;BR /&gt;yaxis label="Predicted score";&lt;BR /&gt;title "Predicted plot of ph1-p14";&lt;BR /&gt;run;&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, 19 Sep 2019 22:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Values-of-x-variable-used-in-effectplot/m-p/590223#M28855</guid>
      <dc:creator>sas_epi</dc:creator>
      <dc:date>2019-09-19T22:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Values of x-variable used in effectplot</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Values-of-x-variable-used-in-effectplot/m-p/590712#M28891</link>
      <description>&lt;P&gt;&lt;SPAN&gt;When you create an effect plot for a continuous variable, SAS procedures evaluate the regression model on an evenly spaced grid for the range of the X variable (ph1, I guess). By default, I think 201 points are used, but you say 200, so I might be wrong.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When you overlay the predicted values, each model (ph1, ph2, etc) will have 200 (or so) points,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Why? Because you didn't provide a SCORE data set, so that procedure assume you want to score on the range of the data.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It is not related to avoiding a "jittered scatter of points" or a "jagged line."&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2019 11:11:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Values-of-x-variable-used-in-effectplot/m-p/590712#M28891</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-09-22T11:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Values of x-variable used in effectplot</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Values-of-x-variable-used-in-effectplot/m-p/590724#M28894</link>
      <description>&lt;P&gt;Thank you Rick, that makes sense to me.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2019 11:53:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Values-of-x-variable-used-in-effectplot/m-p/590724#M28894</guid>
      <dc:creator>sas_epi</dc:creator>
      <dc:date>2019-09-22T11:53:12Z</dc:date>
    </item>
  </channel>
</rss>

