Presentation is loading. Please wait.

Presentation is loading. Please wait.

全民健康保險保險對象人數按類別性別年齡層

Similar presentations


Presentation on theme: "全民健康保險保險對象人數按類別性別年齡層"— Presentation transcript:

1 全民健康保險保險對象人數按類別性別年齡層
數位長期照護實務學習與實作課程 全民健康保險保險對象人數按類別性別年齡層 高服三甲 余修誼 高服三甲 李欣頻 產設三甲 李宣諺 產設三甲高偉銘

2 目錄 資料概述 03 R程式 01 04 02 敘述統計分析 小組心得

3 1 資料概述 Part 01

4 01 本資料來源:政府開放資料平台 資料集名稱:全民健康保險保險對象人數按類別性別年齡層統計
資料集描述: 全民健康保險保險對象人數按類別性別年齡層統計 主要欄位說明:  年月:年月,為數值資料,範圍201703~201806,每一季為一單位。 投保類目:分為五類投保類別,為類別資料。 性別:性別,分男性與女性,為類別資料。 年齡層:每五歲為一個區間,共17個區間,為類別資料。 投保人數:投保的人數,為數值資料。 被保險人數:被保險的人數,為數值資料。 眷屬人數:眷屬人數,為數值資料。 無遺失值

5 2 敘述統計分析 Part 02

6 02 投保人數性別比例

7 02

8 02

9 02

10 02

11 02

12 02

13 02

14 02

15 02

16 02

17 3 R程式 Part 03

18 03 合併檔案 cancert <- NULL for (i in 1:6){
x <- paste("~/taiwan/taiwan",i,".csv",sep="") y <- read.csv(x, header = TRUE, sep =",",fileEncoding = 'UTF-8',colClasses = c("integer", "factor", "factor","factor", "integer", "integer")) cancert <- rbind(cancert,y) }

19 03 分析投保人數性別比例 (female<- sum(cancert$投保人數[cancert$性別 == "女"]))
xtabs(投保人數~性別, cancert) (per_s <- round(prop.table(xtabs(投保人數~性別, cancert))*100,2)) barplot(per_s, main = "201703~201806投保人數性別比例", xlab = "性別", ylab = "百分比", ylim = c(0,70),col=rainbow(2))

20 03 分析投保人數年齡層比例 (taiwan<-xtabs(投保人數~年齡層, cancert)) names(taiwan)
(per_s <- round(prop.table(xtabs(投保人數~年齡層, cancert))*100,2)) barplot(per_s, main = "201703~201806投保人數年齡層比例", xlab = "", ylab = "百分比", ylim = c(0,10),las=2,col=rainbow(17))

21 03 分析年齡層投保人數 ggplot(abc, aes(reorder(年齡層,-投保人數), 投保人數)) +
geom_bar(stat="identity")+ ggtitle('201703~201806年齡層投保人數')+ theme(plot.title = element_text(hjust = 0.5,size = 20, face = "bold",colour='red'))+ theme(axis.text.x = element_text(angle = -90,vjust=0,hjust=1,colour='blue'))+ theme(axis.text.y = element_text(vjust=0.5,hjust=1,colour='green'))+ labs(x='年齡層',y='投保人數')+ theme(axis.title.x = element_text(face = "italic", color = "rosybrown"))+ theme(axis.title.y = element_text(face = "bold.italic", color = "royalblue"))

22 03 分析年齡層投保人數比例 ggplot(abc, aes(reorder(年齡層,-投保人數/sum(投保人數)), (投保人數/sum(投保人數)) * 100 )) + geom_bar(stat="identity", fill= 'indianred4')+ theme(axis.text.x = element_text(angle = -90,vjust=0,hjust=1))+ ggtitle('201703~201806年齡層投保人數比例')+ theme(plot.title = element_text(hjust = 0.5,size = 20, face = "bold",colour='navyblue'))+ labs(x='年齡層',y='百分比')+ theme(axis.text.y = element_text(vjust=0.5,hjust=1,colour='orangered4'))+ theme(axis.title.x = element_text(face = "italic", color = "rosybrown"))+ theme(axis.title.y = element_text(face = "bold.italic", color = "royalblue"))

