<?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: Linear regression in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Linear-regression/m-p/882224#M348567</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/425348"&gt;@SJ12&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes it's complex sample and you're right, I changed in recently to domain instead of ''by''. Ok yes, that's helpful! I'm just wondering the difference between ''ods output'' and just ''output''?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Good question. ODS OUTPUT creates datasets based on the output sent to results window. Which will generally be summaries or results of analysis.&lt;/P&gt;
&lt;P&gt;The output data set in Surveyreg is specifically designed to add predicted and some related values to the incoming data set and create a data set. Typically you would not want to see 1000's of rows of basically Proc Print output in a results document so this is sent to a data set. Then you can do stuff like plot or use the predicted value as input into another analysis step.&lt;/P&gt;
&lt;P&gt;One thing this data set can be used for is create dependent variable values (predicted) for values of the independent variables that did not actually have an answer (missing dependent) so you may want to be a bit careful with the predicted. You can get residuals (difference between predicted and actual values) to do custom determination of how well your model fits.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jun 2023 20:22:49 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-06-23T20:22:49Z</dc:date>
    <item>
      <title>Linear regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Linear-regression/m-p/882059#M348503</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;For one of my analysis at population level, I look at the consumption of a ultra-processed foods (in % of total daily calories) according to length of stay in host country among immigrants (by ethnicity/race)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pratio4 =% of total daily calories coming from ultra-processed foods&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For my procedure, I used a simple linear regression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;SPAN&gt;&lt;STRONG&gt;surveyreg&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN&gt;data&lt;/SPAN&gt;&lt;SPAN&gt;=X&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;varmethod&lt;/SPAN&gt;&lt;SPAN&gt;=brr;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;weight&lt;/SPAN&gt;&lt;SPAN&gt; WTS_M; &lt;/SPAN&gt;&lt;SPAN&gt;repweights&lt;/SPAN&gt;&lt;SPAN&gt; bsw1-bsw500;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;by&lt;/SPAN&gt;&lt;SPAN&gt; ethnicity_race;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;model&lt;/SPAN&gt;&lt;SPAN&gt; pratio4=lengthofstay;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I get a graphic that seem to have all individual points in it. Is there a way to get the graphic with only the regression line and not showing the individual values in it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 02:23:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Linear-regression/m-p/882059#M348503</guid>
      <dc:creator>SJ12</dc:creator>
      <dc:date>2023-06-23T02:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Linear regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Linear-regression/m-p/882111#M348519</link>
      <description>&lt;P&gt;First, you want to read the documentation about use of BY statements in complex sample data. I have to assume since you are using Surveyreg that you have complex sample.&lt;/P&gt;
&lt;P&gt;To get proper calculations of variance then you should use a DOMAIN statement instead of BY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't see anything requesting plots. So what is creating your graphic?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To plot regression lines I would typically use the OUTPUT statement to have the predicted values and possibly the confidence limits of the prediction from the model in a data set then use a procedure like SGPLOT or SGPANEL to use a REG plot with the independent variable the X axis variable and the predicted variable as the Y axis variable. Using the Domain variable as a Group= variable or possibly the Panelby variable in Sgpanel and the NOMARKERS option to suppress the scatter plot of values.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 10:25:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Linear-regression/m-p/882111#M348519</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-06-23T10:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Linear regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Linear-regression/m-p/882171#M348547</link>
      <description>&lt;P&gt;Yes it's complex sample and you're right, I changed in recently to domain instead of ''by''. Ok yes, that's helpful! I'm just wondering the difference between ''ods output'' and just ''output''?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 16:47:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Linear-regression/m-p/882171#M348547</guid>
      <dc:creator>SJ12</dc:creator>
      <dc:date>2023-06-23T16:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Linear regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Linear-regression/m-p/882224#M348567</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/425348"&gt;@SJ12&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes it's complex sample and you're right, I changed in recently to domain instead of ''by''. Ok yes, that's helpful! I'm just wondering the difference between ''ods output'' and just ''output''?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Good question. ODS OUTPUT creates datasets based on the output sent to results window. Which will generally be summaries or results of analysis.&lt;/P&gt;
&lt;P&gt;The output data set in Surveyreg is specifically designed to add predicted and some related values to the incoming data set and create a data set. Typically you would not want to see 1000's of rows of basically Proc Print output in a results document so this is sent to a data set. Then you can do stuff like plot or use the predicted value as input into another analysis step.&lt;/P&gt;
&lt;P&gt;One thing this data set can be used for is create dependent variable values (predicted) for values of the independent variables that did not actually have an answer (missing dependent) so you may want to be a bit careful with the predicted. You can get residuals (difference between predicted and actual values) to do custom determination of how well your model fits.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 20:22:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Linear-regression/m-p/882224#M348567</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-06-23T20:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Linear regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Linear-regression/m-p/882634#M348711</link>
      <description>&lt;P&gt;Ok that's been helpful, thanks for your answer!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 14:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Linear-regression/m-p/882634#M348711</guid>
      <dc:creator>SJ12</dc:creator>
      <dc:date>2023-06-27T14:03:26Z</dc:date>
    </item>
  </channel>
</rss>

