简体   繁体   English

R: feglm 虚拟编码

[英]R: feglm dummy coding

I´m trying to run fixed effects regressions in R using the feglm command from the fixest package .我正在尝试使用 fixst package 中的feglm命令在R中运行固定效应回归。 The data contains three dummy variables: (1) variable z is 0, (2) variable z is between 1 and 8, and (3) variable z is larger than 8. I understand that it is necessary to drop one dummy to avoid collinearity.数据包含三个虚拟变量:(1)变量 z 为 0,(2)变量 z 在 1 和 8 之间,(3)变量 z 大于 8。我知道有必要删除一个虚拟变量以避免共线性. However, is this done by feglm or do I have to do it manually?但是,这是由 feglm 完成的还是我必须手动完成?

The question boils down to whether I have to include 2 or 3 dummies in my code.问题归结为我是否必须在我的代码中包含 2 个或 3 个虚拟对象。

The manual describes a feglm parameter collin.tol :该手册描述了feglm参数collin.tol

collin.tol Numeric scalar, default is 1e-10. collin.tol数值标量,默认为 1e-10。 Threshold deciding when variables should be considered collinear and subsequently removed from the estimation.决定何时应将变量视为共线并随后从估计中删除的阈值。 Higher values means more variables will be removed (if there is presence of collinearity).较高的值意味着将删除更多的变量(如果存在共线性)。 One signal of presence of collinearity is t-stats that are extremely low (for instance when t-stats < 1e-3).存在共线性的一个信号是 t 统计量极低(例如当 t 统计量 < 1e-3 时)。

... so you will have to increase collin.tol to make feglm drop variables for collinearity "on its own accord" (unless their respective t-statistic were indeed even smaller than the catch-all default 1e-10). ...因此您将不得不增加collin.tol以使feglm删除共线性的变量“自行决定”(除非它们各自的t 统计量确实比包罗万象的默认值1e-10 更小)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM