楼主: ywh19860616
29613 92

[问答] 怎么把这个矩阵保存到excel中 [推广有奖]

31
epoh 发表于 2012-10-24 22:24:34
zhangtao 发表于 2012-10-24 21:37
??? Error using ==> wk1read
Too many output arguments.
没问题的.
%%%
A=wk1read('cigarette.wk1',1,0);
A  <1380x6 double>
  0        1        4.54223038621422        -0.0675932911325282        -0.159064694629687        3.93035366037472
  0        2        4.82831373730230        -0.247121550020870        -0.206132205487673        4.15188616271897
  .....
%%%%
>> demoLMsarsem_panel

Ordinary Least-squares Estimates
Dependent Variable =        logcit   
R-squared      =    0.3209
Rbar-squared   =    0.3199
sigma^2        =    0.0343
Durbin-Watson  =    1.6311
Nobs, Nvars    =   1380,     3
***************************************************************
Variable       Coefficient      t-statistic    t-probability
intercept         3.485067        30.752482         0.000000
logp             -0.859023       -25.162254         0.000000
logy              0.267733        10.848028         0.000000


loglikols =

  370.3279

LM test no spatial lag, probability          =   66.4657,    0.000
robust LM test no spatial lag, probability   =   58.2636,    0.000
LM test no spatial error, probability        =  153.0401,    0.000
robust LM test no spatial error, probability =  144.8380,    0.000
LM lag test for omitted spatial lag in panel data
                     
LM value                  66.46567338
Marginal Probability       0.00000000
chi(1) .01 value           6.64000000

LM error test for spatial errors in panel data
                     
LM value                 153.04007124
Marginal Probability       0.00000000
chi(1) .01 value           6.64000000

Robust LM lag test for omitted spatial lag in panel data
                     
LM value                  58.26362253
Marginal Probability       0.00000000
chi(1) .01 value           6.64000000

Robust LM error test for spatial errors in panel data
                     
LM value                 144.83802039
Marginal Probability       0.00000000
chi(1) .01 value           6.64000000


Ordinary Least-squares Estimates
Dependent Variable =           logcit
R-squared      =    0.5446
Rbar-squared   =    0.5443
sigma^2        =    0.0074
Durbin-Watson  =    1.5471
Nobs, Nvars    =   1380,     2
***************************************************************
Variable      Coefficient      t-statistic    t-probability
logp            -0.702293       -38.875780         0.000000
logy            -0.010556        -0.657335         0.511075


FE_rsqr2 =

    0.8528


logliksfe =

  1.4252e+003

LM test no spatial lag, probability          =  136.4292,    0.000
robust LM test no spatial lag, probability   =   29.5127,    0.000
LM test no spatial error, probability        =  255.7150,    0.000
robust LM test no spatial error, probability =  148.7985,    0.000
LM lag test for omitted spatial lag in panel data
                     
LM value                 136.42922576
Marginal Probability       0.00000000
chi(1) .01 value           6.64000000

LM error test for spatial errors in panel data
                     
LM value                 255.71499922
Marginal Probability       0.00000000
chi(1) .01 value           6.64000000

Robust LM lag test for omitted spatial lag in panel data
                     
LM value                  29.51270710
Marginal Probability       0.00000006
chi(1) .01 value           6.64000000

Robust LM error test for spatial errors in panel data
                     
LM value                 148.79848056
Marginal Probability       0.00000000
chi(1) .01 value           6.64000000


Ordinary Least-squares Estimates
Dependent Variable =           logcit
R-squared      =    0.3410
Rbar-squared   =    0.3406
sigma^2        =    0.0283
Durbin-Watson  =    1.9980
Nobs, Nvars    =   1380,     2
***************************************************************
Variable      Coefficient      t-statistic    t-probability
logp            -1.205073       -22.660295         0.000000
logy             0.565364        18.664801         0.000000


FE_rsqr2 =

    0.4404


logliktfe =

  503.8506

LM test no spatial lag, probability          =   44.0402,    0.000
robust LM test no spatial lag, probability   =    0.3302,    0.566
LM test no spatial error, probability        =   62.8646,    0.000
robust LM test no spatial error, probability =   19.1546,    0.000
LM lag test for omitted spatial lag in panel data
                     
LM value                  44.04022085
Marginal Probability       0.00000000
chi(1) .01 value           6.64000000

LM error test for spatial errors in panel data
                     
LM value                  62.86462230
Marginal Probability       0.00000000
chi(1) .01 value           6.64000000

Robust LM lag test for omitted spatial lag in panel data
                     
LM value                   0.33024003
Marginal Probability       0.56551778
chi(1) .01 value           6.64000000

