在R中有一种方法可以在回归摘要中显示因变量的平均值
我一直在使用Stargazer显示线性回归结果(DID),但似乎没有一个命令可以让我找到回归的因变量的平均值 - 与R^2或类似的统计数据一起说。
我无法链接数据 - 但这是我想要此统计数据的一个示例。
mother_employ <- felm(paid_employment ~ treat + is_post + treated_group + age_dv + age_dv^2 + marital_status + educ_levels + nkids_dv + regions + white | year |0|pidp, subset = sex_dv == 2, data)
在下面,我使用Stargazer显示回归结果 - 我试图将“平均值”放在stat Call而没有结果的情况下,
stargazer(employ_mother, title = "Mother Employment",
font.size = "small",
align = TRUE,
column.sep.width = "-15pt",keep.stat = c("adj.rsq","n"), keep = c("treat","is_post","treated_group","age_dv","age_dv^2","nkids_dv","white"), notes = "This Table Exludes Marital Status, Education Level, and Regions Covariates", type = "text")
我的输出就是这样:
Mother Employ
========================================================================================
Dependent variable:
--------------------------------------------------------------------------
paid_employment
----------------------------------------------------------------------------------------
treat 0.082***
(0.013)
is_post1 0.011
(0.012)
treated_group -0.352***
(0.010)
age_dv 0.008***
(0.0004)
nkids_dv -0.061***
(0.004)
white 0.168***
(0.010)
----------------------------------------------------------------------------------------
Observations 51,528
Adjusted R2 0.237
========================================================================================
Note: *p<0.1; **p<0.05; ***p<0.01
This Table Exludes Marital Status, Education Level, and Regions Covariates
>
我想用r^2显示因变量的平均值吗?
I've been using stargazer to display linear regression results (DID) specifically but there doesn't seem to be a command to allow me to find the mean of the dependent variable of the regression - say along with R^2 or a similar statistic.
I can't link the data - but here's one example of where I would like this stat.
mother_employ <- felm(paid_employment ~ treat + is_post + treated_group + age_dv + age_dv^2 + marital_status + educ_levels + nkids_dv + regions + white | year |0|pidp, subset = sex_dv == 2, data)
Below I display the regression results using stargazer - I've tried to put "mean" in the keep stat call without results
stargazer(employ_mother, title = "Mother Employment",
font.size = "small",
align = TRUE,
column.sep.width = "-15pt",keep.stat = c("adj.rsq","n"), keep = c("treat","is_post","treated_group","age_dv","age_dv^2","nkids_dv","white"), notes = "This Table Exludes Marital Status, Education Level, and Regions Covariates", type = "text")
My output is such:
Mother Employ
========================================================================================
Dependent variable:
--------------------------------------------------------------------------
paid_employment
----------------------------------------------------------------------------------------
treat 0.082***
(0.013)
is_post1 0.011
(0.012)
treated_group -0.352***
(0.010)
age_dv 0.008***
(0.0004)
nkids_dv -0.061***
(0.004)
white 0.168***
(0.010)
----------------------------------------------------------------------------------------
Observations 51,528
Adjusted R2 0.237
========================================================================================
Note: *p<0.1; **p<0.05; ***p<0.01
This Table Exludes Marital Status, Education Level, and Regions Covariates
>
I want to display the mean of the dependent variable with R^2 is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
stargazer()
的add -line参数可以使用。或者,如果我们
只需要在可以使用的回归中使用的值。
代替
平均值(mtcars $ mpg)
This is possible using the add.lines argument of
stargazer()
.Gives us
Alternatively, if we only want values that are used in the regression we can use.
In place of
mean(mtcars$mpg)