楼主: oldbridge
8389 7

[作图问题求助] 如何用stata画交互效应图-50币求助 [推广有奖]

  • 3关注
  • 5粉丝

已卖:265份资源

讲师

36%

还不是VIP/贵宾

-

威望
0
论坛币
4859 个
通用积分
10.0701
学术水平
6 点
热心指数
5 点
信用等级
5 点
经验
15065 点
帖子
213
精华
0
在线时间
716 小时
注册时间
2007-5-25
最后登录
2024-12-9

楼主
oldbridge 发表于 2015-3-23 21:30:01 |AI写论文
50论坛币
如何利用stata,画出y=x1+x2+x1*x2+控制变量 其中X1 的取值为0,1,2,3四个取值,x2是0,1变量,如何利用stata画出交互效应图。另外,需要把y 和x在图中表明含义及刻度,另外需要帮我把两条线区分,诸如一条线是实线条,一条线是虚线条,请高手给do文件,谢谢

最佳答案

hplcdadong 查看完整内容

The following example is very similar to what you described and you might get a good clue from it: Good luck
关键词:Stata 交互效应 tata 如何用 do文件 如何

回帖推荐

hplcdadong 发表于2楼  查看完整内容

The following example is very similar to what you described and you might get a good clue from it: Good luck

沙发
hplcdadong 发表于 2015-3-23 21:30:02
The following example is very similar to what you described and you might get a good clue from it:

  1. webuse nhanes2, clear
  2. regress bpsystol i.agegrp i.sex  agegrp#sex
  3. margins agegrp#sex
  4. marginsplot         //this should be what you want
复制代码


Good luck

藤椅
oldbridge 发表于 2015-3-25 20:40:18
hplcdadong 发表于 2015-3-24 10:09
The following example is very similar to what you described and you might get a good clue from it:
...
非常感谢回复,我尝试了一下,可以画出交互效应图,能否在帮我一下,如果我把graph图修改之后,如何能够粘贴到word里面呢?如果使用下面的程序我就修改不了图片了,我想修改一下图片的变量名称以及线条格式,谢谢
使用graph export 命令可以把生成的图片转换成上述指定格式,如
sysuse auto, clear
scatter price wei
graph export fig01.wmf, replace  /*.wmf格式的图片可以直接粘贴到Word文档中*/

板凳
oldbridge 发表于 2015-3-25 20:48:20
oldbridge 发表于 2015-3-25 20:40
非常感谢回复,我尝试了一下,可以画出交互效应图,能否在帮我一下,如果我把graph图修改之后,如何能够粘 ...
我会了,可以另存为其他格式的

报纸
oldbridge 发表于 2015-3-25 21:31:57
hplcdadong 发表于 2015-3-23 21:30
The following example is very similar to what you described and you might get a good clue from it:
...
高手,我做的交互效应图,两条线不是直线,而是一条折线图,能否变成一条拟合直线呢,谢谢

地板
hplcdadong 发表于 2015-3-26 05:55:33
Curves or straight lines depend on your regression model. Check the following linked article, which will definitely help.

https://www3.nd.edu/~rwilliam/stats2/l51.pdf

7
oldbridge 发表于 2015-3-26 15:41:33
hplcdadong 发表于 2015-3-26 05:55
Curves or straight lines depend on your regression model. Check the following linked article, which  ...
高手你好,按照要求,我得出的交互效应图是附件这样的
reg y  i.CEOpower_41 i.Compete  CEOpower_41#Compete
margins CEOpower_41#Compete
marginsplot
在这里面CEOpower_41 是一个0-4的离散变量,compete是一个0-1变量,另外,y是一个离散变量,
我想得出两条拟合直线图,请明示如何操作,盼复,谢谢

Graph.JPG (21.16 KB)

需要: 1 个论坛币  [购买]

reg y i.CEOpower_41 i.Compete CEOpower_41#Compete

8
蝶崖 发表于 2015-9-29 17:09:08
你好,我用了这些命令做交互项后,最后要形成图的时候就不行了,好像marginsplot 这个命令不能识别,请问要怎么解决?谢谢!

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

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