全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
3252 4
2018-03-08
请问各位大神,我想用stata里的oaxaca对固定效应模型做分解,研究性别工资差,代码如下:
oaxaca wage , by(male) omega, model1(xtreg 各种自变量, fe) model2(xtreg 各种自变量, fe)
但是stata显示 model1 invalid,是怎么回事呢?
我看了help oaxaca 里写
model1(model_opts) and model2(model_opts) specify the estimation details for the two group models. The syntax for model_opts is
[estcom] [, store(name) addrhs(spec) estcom_options ]
where estcom is the estimation command to be used and estcom_options are options allowed by estcom. store(name) saves the model's estimation results under name using estimates store. addrhs(spec) adds spec to the "right-hand side" of the model. For example, use addrhs() to add extra variables to the model.
这里的 model_opts 应该怎么理解呀?
谢谢大家
二维码

扫码加我 拉你入群

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

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

全部回复
2018-3-8 07:48:35
既然看help了
omega  后面谁说有  逗号的?
二维码

扫码加我 拉你入群

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

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

2018-3-8 19:06:10
蓝色 发表于 2018-3-8 07:48
既然看help了
omega  后面谁说有  逗号的?
非常感谢!
我把逗号去掉以后重新作一次回归,显示xtreg is not supported by suest,是说stata的oaxaca指令不支持固定效应模型的意思吗?
二维码

扫码加我 拉你入群

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

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

2018-3-9 08:34:09
Lorraine1012 发表于 2018-3-8 19:06
非常感谢!
我把逗号去掉以后重新作一次回归,显示xtreg is not supported by suest,是说stata的oaxaca ...
应该是那个意思
二维码

扫码加我 拉你入群

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

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

2024-5-27 10:24:19
你好!根据你的问题,你在使用stata的oaxaca命令时遇到了问题。`model1` 和 `model2` 需要指定具体的估计命令,而你直接使用了xtreg后面跟着各种自变量,这是不正确的语法。

按照oaxaca的帮助文档,你应该这样写:

```stata
oaxaca wage, by(male) omega model1(estcom [varlist], fe) model2(estcom [varlist], fe)
```

在这里,`estcom` 是你需要估计的命令,`[varlist]` 是你的自变量列表。你需要将 `[varlist]` 替换为你的具体自变量,例如 `edu experience` 等。

但是,根据oaxaca的使用说明,你还需要指定模型1和模型2的区别。如果你在两个模型中使用的自变量相同,那么这个命令可能无法正确运行。你应该至少在一个模型中加入或移除一个变量来比较性别工资差距。

例如,如果在模型1中只考虑基本教育水平:

```stata
oaxaca wage, by(male) omega model1(estcom edu, fe) model2(estcom edu i.experience, fe)
```

这里,模型1仅包含edu,而模型2添加了交互项 `i.experience`。

请尝试上述代码,并根据你的数据集调整自变量。如果仍然有错误或不清楚的地方,欢迎再次提问!

此文本由CAIE学术大模型生成,添加下方二维码,优先体验功能试用



二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群