I have been asked to report the descriptive statistics of my results in terms of IQR and median for my categorical variables but I do not know how I can do that! I know the logic but in continuous data.
Can anyone explain how to calculate that on categorical variables? And how to do it in R?
I am assuming you want to calculate median and IQR for variables grouped by a categorical variable. In base R, you can use aggregate for this. You can also look up tidyverse, which has the handy
group_byandsummarizefunctions.This has the output