How to sort by frequency the result of 'tableby' when you have many variables?

Viewed 15
Hospital<-c("AA","BB","BB","CC","BB",
            "AA", "CC", "BB", "CC", "DD")
`Disease stage`<-c("3","2","2","3","2","1","2","3","2","2")
Location<-c("B","A","B","A","C","B","B","B","C","A")

mydata<-data.frame(Hospital,`Disease stage`,Location)

library(arsenal)

out2<-summary(tableby(~.,data=mydata))

I would like to order the frequencies in descending order, using the function tableby of the package arsenal . I had asked a similar question with another function: CreateTableone in previuous post Link. It is possible to sort the results with the latter where the output of the function remains a list. The output of tableby is also organized as a list but structured differently. I can't access the frequency in numerical form by variable at all in order to be able to sort them. Is it possible to sort the frequencies of the output of tableby? I decide to use the function tableby since it best suits my analysis project

Translated with www.DeepL.com/Translator (free version)

0 Answers
Related