残差复合正态分布的重要性

如果结果残差不是正态分布 说明用线性回归来拟合数据是不合适的
可能是非线性回归

这里的类是对应因变量的取值 如果是连续型的那就只有一类 销售量

如果是离散型的那就有几类就假设几类 黑白球
当总体只有一类的时候 我们假设符合正态分布
如果有两类假设符合二项分布

论线性回归中残差图的重要性

        </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>
posted @ 2015-01-02 19:11  暴走的豆浆  阅读( 1985)  评论( 0编辑  收藏
    <div id="google_ads_iframe_/1090369/C2_0__container__" style="border: 0pt none;"><iframe id="google_ads_iframe_/1090369/C2_0" title="3rd party ad content" name="google_ads_iframe_/1090369/C2_0" width="468" height="60" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" srcdoc="" style="border: 0px; vertical-align: bottom;" data-google-container-id="2" data-load-complete="true"></iframe></div></div>
</div>
<div id="under_post_kb">
    <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="">
< 2020年2月 >
262728293031 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

常用链接

我的随笔

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值