4

I use the likert package to plot survey data.

require(likert)
data(pisaitems)

items24 <- pisaitems[,substr(names(pisaitems), 1,5) == 'ST24Q']

names(items24) <- c(
  ST24Q01="I read only if I have to.",
  ST24Q02="Reading is one of my favorite hobbies.",
  ST24Q03="I like talking about books with other people.",
  ST24Q04="I find it hard to finish books.",
  ST24Q05="I feel happy if I receive a book as a present.",
  ST24Q06="For me, reading is a waste of time.",
  ST24Q07="I enjoy going to a bookstore or a library.",
  ST24Q08="I read only to get information that I need.",
  ST24Q09="I cannot sit still and read for more than a few minutes.",
  ST24Q10="I like to express my opinions about books I have read.",
  ST24Q11="I like to exchange books with my friends.")

l24g <- likert(items24, grouping = pisaitems$CNT)
plot(l24g)

How can I reorder the grouping so that it shows the data in the same order as the data frame ("I read only if I have to." first an so on)?

Plot

OTStats
  • 1,820
  • 1
  • 13
  • 22
Hawk
  • 41
  • 1
  • 1
    You might already be following this example, but if not, it might be helpful: http://reganmian.net/blog/2013/10/02/likert-graphs-in-r-embedding-metadata-for-easier-plotting/ – Matt Apr 08 '20 at 16:10
  • 3
    actually `plot(l24g, group.order=names(items24))` should work, however, it does not. – captcoma Apr 08 '20 at 17:17
  • Yes, tried group.order=names(items24), but it does not work. It works when not grouping=pisaitems$CNT. – Hawk Apr 10 '20 at 12:03
  • 1
    Hi there, one year later and I have the same problem. Did you figure out how to deal with this issue? Thanks – Luis May 21 '21 at 15:24

0 Answers0