I have data from Male(1) and Female(2) with responses on Likert Scale. I am trying to calculate the percentage for each one of them (ex. Male with response 1 out of all 226 respondents). Thus, the percentage would need to represent % out of all 226, so that I can see the percentage of each respondent.
The barplots are quite pretty, but I cannot turn the y scale into percentage (it is currently set on values).
This is my input:
barplot(table(Short$Gen,Short$optq18), beside=T, cex.names=0.7,
legend.text=c("Male", "Female"), args.legend=list(x=3.5,y=60,cex=0.8),
col=c("bisque1", "cyan4"),
xlab = "It is important to control monthly expenses",
ylab = "Percentage",
)
text(1.4,5, "0,44%", cex=0.6)
text(2.4,4, "0%", cex=0.6)
text(4.6,8.5, "2,21%", cex=0.6)
text(5.6,7, "1,76%", cex=0.6)
text(7.5,18, "6,63%", cex=0.6)
text(8.5,26.5, "10,17%", cex=0.6)
text(10.6,37, "15%", cex=0.6)
text(11.6,47.5, "19,4%", cex=0.6)
text(13.5,41, "16,8%", cex=0.6)
text(14.6,63, "17,43%", cex=0.6)
And the barplots:
And a sample from the data:
where Country has 3 levels, Gender has 2, optq has 5 (1,2,3,4,5) Likert scale