我目前在 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
stargazer(LRGDPGrowthwOutliers, LRGDPGrowth, LRCPI, LRGDPDeflator,
LRUnemploymentwOutliers, LRUnemployment, LRBudgetwOutliers, LRBudget,
column.separate = c(2,1,1,2,2))
然而,现在的问题是,观星者似乎将三个不同的版本,例如,已开发(带有异常值的开发、没有预算平衡异常值的开发、没有增长异常值的开发)视为不同的变量,在表格中为它们创建了不同的行。有什么方法可以解决这个问题,还是我必须满足于删除异常排除?
谢谢!