楼主: Lee_iris
2690 4

[回归分析求助] 生成空间滞后项 [推广有奖]

教授

35%

还不是VIP/贵宾

-

威望
0
论坛币
1651 个
通用积分
1141.3311
学术水平
35 点
热心指数
42 点
信用等级
34 点
经验
2412 点
帖子
878
精华
0
在线时间
1378 小时
注册时间
2019-3-5
最后登录
2024-4-26

楼主
Lee_iris 在职认证  学生认证  发表于 2022-2-22 23:21:22 |只看作者 |坛友微信交流群|倒序 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
splagvar命令选项挺多的,应该用哪个生成空间滞后项呢?有什么区别,在什么情况下用?

  1.         splagvar  $y,  wname(weight)  wfrom(Stata)  order(1)   ind( $x)
  2.         splagvar ,qvar($x ) qname($xsplag)
复制代码

二维码

扫码加我 拉你入群

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

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

关键词:GVAR VaR PLA lag 滞后项

沙发
Lee_iris 在职认证  学生认证  发表于 2022-3-9 16:07:47 |只看作者 |坛友微信交流群
help文件是这么说的

   wname(weights_name) specifies the name of the spatial weights matrix to be used.

    wfrom(Stata | Mata) indicates whether the spatial weights matrix is a Stata matrix loaded in memory or a Mata file located in the working directory. If the spatial weights matrix had been created using spwmatrix it should exist as a Stata matrix or as a Mata file.

  
    qvar(varlist3) specifies the variables to be used in generating quasi-instrumental variables.

    qname(newvarlist) specifies a list of variable names for the generated quasi-intrumental variables coded 1, 0, and -1 depending on whether or not the values of the corresponding variables specified with qvar() are in the upper, middle or lower third of values when placed in rank order (see Fingle and Le Gallo, 2008).

使用道具

藤椅
Lee_iris 在职认证  学生认证  发表于 2022-3-10 19:14:29 |只看作者 |坛友微信交流群
https://www.statalist.org/forums ... 1510157#post1510157

https://www.statalist.org/forums/forum/general-stata-discussion/general/1567633-error-using-spgenerate?p=1572625#post1572625
参考Statalist帖子,关于生成空间滞后项的命令

使用道具

板凳
UUYABC 学生认证  发表于 2022-5-3 11:18:27 |只看作者 |坛友微信交流群
你好,请问你解决了吗

使用道具

报纸
Lee_iris 在职认证  学生认证  发表于 2022-5-3 16:52:36 |只看作者 |坛友微信交流群
UUYABC 发表于 2022-5-3 11:18
你好,请问你解决了吗
试试:
  1. copy http://www.stata-press.com/data/r15/homicide_1960_1990.dta homicide_1960_1990.dta
  2. copy http://www.stata-press.com/data/r15/homicide_1960_1990_shp.dta homicide_1960_1990_shp.dta
  3. use homicide_1960_1990
  4. xtset _ID year, delta(10)
  5. spset
  6. spmatrix create contiguity W if year == 1990
  7. spgenerate Whrate = W*hrate if year == 1990
  8. forv year = 1980(-10)1960 {
  9.     spgenerate Whrate_temp = W*hrate if year == `year'
  10.     replace Whrate = Whrate_temp if year == `year'
  11.     drop Whrate_temp
  12. }
复制代码

使用道具

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

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

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

GMT+8, 2024-4-27 17:26