[英]Omit output of a factor variable in stargazer?
If I'm running a fixed effects model in r using lm and the factor command, how can I suppress the factor variable coefficients in a stargazer model?如果我使用 lm 和 factor 命令在 r 中运行固定效应 model,我如何抑制 stargazer model 中的因子可变系数?
ie my model is:即我的 model 是:
m1<-lm(GDP~pop_growth + factor(city))
and I want to report findings with only an intercept and coefficient on pop_growth, not coefficients on every dummy variable for cities.我想报告的结果只有 pop_growth 的截距和系数,而不是城市每个虚拟变量的系数。
EDIT: Issue was, as it turns out, with variable name encoding.编辑:事实证明,问题是变量名称编码。 omit="city" works.
省略=“城市”的作品。
As the author said there is an omit
option:正如作者所说,有一个
omit
选项:
library(stargazer)
model<-lm(mpg~disp+factor(cyl), data=mtcars)
stargazer(model, type="text", omit="cyl")
===============================================
Dependent variable:
---------------------------
mpg
-----------------------------------------------
disp -0.027**
(0.011)
Constant 29.535***
(1.427)
-----------------------------------------------
Observations 32
R2 0.784
Adjusted R2 0.760
Residual Std. Error 2.950 (df = 28)
F Statistic 33.807*** (df = 3; 28)
===============================================
Note: *p<0.1; **p<0.05; ***p<0.01
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.