Robust LM error test for spatial errors in panel data
                     
LM value                  19.15464149
Marginal Probability       0.00001205
chi(1) .01 value           6.64000000


Ordinary Least-squares Estimates
Dependent Variable =           logcit
R-squared      =    0.3944
Rbar-squared   =    0.3940
sigma^2        =    0.0053
Durbin-Watson  =    1.7791
Nobs, Nvars    =   1380,     2
***************************************************************
Variable      Coefficient      t-statistic    t-probability
logp            -1.034884       -25.632843         0.000000
logy             0.528543        11.668292         0.000000


FE_rsqr2 =

    0.8955


loglikstfe =

  1.6617e+003

LM test no spatial lag, probability          =   46.9005,    0.000
robust LM test no spatial lag, probability   =    1.1563,    0.282
LM test no spatial error, probability        =   54.6548,    0.000
robust LM test no spatial error, probability =    8.9106,    0.003
LM lag test for omitted spatial lag in panel data
                     
LM value                  46.90051952
Marginal Probability       0.00000000
chi(1) .01 value           6.64000000

LM error test for spatial errors in panel data
                     
LM value                  54.65480685
Marginal Probability       0.00000000
chi(1) .01 value           6.64000000

Robust LM lag test for omitted spatial lag in panel data
                     
LM value                   1.15633190
Marginal Probability       0.28222757
chi(1) .01 value           6.64000000

Robust LM error test for spatial errors in panel data
                     
LM value                   8.91061923
Marginal Probability       0.00283517
chi(1) .01 value           6.64000000

LR-test joint significance spatial fixed effects, degrees of freedom and probability = 2315.7004,    46,   0.0000
LR-test joint significance time-periode fixed effects, degrees of freedom and probability =  473.0957,    30,   0.0000
>>
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
zhangtao + 5 + 5 + 5 好的意见建议

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

32
zhangtao 发表于 2012-10-25 08:55:31
epoh老师,您好!
wk1read.m这个文件在jplv7的那个文件夹中?
winbugs14在win7(64位)如何安装?
数学好就是要天天学

33
ywh19860616 发表于 2012-10-25 09:38:04
zhangtao 发表于 2012-10-25 08:55
epoh老师,您好!
wk1read.m这个文件在jplv7的那个文件夹中?
winbugs14在win7(64位)如何安装?
C:\MATLAB7\toolbox\matlab\iofun\wk1read.m
matlab自带的函数。
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
zhangtao + 5 + 5 + 5 非常感谢!

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

一份耕耘,一份收获。

34
epoh 发表于 2012-10-25 09:43:40
zhangtao 发表于 2012-10-25 08:55
epoh老师,您好!
wk1read.m这个文件在jplv7的那个文件夹中?
winbugs14在win7(64位)如何安装?
WinBUGS安装在win7(64位)请参考底下官网:
If installing on a 64-bit machine, you should download a zipped version of
the whole file structure and unzip it into Program Files or wherever you want it.
  http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/contents.shtml
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
zhangtao + 5 + 5 + 5 非常感谢!

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

35
zhangtao 发表于 2012-10-25 21:54:13
Doc2.doc (253 KB)
为什么不显示stats和density等呢?

无标题.png
数学好就是要天天学

36
ywh19860616 发表于 2012-11-6 08:44:13
epoh 发表于 2012-10-25 09:43
WinBUGS安装在win7(64位)请参考底下官网:
If installing on a 64-bit machine, you should download a  ...
epoh老师,这个是我对应的数据,谢谢您。
gdp.rar (13.59 KB) 本附件包括:
  • gdp.csv

一份耕耘,一份收获。

37
epoh 发表于 2012-11-6 12:18:51
ywh19860616 发表于 2012-11-6 08:44
epoh老师,这个是我对应的数据,谢谢您。
x11,x12,x33,x35含缺失值
我改为0后,结果如下:
         Generalized Linear Models Fitted via Gradient Boosting

Call:
glmboost.formula(formula = form1, data = data2, control = control1)


         Squared Error (Regression)

Loss function: (y - f)^2


Number of boosting iterations: mstop = 1000
Step size:  0.1
Offset:  0.01817126

Coefficients:
  (Intercept)            x1            x3            x4            x5
4.988252e-02 -1.783758e-05 -3.325863e-04  1.731596e-03  1.182520e-02
           x6            x7            x8            x9           x10
-1.940684e-03 -6.002514e-03 -2.681798e-03  3.762021e-02  7.426345e-06
          x11           x12           x13           x14           x15
2.259706e-06  2.531580e-07  2.386428e-03  1.071192e-02 -3.181342e-04
          x16           x18           x20           x21           x22
