问题
I want to do the shapiro-wilk test for my regressions. Here is my code
library(data.table)
Regresiones_shapirotest_1<-
data.table(tabla.Enero)[,
.(Lm = lapply(.SD, function(x) resid(lm(tabla.Enero$PPNA ~ x)))),
.SDcols = 15:93]
I can get the test values only in the console
Regresiones_shapirotest_1 [, lapply(Lm, shapiro.test)] [2]
write.xlsx (Regresiones_shapirotest_1 , file = "shapirotest.xlsx", sheetName = "Hoja1",
Col.names = TRUE, row.names = TRUE, append = FALSE)
But when I try to export them in an .xlsx file, it exports a lot of values that have nothing to do with console values. what am I doing wrong?
来源:https://stackoverflow.com/questions/61254073/how-can-i-get-the-shapiro-wilk-test