How can i get the shapiro-wilk test

狂风中的少年 提交于 2020-04-18 01:11:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!