楼主: wshf666666
10864 4

[回归分析求助] 关于回归中加入年度虚拟变量 [推广有奖]

  • 5关注
  • 0粉丝

博士生

42%

还不是VIP/贵宾

-

威望
0
论坛币
22053 个
通用积分
29.8744
学术水平
3 点
热心指数
3 点
信用等级
0 点
经验
11372 点
帖子
129
精华
0
在线时间
348 小时
注册时间
2010-2-23
最后登录
2025-9-18

楼主
wshf666666 发表于 2015-7-28 16:39:17 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
比如我的数据中有year这个变量是2007——2014。请问以下两个回归得到的结果有什么区别?
①xi:reg y x1 x2 i.year
②reg y x1 x2 i.year
我看了一下,上面那个加入了08——14年的虚拟变量(08的虚拟变量处标注了“omitted”),下面的命令仅加入了09——14年的虚拟变量。但回归系数是一样的。请问上面两个命令方式的差别在哪?分别适用于什么情况?谢谢!
二维码

扫码加我 拉你入群

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

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

关键词:虚拟变量 omitted year 回归系数 ear 2014

沙发
chonghuihedong 发表于 2015-7-28 21:38:35
问题提得好,我也等待有人回答,自己好学习一下。

藤椅
夏目贵志 发表于 2015-7-29 00:43:18
大体上没啥区别

板凳
蓝色 发表于 2015-7-29 11:44:47
你查查help或者manual里面有详细介绍




Title


    [R] xi -- Interaction expansion




Syntax


        xi [, prefix(string) noomit] term(s)


        xi [, prefix(string) noomit] : any_stata_command varlist_with_terms ...


    where a term has the form


        i.varname                     or       I.varname
        i.varname1*i.varname2                  I.varname1*I.varname2
        i.varname1*varname3                    I.varname1*varname3
        i.varname1|varname3                    I.varname1|varname3


    varname, varname1, and varname2 denote numeric or string categorical variables.  varname3 denotes a
    continuous, numeric variable.




Menu


    Data > Create or change data > Other variable-creation commands > Interaction expansion



    +-----------------------------------------------------------------+
    | Most commands in Stata now allow factor variables; see          |
    | fvvarlist. To determine if a command allows factor variables,   |
    | see the information printed below the options table for the     |
    | command.  If the command allows factor variables, it will say   |
    | something like "indepvars may contain factor variables."        |
    |                                                                 |
    | We recommend that you use factor variables instead of xi if a   |
    | command allows factor variables.                                |
    |                                                                 |
    | We include [R] xi in our documentation so that readers can      |
    | consult it when using a Stata command that does not allow       |
    | factor variables.                                               |
    +-----------------------------------------------------------------+
页面提取自-r_页面_1.jpg 页面提取自-r_页面_2.jpg 页面提取自-u_页面_1.jpg 页面提取自-u_页面_2.jpg 页面提取自-u_页面_3.jpg 页面提取自-u_页面_4.jpg




页面提取自-u_页面_4.jpg (102.43 KB)

页面提取自-u_页面_4.jpg

页面提取自-u_页面_3.jpg (118.92 KB)

页面提取自-u_页面_3.jpg

页面提取自-u_页面_2.jpg (126.42 KB)

页面提取自-u_页面_2.jpg

页面提取自-u_页面_1.jpg (108.44 KB)

页面提取自-u_页面_1.jpg

页面提取自-r_页面_2.jpg (114.39 KB)

页面提取自-r_页面_2.jpg

页面提取自-r_页面_1.jpg (99.87 KB)

页面提取自-r_页面_1.jpg

页面提取自-u_页面_4.jpg (250.53 KB)

页面提取自-u_页面_4.jpg

页面提取自-u_页面_3.jpg (287.13 KB)

页面提取自-u_页面_3.jpg

页面提取自-u_页面_2.jpg (301.24 KB)

页面提取自-u_页面_2.jpg

页面提取自-u_页面_1.jpg (271.73 KB)

页面提取自-u_页面_1.jpg

页面提取自-r_页面_2.jpg (287.73 KB)

页面提取自-r_页面_2.jpg

页面提取自-r_页面_1.jpg (252.51 KB)

页面提取自-r_页面_1.jpg

已有 1 人评分经验 论坛币 热心指数 收起 理由
夏目贵志 + 20 + 10 + 5 真是辛苦了~~

总评分: 经验 + 20  论坛币 + 10  热心指数 + 5   查看全部评分

报纸
wshf666666 发表于 2015-8-3 08:49:54
蓝色 发表于 2015-7-29 11:44
你查查help或者manual里面有详细介绍
谢谢!看了一下,意思是不是说如果命令允许 factor variables,则直接用i.year这种用法,如果命令不允许就在命令前面加“Xi:”然后再在命令里面加“i.year”?请问这样理解对吗?

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-30 03:54