<?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 PROC REG (Getting the right results) in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-REG-Getting-the-right-results/m-p/47387#M12713</link>
    <description>I have the following data&lt;BR /&gt;
data no_of_alerts;&lt;BR /&gt;
Input doctor alerts error;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 1  1&lt;BR /&gt;
2 1  0&lt;BR /&gt;
3 1  1&lt;BR /&gt;
4 1 1&lt;BR /&gt;
5 1 1&lt;BR /&gt;
1 2  1&lt;BR /&gt;
2 2  1&lt;BR /&gt;
3 2  1&lt;BR /&gt;
4 2 0&lt;BR /&gt;
5 2 1&lt;BR /&gt;
1 3  1&lt;BR /&gt;
2 3  0&lt;BR /&gt;
3 3  1&lt;BR /&gt;
4 3 0&lt;BR /&gt;
5 3 1&lt;BR /&gt;
1 4  1&lt;BR /&gt;
2 4  0&lt;BR /&gt;
3 4  1&lt;BR /&gt;
4 4 0&lt;BR /&gt;
5 4 0&lt;BR /&gt;
;&lt;BR /&gt;
Suppose I want to run linear regression model alerts = mean_error, where now Mean_error is the mean error of the alerts. As an example ,for alerts = 1 the mean is 0.8 (1+0+1+1+1)/5).  Thus my points will be (1,0.8), (2, 0.8), (3, 0.6) and (4,0.4). Can someone help.&lt;BR /&gt;
&lt;BR /&gt;
If I use proc reg; Model = alerts = error; run. I get the wrong results.</description>
    <pubDate>Mon, 12 Jul 2010 13:44:21 GMT</pubDate>
    <dc:creator>Statsconsultancy</dc:creator>
    <dc:date>2010-07-12T13:44:21Z</dc:date>
    <item>
      <title>PROC REG (Getting the right results)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-REG-Getting-the-right-results/m-p/47387#M12713</link>
      <description>I have the following data&lt;BR /&gt;
data no_of_alerts;&lt;BR /&gt;
Input doctor alerts error;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 1  1&lt;BR /&gt;
2 1  0&lt;BR /&gt;
3 1  1&lt;BR /&gt;
4 1 1&lt;BR /&gt;
5 1 1&lt;BR /&gt;
1 2  1&lt;BR /&gt;
2 2  1&lt;BR /&gt;
3 2  1&lt;BR /&gt;
4 2 0&lt;BR /&gt;
5 2 1&lt;BR /&gt;
1 3  1&lt;BR /&gt;
2 3  0&lt;BR /&gt;
3 3  1&lt;BR /&gt;
4 3 0&lt;BR /&gt;
5 3 1&lt;BR /&gt;
1 4  1&lt;BR /&gt;
2 4  0&lt;BR /&gt;
3 4  1&lt;BR /&gt;
4 4 0&lt;BR /&gt;
5 4 0&lt;BR /&gt;
;&lt;BR /&gt;
Suppose I want to run linear regression model alerts = mean_error, where now Mean_error is the mean error of the alerts. As an example ,for alerts = 1 the mean is 0.8 (1+0+1+1+1)/5).  Thus my points will be (1,0.8), (2, 0.8), (3, 0.6) and (4,0.4). Can someone help.&lt;BR /&gt;
&lt;BR /&gt;
If I use proc reg; Model = alerts = error; run. I get the wrong results.</description>
      <pubDate>Mon, 12 Jul 2010 13:44:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-REG-Getting-the-right-results/m-p/47387#M12713</guid>
      <dc:creator>Statsconsultancy</dc:creator>
      <dc:date>2010-07-12T13:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REG (Getting the right results)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-REG-Getting-the-right-results/m-p/47388#M12714</link>
      <description>I only think that I understand the what and certainly not the why, but here is a first pass:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data no_of_alerts;&lt;BR /&gt;
Input doctor alerts error;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 1 1&lt;BR /&gt;
2 1 0&lt;BR /&gt;
3 1 1&lt;BR /&gt;
4 1 1&lt;BR /&gt;
5 1 1&lt;BR /&gt;
1 2 1&lt;BR /&gt;
2 2 1&lt;BR /&gt;
3 2 1&lt;BR /&gt;
4 2 0&lt;BR /&gt;
5 2 1&lt;BR /&gt;
1 3 1&lt;BR /&gt;
2 3 0&lt;BR /&gt;
3 3 1&lt;BR /&gt;
4 3 0&lt;BR /&gt;
5 3 1&lt;BR /&gt;
1 4 1&lt;BR /&gt;
2 4 0&lt;BR /&gt;
3 4 1&lt;BR /&gt;
4 4 0&lt;BR /&gt;
5 4 0&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
title1 'mean Errors for each alert';&lt;BR /&gt;
proc means data=no_of_alerts nway;&lt;BR /&gt;
   class alerts;&lt;BR /&gt;
   var error;&lt;BR /&gt;
   output out=meanerr(keep=alerts meanerror) &lt;BR /&gt;
          mean=meanerror;&lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
title1 'Alerts using Mean Errors';&lt;BR /&gt;
proc reg data=meanerr;&lt;BR /&gt;
   model alerts=meanerror;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Tue, 13 Jul 2010 05:38:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-REG-Getting-the-right-results/m-p/47388#M12714</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-07-13T05:38:53Z</dc:date>
    </item>
  </channel>
</rss>

