楼主: 音乐开关
869 0

[数据管理求助] 虚拟变量求助 [推广有奖]

  • 0关注
  • 0粉丝

初中生

76%

还不是VIP/贵宾

-

威望
0
论坛币
422 个
通用积分
3.0000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
383 点
帖子
2
精华
0
在线时间
35 小时
注册时间
2015-4-1
最后登录
2020-11-19

10论坛币
1.想做的是租售同权政策对学区房的研究 拿了一个区域的二手交易数据做PSMDID 然后现在的问题是房屋的特征有很多是分类变量,比如几室几厅、朝向等,如果做出虚拟变量的话就会有很多很多个,最后做出psm变成了这样,求问应该怎么处理如几十几厅这种有20类的变量)!

. diff saleprice,tr(d) p(t) id(district) k cov(layer area distance fit1 fit2 f
> it3 fac1 fac2 fac3 fac4 fac5 fac6 fac7 fac8 fac9 fac10 fac11 fac12 bud1 bud2
>  bud3 ty1 ty2 ty3 ty4 ty5 ty6 ty7 ty8 ty9 ty10 ty11 ty12 ty13 ty14 ty15 ty16
>  ty17 ty18 ty19 ty20) rep log sup test
    Report - Propensity score estimation with logit command
    Atention: _pscore is estimated at baseline

note: ty1 != 0 predicts failure perfectly
      ty1 dropped and 1 obs not used

note: ty4 != 0 predicts failure perfectly
      ty4 dropped and 4 obs not used

note: ty5 != 0 predicts success perfectly
      ty5 dropped and 1 obs not used

note: ty12 != 0 predicts success perfectly
      ty12 dropped and 1 obs not used

note: ty13 != 0 predicts failure perfectly
      ty13 dropped and 6 obs not used

note: ty18 != 0 predicts failure perfectly
      ty18 dropped and 2 obs not used

note: ty20 != 0 predicts failure perfectly
      ty20 dropped and 1 obs not used

note: fit3 dropped because of collinearity
note: fac4 dropped because of collinearity
note: fac10 dropped because of collinearity
note: bud2 dropped because of collinearity
note: bud3 dropped because of collinearity
note: ty8 dropped because of collinearity
note: ty11 dropped because of collinearity
note: ty15 dropped because of collinearity
note: ty19 dropped because of collinearity
Iteration 0:   log likelihood = -327.58016
Iteration 1:   log likelihood = -309.68541
Iteration 2:   log likelihood = -305.72193
Iteration 3:   log likelihood = -303.30688
Iteration 4:   log likelihood = -302.84723
Iteration 5:   log likelihood = -302.80129
Iteration 6:   log likelihood = -302.80124

Logistic regression                               Number of obs   =       1024
                                                  LR chi2(25)     =      49.56
                                                  Prob > chi2     =     0.0024
Log likelihood = -302.80124                       Pseudo R2       =     0.0756

------------------------------------------------------------------------------
           d |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       layer |    .013826   .0148255     0.93   0.351    -.0152314    .0428834
        area |   .0035187   .0067148     0.52   0.600     -.009642    .0166795
    distance |  -.0003911   .0002221    -1.76   0.078    -.0008264    .0000442
        fit1 |   .4668567   .5037281     0.93   0.354    -.5204323    1.454146
        fit2 |   .5214091   .5189723     1.00   0.315    -.4957578    1.538576
        fac1 |  -.9002936   .7596992    -1.19   0.236    -2.389277    .5886895
        fac2 |  -.1183306   .7037523    -0.17   0.866     -1.49766    1.260999
        fac3 |  -.7663603   .7479054    -1.02   0.306    -2.232228    .6995073
        fac5 |  -.8653024   .7372475    -1.17   0.241    -2.310281    .5796761
        fac6 |  -.8439366   .6890913    -1.22   0.221    -2.194531    .5066574
        fac7 |  -1.095508   .7292878    -1.50   0.133    -2.524886    .3338699
        fac8 |  -1.927912   .9802947    -1.97   0.049    -3.849254   -.0065694
        fac9 |  -1.509873   .9838098    -1.53   0.125    -3.438105    .4183588
       fac11 |  -.9444449   .8931755    -1.06   0.290    -2.695037    .8061469
       fac12 |  -.4224127   .7602739    -0.56   0.578    -1.912522    1.067697
        bud1 |   -1.32147   .3279392    -4.03   0.000    -1.964219   -.6787212
         ty2 |  -3.159524   1.814983    -1.74   0.082    -6.716824    .3977767
         ty3 |  -1.579068   1.498144    -1.05   0.292    -4.515376     1.35724
         ty6 |  -2.205359   1.463701    -1.51   0.132    -5.074161    .6634419
         ty7 |  -2.581226   1.502027    -1.72   0.086    -5.525145    .3626937
         ty9 |  -1.864168   1.468457    -1.27   0.204    -4.742291    1.013955
        ty10 |  -2.214801   1.475838    -1.50   0.133    -5.107391    .6777892
        ty14 |  -1.493533   1.577886    -0.95   0.344    -4.586132    1.599066
        ty16 |   -2.01442   1.996657    -1.01   0.313    -5.927795    1.898956
        ty17 |  -.7865311   2.094981    -0.38   0.707    -4.892618    3.319556
       _cons |   1.292582   1.773997     0.73   0.466    -2.184389    4.769553
