0
是否可以使用R「likert」包來繪製多個組的頻率數據?我有如下的數據:是否可以使用「likert」包來繪製多個組的頻率數據?
Years job_sector gender n freq
1 2000-2004 Academic institution Female 46 0.336
2 2000-2004 Academic institution Male 91 0.664
3 2000-2004 For-profit company Female 28 0.431
4 2000-2004 For-profit company Male 37 0.569
5 2000-2004 Government agency Female 15 0.441
6 2000-2004 Government agency Male 19 0.559
7 2000-2004 Independent/self-employed Female 1 0.500
8 2000-2004 Independent/self-employed Male 1 0.500
9 2000-2004 Non-profit organization Female 6 0.500
10 2000-2004 Non-profit organization Male 6 0.500
11 2000-2004 Unknown or Undecided Female 17 0.395
12 2000-2004 Unknown or Undecided Male 26 0.605
13 2005-2009 Academic institution Female 68 0.447
14 2005-2009 Academic institution Male 84 0.553
15 2005-2009 For-profit company Female 42 0.532
16 2005-2009 For-profit company Male 37 0.468
17 2005-2009 Government agency Female 22 0.500
18 2005-2009 Government agency Male 22 0.500
19 2005-2009 Independent/self-employed Female 1 1.000
20 2005-2009 Non-profit organization Female 11 0.688
21 2005-2009 Non-profit organization Male 5 0.312
22 2005-2009 Unknown or Undecided Female 8 0.296
23 2005-2009 Unknown or Undecided Male 19 0.704
24 2010-2014 Academic institution Female 63 0.485
25 2010-2014 Academic institution Male 67 0.515
26 2010-2014 For-profit company Female 45 0.562
27 2010-2014 For-profit company Male 35 0.438
28 2010-2014 Government agency Female 22 0.478
29 2010-2014 Government agency Male 24 0.522
30 2010-2014 Independent/self-employed Female 1 1.000
31 2010-2014 Non-profit organization Female 4 0.500
32 2010-2014 Non-profit organization Male 4 0.500
33 2010-2014 Unknown or Undecided Female 9 0.529
34 2010-2014 Unknown or Undecided Male 8 0.471
我想顯示在每個job_sector「男性」,「女性」的作爲李克特%的頻率。在每個工作崗位內,有3個組:「2000-2004」,「2005-2009」和「2010-2014」。
編輯(添加代碼):
我用下面的代碼來繪製堆積條形圖。但我想把它畫成「likert」的情節。但是從「likert」的例子來看,它只採用原始計數而不是彙總的頻率數據。
p <- ggplot(gendYrSect, aes(x=Years,y=freq,fill=gender)) + geom_bar(stat="identity") + facet_grid(job_sector ~ .)
p <- p + coord_flip()
p
你第一次嘗試什麼嗎?你能顯示你嘗試過的代碼嗎? – MrFlick