楼主: QYNB
5795 2

[Stata] STATA 蒙特卡洛模拟程序包 [推广有奖]

  • 0关注
  • 1粉丝

已卖:1464份资源

博士生

2%

还不是VIP/贵宾

-

威望
0
论坛币
11459 个
通用积分
9.8350
学术水平
5 点
热心指数
5 点
信用等级
5 点
经验
6722 点
帖子
142
精华
0
在线时间
213 小时
注册时间
2010-4-13
最后登录
2024-5-25

楼主
QYNB 发表于 2015-2-15 21:01:30 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币

使用方式+案例+参考来源




      将这两个文件放到stata的ado文件夹下的base文件夹中就可以了。然后在stata命令窗口中输入help xtarsim,就能显示该命令的使用方法。



1.使用方式




  1. ---------------------------------------------------------------------------------------------
  2. help for xtarsim
  3. ---------------------------------------------------------------------------------------------
  4. Simulate panel dataset
  5.         xtarsim newdepvar newindepvar newindeffect newtimeffect , nid(#) time(#)
  6.                 gamma(real) beta(real) rho(real) snratio(real) [sigma(real)
  7.                 oneway(effect_type load) twoway(effect_type load) unbd(N_1 T_1) seed(#)]

  8.     xtarsim creates panel datasets for use in Monte Carlo experiments as pseudo-random
  9.     realizations from (possibly) dynamic twoway linear panel data models.

  10.     Description
  11.     xtarsim creates a dataset from the following general panel data model
  12.     y[i,t] =  y[i,t-1]gamma + x[i,t]beta + u[i] + u[t] + e[i,t]
  13.     x[i,t] =  x[i,t-1]rho + v[i,t]      i={1,...,N};     t={1,...,T},
  14.     where
  15.     gamma, beta and rho are real numbers chosen by the user.
  16.     e[i,t] are iid Normal(0,sigma^2), with sigma chosen by the user.
  17.     v[i,t] are iid Normal(0,sigma_v^2), with sigma_v being uniquely determined once
  18.     choosing the model parameters and the signal to noise ratio of the y[i,t] regression.
  19.     Attention should be paid to supply parameter values that ensure a finite positive
  20.     variance for v[i,t]. When this does not happen an error message is issued by xtarsim.
  21.     e[i,t] and v[i,t] are not correlated, so that x[i,t] is a strictly exogenous regressor
  22.     in the first equation of the model.
  23.     u[i] and u[t] are, respectively, the individual and time effects, and may or may not be
  24.     correlated with x[i,t].
  25.     If correlated, individual effects are determined as u[i]=load_1*(1-gamma)*(1+x[i]-x),
  26.     where x[i] and x, respectively, are the group mean and the overall mean of x[i,t], and
  27.     load_1 is a load factor chosen by the user. Correlated time effects, instead, are
  28.     determined as contrasts to the first period, u[t]=load_2*(1-gamma)*(x[t]-x[1]), where
  29.     again load_2 is a load factor chosen by the user. Such normalisation is convenient in
  30.     that the constant term in xtreg, in its one-way fixed effect version as well as two-way
  31.     fixed effect version excluding the first time indicator, can be interpreted as an
  32.     estimate for load_1*(1-gamma) (see the example file static2way_bias.do available for
  33.     download). If not correlated, both effects are taken to be iid
  34.     Normal(0,load^2*(1-gamma)^2) with a specific load factor for each effect.
  35.     Following Kiviet (1995) start-up values y[i,0] and x[i,0] are obtained according to the
  36.     model using the McLeod and Hipel (1978) procedure. This avoids wasting random numbers
  37.     in generating start-up values and also small-sample non-stationarity problems. This
  38.     procedure has been also applied by Bun and Kiviet (2003), Bruno (2005a) and (2005b).
复制代码






2.案例




  1. Examples
  2.     (Create a panel from a static one-way random effect Data Generation Process (DGP))
  3.         . xtarsim y x eta, n(200) t(10) g(0) b(.8) r(.2) sn(9) seed(1234)
  4.         . describe
  5.         . xtdes
  6.     (Create a panel from a dynamic one-way fixed effect DGP)
  7.         . xtarsim y x eta, n(200) t(10) g(.2) b(.8) r(.2) one(corr 1) sn(9) seed(1234)
  8.         . xtdes
  9.     (Demonstrate, on this dataset, the expected good perfomance of the basic Arellano-Bond
  10.     estimator in terms of estimation error and specification tests)
  11.         . xtabond y x,noco
  12.     (Create a panel from a dynamic two-way fixed effect DGP)
  13.         . xtarsim y x eta theta, n(200) t(10) g(.2) b(.8) r(.2) two(corr 5) sn(9)
  14.             seed(1234)
  15.         . describe
  16.         . xtdes
  17.     (Demonstrate, on this dataset, the expected poor perfomance of the basic Arellano-Bond
  18.     estimator in terms of estimation error and specification tests)

  19.         . xtabond y x,noco
  20.     (Demonstrate the expected better perfomance of the two-way Arellano-Bond estimator)

  21.         . tab tvar,gen(time)
  22.         . xtabond y x time*,noco
  23.     (Make the foregoing dataset unbalanced: the last 5 time observations are missing for
  24.     the first 50 individuals in the sample)
  25.         . xtarsim y x eta theta, n(200) t(10) g(.2) b(.8) r(.2) two(corr 5) sn(9) unbd(50
  26.             5) seed(1234)
  27.         . xtdes
  28.     For examples of xtarsim in Monte Carlo experiments download the do files dyn_bias.do
  29.     and static2way_bias.do. The former, upon setting up a dynamic one-way random effect
  30.     DGP, estimates the unconditional small-sample biases of the dynamic one-way fixed
  31.     effect and random effect estimators by 1000 Monte Carlo simulations. The latter sets up
  32.     a static two-way fixed effect DGP and estimates the unconditional small-sample biases
  33.     of the one-way and two-way fixed effect estimators using 1000 Monte Carlo simulations.
复制代码


3、参考



点击:STATA 蒙特卡洛模拟程序包









二维码

扫码加我 拉你入群

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

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

关键词:蒙特卡洛模拟程序包 蒙特卡洛模拟 Stata 蒙特卡洛 tata Stata 蒙特卡洛模拟程序包 Stata 蒙特卡洛模拟程序包 help xtarsim

已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
xddlovejiao1314 + 50 + 30 + 3 + 3 + 2 精彩帖子,期待类似分享

总评分: 经验 + 50  论坛币 + 30  学术水平 + 3  热心指数 + 3  信用等级 + 2   查看全部评分

本帖被以下文库推荐

沙发
xddlovejiao1314 学生认证  发表于 2015-4-10 10:08:17
亲,给你一些奖励。期待你类似的帖子分享到经管代码库来哦。谢谢分享。

藤椅
江左长苏 发表于 2017-11-14 16:00:11
好贵啊

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-2 17:36