如果结果残差不是正态分布 说明用线性回归来拟合数据是不合适的
可能是非线性回归
这里的类是对应因变量的取值 如果是连续型的那就只有一类 销售量
如果是离散型的那就有几类就假设几类 黑白球
当总体只有一类的时候 我们假设符合正态分布
如果有两类假设符合二项分布
</h1>
<div class="clear"></div>
<div class="postBody">
Y1 X1 Y2 X2 Y3 X3 Y4 X4 8.04 10 9.14 10 7.46 10 6.58 8 6.95 8 8.14 8 6.77 8 5.76 8 7.58 13 8.74 13 12.74 13 7.71 8 8.81 9 8.77 9 7.11 9 8.84 8 8.33 11 9.26 11 7.81 11 8.47 8 9.96 14 8.1 14 8.84 14 7.04 8 7.24 6 6.13 6 6.08 6 5.25 8 4.26 4 3.1 4 5.39 4 12.5 19 10.84 12 9.13 12 8.15 12 5.56 8 4.82 7 7.26 7 6.42 7 7.91 8 5.68 5 4.74 5 5.73 5 6.89 8
数据集如上,用sas读入后再做简单线性回归,四个回归的模型都一样,残差平方和,负相关系数也一样
那么,是不是可以说这四组数据拟合的模型都正确呢?
我们画出其各自的散点图,如下
很明显,只有左上方的图才有用线性模型描述的可能性,其他的模型都不适合。
OK~,这里是简单线性模型,只有一个自变量,如果上升到多个自变量时,无法用肉眼从图形判别的我们该做什么呢?
这就是残差图大展身手的地方了(这里只选取残差和因变量进行作图)
proc reg data=regbook.anscombefour; model y1= x1; plot r.*p.; model y2= x2; plot r.*p.; model y3= x3; plot r.*p.; model y1= x1; plot r.*p.; run; quit;
因为在这里不清楚如何用sas组合四幅图,所以就没贴出来,如果是线性模型,那么残差应该符合正态分布的假设,所以残差应该围绕0上下无规律波动,如下(y1*x1的残差图)
如果不是这种形状,就表明拟合的模型有问题,同理,残差和自变量在线性假设中也是独立的,也可以拿来进行检验。
分类:
sas数据分析
<div id="blog_post_info">
0
0
<div class="clear"></div>
<div id="post_next_prev">
<a href="https://www.cnblogs.com/yican/p/4181086.html" class="p_n_p_prefix">« </a> 上一篇: <a href="https://www.cnblogs.com/yican/p/4181086.html" title="发布于 2014-12-25 15:35">sas回归分析</a>
<br>
<a href="https://www.cnblogs.com/yican/p/4206743.html" class="p_n_p_prefix">» </a> 下一篇: <a href="https://www.cnblogs.com/yican/p/4206743.html" title="发布于 2015-01-06 19:04">最小二乘参数估计---梯度下降法求解参数的sas代码实现</a>
最新 IT 新闻:
· 4000亿蝗虫肆虐印巴 农业农村部:对我国危害几率很小
· 谷歌Pixel历代回顾:“Google手机”的演变
· NASA 揭示了 4 个发现太阳系秘密的新任务
· 台积电7/6/5nm工艺供不应求 史上最高开支狂买EUV光刻机
· 正被避之不及的“毒王”蝙蝠,也曾给过科学家不少灵感
» 更多新闻...
· 4000亿蝗虫肆虐印巴 农业农村部:对我国危害几率很小
· 谷歌Pixel历代回顾:“Google手机”的演变
· NASA 揭示了 4 个发现太阳系秘密的新任务
· 台积电7/6/5nm工艺供不应求 史上最高开支狂买EUV光刻机
· 正被避之不及的“毒王”蝙蝠,也曾给过科学家不少灵感
» 更多新闻...
<div id="sideBar">
<div id="sideBarMain">
<div id="profile_block">
昵称:
<a href="https://home.cnblogs.com/u/yican/">
暴走的豆浆
</a>
<br>
园龄:
<a href="https://home.cnblogs.com/u/yican/" title="入园时间:2013-08-27">
6年5个月
</a>
<br>
粉丝:
<a href="https://home.cnblogs.com/u/yican/followers/">
23
</a>
<br>
关注:
<a href="https://home.cnblogs.com/u/yican/followees/">
2
</a>
<div id="p_b_follow">
+加关注
<div id="calendar"><div id="blog-calendar" style="">
| |||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
---|---|---|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 | |||
2 | 3 | 4 | 5 | 6 | 7 | 8 | |||
9 | 10 | 11 | 12 | 13 | 14 | 15 | |||
16 | 17 | 18 | 19 | 20 | 21 | 22 | |||
23 | 24 | 25 | 26 | 27 | 28 | 29 | |||
1 | 2 | 3 | 4 | 5 | 6 | 7 |
常用链接
-
</ul>
我的标签
<li> <a href="https://www.cnblogs.com/yican/tag/Linux/">Linux</a>(5) </li> <li> <a href="https://www.cnblogs.com/yican/tag/matlab/">matlab</a>(5) </li> <li> <a href="https://www.cnblogs.com/yican/tag/C%2B%2B/">C++</a>(3) </li> <li> <a href="https://www.cnblogs.com/yican/tag/sas/">sas</a>(3) </li> <li> <a href="https://www.cnblogs.com/yican/tag/statistical/">statistical</a>(1) </li> <li> <a href="https://www.cnblogs.com/yican/tag/Ujmp%20Java%20Matrix/">Ujmp Java Matrix</a>(1) </li> <li> <a href="https://www.cnblogs.com/yican/tag/win32/">win32</a>(1) </li> <li> <a href="https://www.cnblogs.com/yican/tag/%E5%8A%A8%E6%80%81%E8%A7%84%E5%88%92/">动态规划</a>(1) </li> <li> <a href="https://www.cnblogs.com/yican/tag/format/">format</a>(1) </li> <li> <a href="https://www.cnblogs.com/yican/tag/Gradle%20Java/">Gradle Java</a>(1) </li> <li> <a href="https://www.cnblogs.com/yican/tag/">更多</a> </li> </ul>
随笔分类
Algorithm(4)</h3> <ul> <li>
C++/C(13)</li> <li>
Game(6)</li> <li>
Java(12)</li> <li>
java_matlab_sas_R混合(8)</li> <li>
Linux(2)</li> <li>
ppt</li> <li>
R(4)</li> <li>
sas(29)</li> <li>
SAS_FUNCTIONS_UNIVERSAL</li> <li>
SAS_GRAPHIC</li> <li>
SAS_MACRO(5)</li> <li>
SAS_PROCEDURE(1)</li> <li>
SAS_STATEMENT_UNIVERSAL</li> <li>
sas数据分析(6)</li> <li>
Weka(2)</li> <li>
公式论证与编程实现(3)</li> <li>
</li> </ul> </div> <div class="catListPostArchive"> <h3 class="catListTitle">
随笔档案
2015年8月(2)</h3> <ul> <li>
2015年7月(11)</li> <li>
2015年6月(4)</li> <li>
2015年5月(2)</li> <li>
2015年3月(2)</li> <li>
2015年1月(8)</li> <li>
2014年12月(9)</li> <li>
2014年11月(16)</li> <li>
2014年8月(11)</li> <li>
2014年7月(2)</li> <li>
2014年6月(10)</li> <li>
2014年5月(4)</li> <li>
2014年3月(5)</li> <li>
2013年9月(8)</li> <li>
</li> </ul> </div>
阅读排行榜
- 1. sas赋值语句,累加语句,keep,drop,rename,(retain/sum statement)(20916)
- 2. sas中的sql(4) 多表操作,内连接,外连接(left | right | full/join),In-Line Views,Merge&Join的比较(14259)
- 3. sas输入输出数据的相关语句 output、 put、 remove、replace 、file 、infile(13165)
- 4. sas条件判断语句where,if的区别,以及where选项(11458)
- 5. sas宏(1)、系统宏变量、自定义宏变量、输出宏变量值、宏与text结合(10142)
【推荐】开发者上云福利,腾讯云1核4G云服务器11元/月起
【推荐】开年盛典,百度智能云1核1G云服务器84元/年
【推荐】阿里专家五年方法论总结!技术人如何实现职业突破?
【推荐】精品问答:微服务架构 Spring 核心知识 50 问
· 【线性回归】线性回归模型中几个参数的解释
· 从统计学看线性回归(2)——一元线性回归方程的显著性检验
· SPSS19.0实战之多元线性回归
· SPSS--回归-多元线性回归模型案例解析
· R语言解读一元线性回归模型
» 更多推荐...