23 03 男女投保人數曲線圖 plot(year.city$男,type='b',xaxt='n',xlab = '年月',ylab='投保人數',pch=15,ylim =c( , )) axis(side=1,at=1:nrow(year.city),labels = year.city$年月) lines(1:nrow(year.city),type='b',year.city$女, col="red",pch=20) legend(1, ,c("男","女"), col=c("black","red"), pch=c(15,20), lwd=c(1,1))

24 03 分析年齡層被保險人數比例 ggplot(abb, aes(reorder(年齡層,-被保險人數/sum(被保險人數)), (被保險人數/sum(被保險人數)) * 100 )) + geom_bar(stat="identity", fill= 'indianred4')+ theme(axis.text.x = element_text(angle = -90,vjust=0,hjust=1))+ ggtitle('201703~201806年齡層被保險人數比例')+ theme(plot.title = element_text(hjust = 0.5,size = 20, face = "bold",colour='navyblue'))+ labs(x='年齡層',y='百分比')+ theme(axis.text.y = element_text(vjust=0.5,hjust=1,colour='orangered4'))+ theme(axis.title.x = element_text(face = "italic", color = "rosybrown"))+ theme(axis.title.y = element_text(face = "bold.italic", color = "royalblue"))

25 03 分析被保險人數性別比例 (per_s <- round(prop.table(xtabs(被保險人數~性別, cancert))*100,2)) barplot(per_s, main = "201703~201806被保險人數性別比例", xlab = "性別", ylab = "百分比", ylim = c(0,70),col=rainbow(4))

26 03 性別投保人數趨勢 g.year.city<-aggregate(投保人數~年月+性別,cancert,sum)
install.packages('zoo') library(zoo) g.year.city$年月 <- as.yearqtr(paste(g.year.city$年月,'01',sep=''),format = "%Y%m%d") ggplot(data=g.year.city,aes(年月,投保人數,colour=性別))+ geom_line()+ geom_point()+ labs(title='201703~201806投保人數',x='年月',y='人數')+ theme(plot.title = element_text(colour = "black", face = "bold",size = 16, hjust = 0.5))+ scale_color_manual(values=rainbow(nlevels(factor(g.year.city$性別))))+ scale_color_discrete(name = "性別")

27 03 各年齡層投保人數趨勢 ggg<-aggregate(投保人數~年月+年齡層,cancert,sum) library(zoo)
ggg$年月 <- as.yearqtr(paste(ggg$年月,'01',sep=''),format = "%Y%m%d") ggplot(data=ggg,aes(年月,投保人數,colour=年齡層))+ geom_line()+ geom_point()+ labs(title='201703~201806各年齡層投保人數',x='年月',y='人數')+ theme(plot.title = element_text(colour = "black", face = "bold",size = 16, hjust = 0.5))+ scale_color_manual(values=rainbow(nlevels(factor(ggg$年齡層))))+ scale_color_discrete(name = "年齡層")

28 03 性別投保人數百分比圖 pie(xtabs(投保人數~性別, cancert),main='性別投保人數百分比圖',col=c('royalblue3','palevioletred'))

29 03 各年齡層投保人數百分比圖 pie(taiwan,main = '各年齡層投保人數百分比圖',col=rainbow(17))

30 4 小組心得 Part 04

31 04 小組心得 我們是第一次摸到R程式,是很新奇又很陌生,一堆密密麻麻的文字,竟然可以分析這麼多的資料,真的是非常神奇,但對我們第一次學習者來說要做出期中報告是滿困難的,從一開始甚麼都不會,然後慢慢摸索,跟老師約時間做討論,到現在做出來這個完整的報告出來,是非常有成就感的。很謝謝老師撥空出時間,能跟我們做討論,有細心也很有耐心的教會我們,辛苦老師了也謝謝老師。

32 謝謝聆聽 . . .


Download ppt "全民健康保險保險對象人數按類別性別年齡層"

Similar presentations


Ads by Google