R Stargazer包离群控件创建新行

时间:2018-04-23 12:50:33

标签: r linear-regression stargazer controlling

我目前在R中运行多个线性回归,并希望使用Stargazer包进行汇总。在回归中,我将删除相应变量的异常值(例如,GDP增长的异常值,失业率的异常值等),以及对诸如发展水平之类的事物的控制。 对异常值的分析是通过箱线图进行的:

    outlier_val_GDPGrowth = boxplot.stats(data$GDPpCGrowth1991)$out

然后我运行多次回归,有无异常值:

    LRUnemploymentwOutliers = lm(unemployment_1991_2009 ~ degrees_consensus, data = data)
    LRUnemployment = lm(unemployment_1991_2009[!(data$unemployment_1991_2009 %in% outlier_val_Unemployment)] ~ degrees_consensus[!(data$unemployment_1991_2009 %in% outlier_val_Unemployment)] + developed[!(data$unemployment_1991_2009 %in% outlier_val_Unemployment)], data = data)
    LRBudgetwOutliers = lm(budget_balance_2003_2007 ~ degrees_consensus + developed, data = data)
    LRBudget = lm(budget_balance_2003_2007[!(data$budget_balance_2003_2007 %in% outlier_val_Budget)] ~ degrees_consensus[!(data$budget_balance_2003_2007 %in% outlier_val_Budget)] + developed[!(data$budget_balance_2003_2007 %in% outlier_val_Budget)], data = data)

之后,我运行了观星者

    stargazer(LRGDPGrowthwOutliers, LRGDPGrowth, LRCPI, LRGDPDeflator, 
    LRUnemploymentwOutliers, LRUnemployment, LRBudgetwOutliers, LRBudget, 
      column.separate = c(2,1,1,2,2))
然而,现在的问题是,观星者似乎看到了三个不同的版本,例如:开发(使用异常值开发,没有预算平衡异常值开发,没有增长异常值开发)作为不同的变量,在表格中为它们创建不同的行。 有没有办法解决这个问题,或者我是否满足于删除异常值排除?

谢谢!

0 个答案:

没有答案