全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
10777 4
2015-07-28
比如我的数据中有year这个变量是2007——2014。请问以下两个回归得到的结果有什么区别?
①xi:reg y x1 x2 i.year
②reg y x1 x2 i.year
我看了一下,上面那个加入了08——14年的虚拟变量(08的虚拟变量处标注了“omitted”),下面的命令仅加入了09——14年的虚拟变量。但回归系数是一样的。请问上面两个命令方式的差别在哪?分别适用于什么情况?谢谢!
二维码

扫码加我 拉你入群

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

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

全部回复
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

二维码

扫码加我 拉你入群

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

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

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

扫码加我 拉你入群

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

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

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

说点什么

分享

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