楼主: Son_Of_The_Sun
5288 7

[原创博文] 如何作(X1,X2)的Chi-square图 [推广有奖]

  • 3关注
  • 1粉丝

初中生

23%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
221 点
帖子
10
精华
0
在线时间
10 小时
注册时间
2012-3-5
最后登录
2014-2-8

楼主
Son_Of_The_Sun 发表于 2012-4-10 14:54:57 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
data awt5_2;
input x1 x2 @@;
cards;
3   2.30
5   1.90
5   1.00
7   0.70
7   0.30
7   1.00
8   1.05
9   0.45
10  0.70
11  0.30
;
请问如何作(X1,X2)的Chi-square图?

同时判断(X1,X2)的二元正态性?请老鸟踩踩.....小鸟在此谢过了
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Square ARE cards Input Data 如何 小鸟

沙发
Son_Of_The_Sun 发表于 2012-4-10 14:56:21

藤椅
bobguy 发表于 2012-4-12 10:23:28
"请问如何作(X1,X2)的Chi-square图?"

I don't understand what you are asking?

"同时判断(X1,X2)的二元正态性?请老鸟踩踩.....小鸟在此谢过了"

The bi-variate normal distribution has five parameters. mean1, std1,mean2, std2, and correlation.

Since a joint normal distribution has normal marginal distributions. You may test them separately and then test the correlation.

You can use histogram q-q plot, p - p plot to eye check your data. If it is not passed your eye-check, you can reject it.

板凳
Son_Of_The_Sun 发表于 2012-4-12 13:29:33
bobguy 发表于 2012-4-12 10:23
"请问如何作(X1,X2)的Chi-square图?"

I don't understand what you are asking?
哦,忘了告诉您,是通过相关性检验( correlation)这个参量来检测二元(x1,x2)的正态性,我只画得出他们的置信椭圆 10.jpg

报纸
bobguy 发表于 2012-4-13 11:08:30
Son_Of_The_Sun 发表于 2012-4-12 13:29
哦,忘了告诉您,是通过相关性检验( correlation)这个参量来检测二元(x1,x2)的正态性,我只画得出他们 ...
You really need to read some basic books before do any statistic analysis and inference.

地板
Bugjay 发表于 2012-4-13 13:12:14
https://bbs.pinggu.org/thread-793528-1-1.html不知道这个能帮你吗?

7
Son_Of_The_Sun 发表于 2012-4-13 16:46:17
bobguy 发表于 2012-4-13 11:08
You really need to read some basic books before do any statistic analysis and inference.
ok thank you

8
Son_Of_The_Sun 发表于 2012-4-17 16:38:21
(4)计算每一对观测值到样本均值向量的统计距离平方。


  
程序:proc iml;
n=10;p=2;
xx={x1 x2};
use awt5_2;
read all var xx into x;
e={[10] 1};
x0=(e*x)/n;
mm=i(10)-j(10,10,1)/n;
a=x`*mm*x;
s=a/(n-1);
si=inv(s);print x0 s si; /*si为s的逆矩阵*/
use awt5_2(obs=1);
read all var xx into xx1;
d1=(xx1-x0)*si*(xx1-x0)`; /*d 为马氏距离*/
use awt5_2(firstobs=2 obs=2);
read all var xx into xx2;
d2=(xx2-x0)*si*(xx2-x0)`;
use awt5_2(firstobs=3 obs=3);
read all var xx into xx3;
d3=(xx3-x0)*si*(xx3-x0)`;
use awt5_2(firstobs=4 obs=4);
read all var xx into xx4;
d4=(xx4-x0)*si*(xx4-x0)`;
use awt5_2(firstobs=5 obs=5);
read all var xx into xx5;
d5=(xx5-x0)*si*(xx5-x0)`;
use awt5_2(firstobs=6 obs=6);
read all var xx into xx6;
d6=(xx6-x0)*si*(xx6-x0)`;
use awt5_2(firstobs=7 obs=7);
read all var xx into xx7;
d7=(xx7-x0)*si*(xx7-x0)`;
use awt5_2(firstobs=8 obs=8);
read all var xx into xx8;
d8=(xx8-x0)*si*(xx8-x0)`;
use awt5_2(firstobs=9 obs=9);
read all var xx into xx9;
d9=(xx9-x0)*si*(xx9-x0)`;
use awt5_2(firstobs=10 obs=10);
read all var xx into xx10;
d10=(xx10-x0)*si*(xx10-x0)`;
print d1 d2 d3 d4 d5 d6 d7 d8 d9 d10;
run;
     通过d1=(xx1-x0)*si*(xx1-x0)`可计算各样本到达样本均值的马氏距离。
(5)计算样本点落在二元正态50%置信区域内的比率。(χ22(0.5)=1.39)
     
先算dj*dj
d1*d1=3.4101>1.39   d2*d2=1.4915>1.39  d3*d3=0.8642
d4*d4=0.2344       d5*d5=1.2746      d6*d6=0.0052
d7*d7=0.1873       d8*d8=0.5593      d9*d9=1.0701
d10*d10=1.8592>1.39
所以有七组数据时小于1.39的,落在二元正态50%置信区域内的比率是70%。
程序:proc lifetest method=pl width=2;
time  x2*x2(0);
freq x2;
run;
proc lifetest method=pl width=2;
time  x1*x2(0);
freq x2;
run;
      运行模块lifetest,我们可以得到x1,x2的点估计和区间估计,同时又相对应的75%、50%、25%三种情况下的置信区间比率。
(6)作(X1,X2)的Chi-square图。

程序:data md;
input n d @@;
cards;
1  4.0586824
2  2.1095808
3  2.1074318
4  0.6361144
5  3.2654794
6  0.0079034
7  0.5218616
8  0.6479336
9  2.0590803
10 2.5859323
;
run;
proc sort data=md;
by d;
run;
proc print data=md;
run;
proc means  data=md noprint;
var d;
output out=chiqn n=totn;
run;
data chiqq;
if (_n_=1) then set chiqn;
set md;
novar=2;
chisq=cinv(((_n_-0.5)/totn),novar);
prop=0;
d0=cinv(0.5,novar);
if d <=d0 then prop=1;
proc univariate data=chiqq;
var prop;
run;
proc gplot;
plot d*chisq;
label d='Mahalanobis Distance'
      chisq='Chi-Square Quantile';
          symbol1 v=star;
          *symbol2 i=join v=+;
run;
(7)判断(X1,X2)的二元正态性。
由(6)中图可知,(x1,x2)符合二元正态分布

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-25 18:59