Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mistaken percentage position? #94

Open
Mohdkhalil opened this issue Sep 14, 2018 · 1 comment
Open

Mistaken percentage position? #94

Mohdkhalil opened this issue Sep 14, 2018 · 1 comment

Comments

@Mohdkhalil
Copy link

Mohdkhalil commented Sep 14, 2018

Hi,

First of all, thank you for the Likert package!
At the moment I face an issue where the questionnaire has 'not sure' as an answer. While I made this answer to appear as a gray color and as the last option in the plot, the calculation of percentage is not working correctly. So i want to exclude the 'not sure' from the calculation. the second issue, the percentages should be flipped, they are shown reversed.

My code:

require(likert)

items2_$Q2_1 <- factor(items2_$Q2_1, levels = c('Not at all acceptable', 'A little acceptable', 'Quite acceptable', 'Very acceptable', 'Not sure'), ordered = T)
items2_$Q2_2 <- factor(items2_$Q2_2, levels = c('Not at all acceptable', 'A little acceptable', 'Quite acceptable', 'Very acceptable', 'Not sure'), ordered = T)
items2_$Q2_3 <- factor(items2_$Q2_3, levels = c('Not at all acceptable', 'A little acceptable', 'Quite acceptable', 'Very acceptable', 'Not sure'), ordered = T)
items2_$Q2_4 <- factor(items2_$Q2_4, levels = c('Not at all acceptable', 'A little acceptable', 'Quite acceptable', 'Very acceptable', 'Not sure'), ordered = T)
items2_$Q2_5 <- factor(items2_$Q2_5, levels = c('Not at all acceptable', 'A little acceptable', 'Quite acceptable', 'Very acceptable', 'Not sure'), ordered = T)      

l2g_ <- likert(items2_, grouping = survey2$OccStatus)

plot(l2g_, centered = F, text.size = 3, colors=c('lemonchiffon2','lemonchiffon3','cadetblue3','cadetblue', 'gray78')) + 
                      theme(axis.title.x = element_text(size=16),
                            axis.text.x = element_text(size=10),
                            axis.text.y = element_text(size=7),
                            strip.text=element_text(size=8))

Result:
stackover

I wish to make something similar to this (where the important is calculated based on very important and somewhat important, and not important is calculated based on the other two options; the Don't know is excluded from calculation):
pew

But the most important thing is the swapped percentage issue and how to exclude 'not sure' from the percentage calculation even though keeping it shown in the plot.

Thank you.

@ocaoimh
Copy link

ocaoimh commented Jul 12, 2021

Hi @Mohdkhalil, I was having a hard time ordering the levels in a grouped plot. Thanks to your neat ordering solution, it worked! Thanks so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants