2572 6

[休闲其它] (持续更新)学习stata那些事 [推广有奖]

  • 1关注
  • 0粉丝

已卖:1份资源

硕士生

29%

还不是VIP/贵宾

-

威望
0
论坛币
2728 个
通用积分
0.2329
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1011 点
帖子
57
精华
0
在线时间
214 小时
注册时间
2022-3-31
最后登录
2024-1-22

楼主
久菜盒子工作室 发表于 2022-4-20 07:15:30 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
【久菜笔记】学习stata那些事
1.缩进功能  winsor2 var, cut (1 99) replace
二维码

扫码加我 拉你入群

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

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

关键词:Stata tata 那些事 stata学习 统计分析

沙发
久菜盒子工作室 发表于 2022-4-26 10:15:26
1.描述性统计  sum2docx y x x1 x2 x3 x4 x5 x6 x7 x8 using 描述性统计(jchz2022-5).docx,replace stats (N mean(%9.3f) median(%9.3f) min(%9.3f) max(%9.3f) p25 p75 sd) title("描述性统计")
2.forvalue函数的用法
1)可以在赋值和生成新变量的基础上进行循环运算

藤椅
久菜盒子工作室 发表于 2022-9-22 20:58:42
2.门限回归关于报错的问题,有一个不能为01变量,r3200  

板凳
三江鸿 发表于 2022-9-25 19:14:19
点赞支持
我为人人 人人为我

报纸
久菜盒子工作室 发表于 2022-10-28 14:51:25
  xsmle y x1 x2 x3 x4 x5 x6 x7 , fe model(sdm) wmat(w1) nolog effects type(ind)
Warning: All regressors will be spatially lagged

                       *:  3200  conformability error
            _xsmle_est():     -  function returned error
                 <istmt>:     -  function returned error

地板
久菜盒子工作室 发表于 2022-10-28 14:52:47
久菜盒子工作室 发表于 2022-9-22 20:58
2.门限回归关于报错的问题,有一个不能为01变量,r3200
xsmle y x1 x2 x3 x4 x5 x6 x7 , fe model(sdm) wmat(w1) nolog effects type(ind)
Warning: All regressors will be spatially lagged

                       *:  3200  conformability error
            _xsmle_est():     -  function returned error
                 <istmt>:     -  function returned error

解决

7
久菜盒子工作室 发表于 2022-10-28 15:32:03
久菜盒子工作室 发表于 2022-10-28 14:52
xsmle y x1 x2 x3 x4 x5 x6 x7 , fe model(sdm) wmat(w1) nolog effects type(ind)
Warning: All regre ...
1.对x和y都取ln

2.重新设计矩阵
不用300*300的矩阵而是用15*15的矩阵

8
久菜盒子工作室 发表于 2022-10-28 18:25:19
2.空间计量模型代码
代码---w1
bysort id:gen n=_n
replace x1=ln(1+x1)
replace x2=ln(1+x2)
replace x3=ln(1+x3)
replace x4=ln(1+x4)
replace x5=ln(1+x5)
replace x6=ln(1+x6)
replace x7=ln(1+x7)
save "G:\公众号:久菜盒子工作室\2022年10月\8.咎巷-800-空间向量结果函数\2.数据-w\stata数据.dta"
cd G:\公众号:久菜盒子工作室\2022年10月\8.咎巷-800-空间向量结果函数\2.数据-w
clear
set matsize 5000
use w
spcs2xt A-AD ,matrix(w1)time(20)
spatwmat using w1xt,name(w1) standardize
use stata数据
reg y x1 x2 x3 x4 x5 x6 x7
spatdiag,weights(w1)

w2
use juliw2
spcs2xt A-AD ,matrix(w2)time(20)
spatwmat using w2xt,name(w2) standardize
use stata数据
reg y x1 x2 x3 x4 x5 x6 x7
spatdiag,weights(w2)
  
w3
use qiantaow3
spcs2xt A-AD ,matrix(w3)time(20)
spatwmat using w3xt,name(w3) standardize
use stata数据
reg y x1 x2 x3 x4 x5 x6 x7
spatdiag,weights(w3)


*基于不同空间权重矩阵的SDM模型估计结果

*重新设立矩阵-Wald检验

spatwmat using w.dta,name(w11)
spatwmat using w.dta,name(w11) standardize
xsmle y x1 x2 x3 x4 x5 x6 x7 , fe model(sdm)  wmat(w11) nolog effects type(both)
test x1 = x2 = x3 = x4 = x5 = x6 = x7

spatwmat using juliw2.dta,name(w22)
spatwmat using juliw2.dta,name(w22) standardize
xsmle y x1 x2 x3 x4 x5 x6 x7 , fe model(sdm)  wmat(w22) nolog effects type(both)
test x1 = x2 = x3 = x4 = x5 = x6 = x7

spatwmat using qiantaow3.dta,name(w33)
spatwmat using qiantaow3.dta,name(w33) standardize
xsmle y x1 x2 x3 x4 x5 x6 x7 , fe model(sdm)  wmat(w33) nolog effects type(both)
test x1 = x2 = x3 = x4 = x5 = x6 = x7


*基于不同空间权重矩阵的SDM模型估计结果
******************************************************************************
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w11) nolog  type(time)
est store m1
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w11) nolog  type( ind)
est store m2
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w11) nolog  type(both)
est store m3
esttab m1 m2 m3  using w1空间计量.rtf,replace stats(N r2_a) star(* 0.1 ** 0.05 *** 0.01) se ar2

***************************************************************************
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w22) nolog  type(time)
est store m1
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w22) nolog  type( ind)
est store m2
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w22) nolog  type(both)
est store m3
esttab m1 m2 m3  using w2空间计量.rtf,replace stats(N r2_a) star(* 0.1 ** 0.05 *** 0.01) se ar2

*****************************************************************************************
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w33) nolog  type(time)
est store m1
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w33) nolog  type(ind)
est store m2
xsmle y x1 x2 x3 x4 x5 x6 x7, fe model(sdm) wmat(w33) nolog  type(both)
est store m3
esttab m1 m2 m3  using w3空间计量.rtf,replace stats(N r2_a) star(* 0.1 ** 0.05 *** 0.01) se ar2

***************************************************************************************

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

本版微信群
jg-xs1
拉您进交流群
GMT+8, 2026-1-6 17:47