library(tidyverse) library(likert) data(pisaitems) # selezioniamo una sola scala come esempio items24 <- pisaitems %>% select_at(vars(starts_with("ST24Q"))) # nomi degli items names(items24) <- c(ST24Q01="only if I have to", ST24Q02="one of my favorite hobbies", ST24Q03="like talking about b", ST24Q04="hard to finish b", ST24Q05="happy receving b as a present.", ST24Q06="a waste of time", ST24Q07="enjoy bookstore", ST24Q08="to get information", ST24Q09="cannot sit still and read", ST24Q10="like express opinions about b", ST24Q11="like exchange b") likert(items24) l24 <- likert(items24) str(l24) summary(l24) ## # qui non ha senso, perché le alternative sono solo 4 ## summary(l24, center = 2) summary(l24) %>% LabRS::kabbit(digits = 2, col.names = c("Item", "basso", "neutro", "alto", "media", "sd"), caption = "Statistiche riassuntive: output" ) plot(l24) # con colori e titolo col <- colorRampPalette(c("pink", "white", "blue"))(4) plot(l24, colors=col) + labs(title = "Reading Attitudes") plot(l24, type='heat', wrap=30, text.size=3.5) # variabile di raggruppamento l24g <- likert(items24, grouping=pisaitems$CNT) summary(l24g) %>% head() summary(l24g) %>% filter(Group == "Mexico") summary(l24g) %>% arrange(Group, desc(high)) %>% head() plot(l24g, group.order=c('Mexico', 'Canada', 'United States'))