1

I've got 34 variables. One is a factor (continente) which has 4 levels and "PAT_ONCO" is one type of hospital patients. I want to group by continent but I can´t use summarize because continent doesn't have exactly 2 levels

kable(papeR::summarize(TELEMED_COVID_finales[, c( "continente", "PAT_ONCO")], format=  
"numeric", group="continente", test = TRUE)) %>%
  kable_classic(full_width = F, html_font = "Cambria")
Error in t.test.formula(formula = PAT_ONCO ~ continente, data =  
 list(continente = c(4L, : grouping factor must have exactly 2 levels
Progman
  • 16,827
  • 6
  • 33
  • 48
  • 1
    The problem seems to be that the function is trying to perform a t-test on your groups, however a t-test can only be performed on the difference between two groups (or the difference between a single group and 0). Setting test = FALSE will likely produce the table, but without a statistical test. – DMR Dec 20 '20 at 17:27
  • 1
    Can you share a sample of your data frame so the example is more reproducible? – vog Dec 20 '20 at 23:18

0 Answers0