------------------------------------------------------------------------------
    Matching iterations...
..............................................................................
> .....................
TWO-SAMPLE T TEST
    Test on common support

Number of observations (baseline): 1048
            Before         After   
   Control: 946            -           946
   Treated: 102            -           102
            1048           -

t-test at period = 0:
------------------------------------------------------------------------------
> ----------------
Weighted Variable(s) |   Mean Control   | Mean Treated |    Diff.   |   |t|   
> |  Pr(|T|>|t|)
---------------------+------------------+--------------+------------+---------
> +---------------
saleprice            |  3.1e+04         |  4.0e+04     | 9668.978   | 13.66   
> | 0.0000***
layer                | 8.021            | 8.538        | 0.518      |  0.92   
> | 0.3564
area                 | 72.320           | 74.154       | 1.834      |  0.86   
> | 0.3879
distance             | 712.128          | 702.758      | -9.371     |  0.31   
> | 0.7548
fit1                 | 0.641            | 0.626        | -0.014     |  0.47   
> | 0.6386
fit2                 | 0.303            | 0.323        | 0.020      |  0.69   
> | 0.4893
fit3                 | 0.057            | 0.051        | -0.006     |  0.42   
> | 0.6752
fac1                 | 0.089            | 0.081        | -0.008     |  0.47   
> | 0.6404
fac2                 | 0.168            | 0.182        | 0.014      |  0.58   
> | 0.5640
fac3                 | 0.089            | 0.091        | 0.002      |  0.13   
> | 0.9005
fac4                 | 0.026            | 0.030        | 0.004      |  0.42   
> | 0.6772
fac5                 | 0.097            | 0.101        | 0.005      |  0.24   
> | 0.8130
fac6                 | 0.257            | 0.253        | -0.004     |  0.16   
> | 0.8745
fac7                 | 0.126            | 0.111        | -0.015     |  0.74   
> | 0.4587
fac8                 | 0.023            | 0.020        | -0.003     |  0.28   
> | 0.7776
fac9                 | 0.025            | 0.020        | -0.005     |  0.48   
> | 0.6306
fac10                | 0.000            | 0.000        | 0.000      |     .   
> |     .
fac11                | 0.033            | 0.030        | -0.002     |  0.22   
> | 0.8285
fac12                | 0.068            | 0.081        | 0.012      |  0.74   
> | 0.4588
bud1                 | 0.812            | 0.818        | 0.006      |  0.24   
> | 0.8120
bud2                 | 0.000            | 0.000        | 0.000      |     .   
> |     .
bud3                 | 0.188            | 0.182        | -0.006     |  0.24   
> | 0.8120
ty1                  | 0.000            | 0.000        | 0.000      |     .   
> |     .
ty2                  | 0.010            | 0.010        | 0.000      |  0.05   
> | 0.9610
ty3                  | 0.171            | 0.182        | 0.011      |  0.46   
> | 0.6470
ty4                  | 0.000            | 0.000        | 0.000      |     .   
> |     .
ty5                  | 0.000            | 0.000        | 0.000      |     .   
> |     .
ty6                  | 0.382            | 0.354        | -0.028     |  0.91   
> | 0.3621
ty7                  | 0.085            | 0.071        | -0.015     |  0.86   
> | 0.3919
ty8                  | 0.000            | 0.000        | 0.000      |     .   
> |     .
ty9                  | 0.145            | 0.172        | 0.026      |  1.13   
> | 0.2575
ty10                 | 0.144            | 0.141        | -0.002     |  0.10   
> | 0.9178
ty11                 | 0.014            | 0.000        | -0.014     |  2.66   
> | 0.0080***
ty12                 | 0.000            | 0.000        | 0.000      |     .   
> |     .
ty13                 | 0.000            | 0.000        | 0.000      |     .   
> |     .
ty14                 | 0.034            | 0.051        | 0.017      |  1.33   
> | 0.1851
ty15                 | 0.000            | 0.000        | 0.000      |     .   
> |     .
ty16                 | 0.010            | 0.010        | -0.000     |  0.05   
> | 0.9569
ty17                 | 0.005            | 0.010        | 0.005      |  0.84   
> | 0.3999
ty18                 | 0.000            | 0.000        | 0.000      |     .   
> |     .
ty19                 | 0.000            | 0.000        | 0.000      |     .   
> |     .
ty20                 | 0.000            | 0.000        | 0.000      |     .   
> |     .
------------------------------------------------------------------------------
> ----------------
*** p<0.01; ** p<0.05; * p<0.1
Attention: option kernel weighs variables in cov(varlist)
Means and t-test are estimated by linear regression


.


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

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-25 23:55