楼主: lufengyi1987
2019 3

[原创博文] 悬赏50论坛币:关于mixed过程中的程序问题 [推广有奖]

  • 0关注
  • 1粉丝

准贵宾(季)

已卖:3份资源

硕士生

2%

还不是VIP/贵宾

-

威望
0
论坛币
2995 个
通用积分
0.0600
学术水平
0 点
热心指数
1 点
信用等级
0 点
经验
100 点
帖子
123
精华
0
在线时间
67 小时
注册时间
2009-9-13
最后登录
2017-2-22

楼主
lufengyi1987 发表于 2012-3-27 00:56:45 |AI写论文
50论坛币
我的模型是这样的,:y(ijt)=0.65*x(ijt)+v(i)+u(it)+e(ijt);i=1,,,,3;j=1,,,4;t=1,,,3;
v(i)是空间效应,在sas中用的是sp(pow)空间结构,u(it)服从AR(1)过程;
我的sas程序中,数据集中的数据是我按照一定分布模拟随机产生的,i表示area,j表示unit,t表示time。具体如下:
data moni;
input id x area unit time y;
datalines;
1 46.42160455 1 1 1 34.92458972
2 -24.72922685 1 1 2 -13.27412848
3 26.11672926 1 1 3 20.95302536
4 61.95090503 1 2 1 43.60223609
5 -40.60201828 1 2 2 -22.45660131
6 -5.070960253 1 2 3 0.985620198
7 -90.12559936 1 3 1 -55.37640561
8 82.54204128 1 3 2 56.46233792
9 -39.98879695 1 3 3 -24.02155711
10 -17.83839448 1 4 1 -8.731479088
11 8.75143445 1 4 2 8.110030921
12 5.282427054 1 4 3 5.734497884
13 -23.59860891 2 1 1 -7.044457101
14 -18.07840265 2 1 2 -2.094160532
15 218.0820714 2 1 3 148.3448954
16 50.38448211 2 6 1 40.60458512
17 -37.41395848 2 2 2 -18.85154526
18 34.25926693 2 2 3 28.19614168
19 6.942405343 2 3 1 13.30508786
20 -59.25429887 2 3 2 -32.42303916
21 72.90556742 2 3 3 53.26061119
22 11.58605756 2 4 1 17.32122626
23 37.39171878 2 4 2 28.77509932
24 1.201558532 2 4 3 5.799683404
25 -130.177745 3 1 1 -92.84541993
26 -20.47267961 3 1 2 -22.92239972
27 -14.67473979 3 1 3 -19.59641389
28 -57.47069086 3 2 1 -46.41458492
29 6.010672415 3 2 2 -7.484832837
30 75.04575555 3 2 3 40.19475313
31 -23.7885469 3 3 1 -21.17102451
32 61.03347368 3 3 2 27.81612491
33 -2.134804355 3 3 3 -11.44658891
34 33.4716502 3 4 1 15.53202632
35 43.16132209 3 4 2 18.29266987
36 -20.00510205 3 4 3 -22.9441564
;
ods graphics on;
proc mixed data=moni mmeq covtest;
class area unit time;
model y=x/noint s residual outpred=moni2;
random area/type=sp(pow)(area) subject=area;
random time(area)/type=AR(1) subject=time(area);
run;
ods graphics off;

现在我觉得自己在两个random语句中的表示有问题,导致出来的结果不行,同时我想知道的是,在sp(pow)中,area之间的距离d应该如何在程序中体现出来呢?有急用,求高手帮忙。

关键词:悬赏50论坛币 Mixed 50论坛币 0论坛币 论坛币 空间结构 程序 模型

沙发
lufengyi1987 发表于 2012-3-27 01:03:00
自己先顶一下吧
我就是我

藤椅
情迷仲夏夜 发表于 2012-3-27 01:50:52
I attached my result that run on my SAS v9.2 with this reply, if you think this is not the result that you want, I think you can give some estimate or parms in the model to make the result you expected close to it by using statment estimate and/or parms, such as:
  1. proc mixed data=prior;
  2.    class blk person prod period time priorprd;
  3.    model y=prod period time time*prod L1 L2 L3 L4 / ddfm=satterth;
  4.    random blk person(blk);
  5.    random period/type=ar(1) subject=person(blk);
  6.    repeated time/subject=period*person*blk type=ar(1);
  7.    parms (0.50079619) (0.32416655) (0.18092665) (-0.0558346) (0.20127984) (0.11540430);
  8.    lsmeans prod time*prod / pdiff;
  9. run;
  10. or
  11. proc mixed data=wheat noprofile;
  12.    class name;
  13.    model y=name;
  14.    parms (61.6) (18.1) (1) / noiter;
  15.    repeated / subject=intercept type=sp(sph)(lat lng);
  16.    lsmeans name;
  17.    estimate 'arap v brul' name 1 -1 0;
  18.    estimate 'arap v buck' name 1 0 -1 0;
  19.    estimate 'arap v ks83' name 1 0 0 0 0 0 0 0 0 0 -1 0;
  20.    estimate 'brul v ks83' name 0 1 0 0 0 0 0 0 0 0 -1 0;
  21.    make 'lsmeans' out=sph;
  22. run;
复制代码


and also you can read the sas publishing book "SAS System for Mixed Models"; proc_mixed_result.txt (19.04 KB)

板凳
lufengyi1987 发表于 2012-3-27 10:32:51
情迷仲夏夜 发表于 2012-3-27 01:50
I attached my result that run on my SAS v9.2 with this reply, if you think this is not the result th ...
你好,在你给的结果中,
  Covariance Parameter Estimates

                                       Standard         Z
Cov Parm     Subject       Estimate       Error     Value        Pr Z

Variance     area           46.8855     38.8348      1.21      0.1137
SP(POW)      area            0.9000           0       .         .
Variance     time(area)      1.6298      1.1904      1.37      0.0855
AR(1)        time(area)           0           .       .         .
Residual                     1.4337      0.3993      3.59      0.0002
这样看来,对AR(1)中的参数fi估计为0,但是不应该是0啊。同时,我觉得是不是SP(pow)那边的参数结果我觉得也不是那么的理想,我的真实值是0.3,估计是0.9。现在我的问题是这样的,在上述的模型中,应该怎么编辑v(i)和u(it)的部分,因为我觉得空间效应只和i有关,时间效应和i和t有关,而应变量和固定效应是和i,j,k有关的
我就是我

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-31 12:58