-5.284128e-04 -1.671078e-03 -6.686344e-03  1.234232e-01 -6.203724e-02
          x23           x24           x25           x26           x27
-2.756625e-02 -9.297037e-04 -1.406581e-02 -2.184697e-02  1.934449e-03
          x28           x29           x33           x34           x36
2.575692e-03 -7.811003e-05  2.853482e-04  2.063190e-04 -3.549440e-03
          x37           x38           x41           x42           x43
3.869174e-02  4.379488e-03  3.387566e-04  7.391188e-04  6.550135e-03
          x44           x46           x47           x49           x51
1.780142e-02  6.158870e-08 -4.528557e-04  1.719498e-08 -3.591763e-04
          x53           x54           x55           x56           x58
-3.543192e-05 -7.124848e-03 -5.904705e-04 -2.342254e-03  2.939947e-03
          x59           x62           x63           x66           x67
-4.617615e-03 -4.090289e-03 -4.379344e-03  7.329981e-03 -3.673455e-04
attr(,"offset")
[1] 0.01817126
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
ywh19860616 + 5 + 5 + 5 谢谢epoh老师

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

38
ywh19860616 发表于 2012-11-6 14:16:07
epoh 发表于 2012-11-6 12:18
x11,x12,x33,x35含缺失值
我改为0后,结果如下:
         Generalized Linear Models Fitted via Gradie ...
谢谢epoh老师,的确是因为缺省值引起的。
原以为是我数据框用错了。
一份耕耘,一份收获。

39
epoh 发表于 2012-11-6 14:26:51
ywh19860616 发表于 2012-11-6 14:16
谢谢epoh老师,的确是因为缺省值引起的。
原以为是我数据框用错了。
有缺省值,就会形成Levels

> data2$x10
[1]  220.5315   49.4502 1178.2328    8.7110   87.8611  406.1147  345.6478
[8]   38.4017   41.3377  530.1852   28.4091   33.5902   68.3077   34.8851
[15]   92.7045  109.5385   26.6591 1034.5308   38.3881  418.3289   21.5287
[22]    8.9971   60.4110   70.1908   88.1299   35.9247   36.8064   30.4252
[29]  148.0764  236.6730  101.4822  514.8791   41.3107   14.9737    8.0623
[36]   27.3537    7.2393   57.8243    6.6483   51.8819   64.8345    6.0854
[43]   50.6950  132.7459  316.3302  116.4905   98.3452   65.1672   62.7328
[50]  223.9572  128.8893   68.8771  117.5753    0.3220    6.7214   18.8325
[57]    9.7540    4.0014   52.4661    3.9487   40.3624   14.5470   15.4315
[64]   10.8185    0.3733    6.5355   40.2938    2.9893   19.3578   11.7381
[71]    3.5857    9.2622   68.7562   12.0414    6.3008   15.4798  569.6023
[78]    5.8578    2.9547   85.6828   10.4181   16.3993   55.0294   27.9774
[85]    4.6132  741.0994  235.8646
> data2$x11
[1] 74.74003 99.27784 0        0        19.58585 0        12.39925 64.09662
[9] 18.25667 3.438613 63.06274 77.20781 13.07549 0        14.02777 8.653484
[17] 0        2.801948 51.21938 0        132.9795 0        47.15005 30.37214
[25] 25.41653 74.31586 51.07906 0        30.75152 0        0        13.4373
[33] 29.02468 78.66887 145.0772 72.5593  150.3266 21.19768 162.5115 17.43064
[41] 17.50638 174.6589 71.91255 12.4985  0        36.76809 9.127183 30.34203
[49] 30.30622 0        28.76789 35.73729 29.15127 3729.293 238.6484 76.17235
[57] 131.6355 272.176  21.18003 310.6865 32.95543 0        67.62395 107.5375
[65] 3081.967 171.5903 62.65871 391.4445 86.4634  66.78308 420.7111 112.1376
[73] 33.61261 88.70178 120.6083 69.06823 .        169.9543 353.6062 22.41369
[81] 141.8488 98.96389 43.88341 56.84623 199.0842 6.251487 4.690946
75 Levels: . 0 107.5375 112.1376 12.39925 12.4985 120.6083 ... 99.27784
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
ywh19860616 + 5 + 5 + 5 是的,谢谢您

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

40
ywh19860616 发表于 2012-11-6 14:32:48
epoh 发表于 2012-11-6 14:26
有缺省值,就会形成Levels

> data2$x10
是的,这个问题困扰了好多天。
非常感谢epoh老师。
一份耕耘,一份收获。

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

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