各食習慣の人年の計算

人年の入力は,整数で四捨五入で入力してください.

setwd("~/Dropbox/JACC_study/saku_area") #in Mac
#setwd("C:/Users/Chaochen Wang/Dropbox/JACC_study/saku_area/") #in Windows

library(epicalc)
## Loading required package: foreign
## Loading required package: survival
## Loading required package: MASS
## Loading required package: nnet
load("Saku.Rdata")

#男性の場合

#Japanese-style breakfast  
tabpct(Saku001_men$BF_JAP, Saku001_men$Dead,
       graph = FALSE, decimal = 2)
## 
## Original table 
##                   Saku001_men$Dead
## Saku001_men$BF_JAP  FALSE   TRUE  Total
##              FALSE    775    331   1106
##              TRUE    6099   3347   9446
##              Total   6874   3678  10552
## 
## Row percent 
##                   Saku001_men$Dead
## Saku001_men$BF_JAP   FALSE    TRUE  Total
##              FALSE     775     331   1106
##                     (70.1)  (29.9)  (100)
##              TRUE     6099    3347   9446
##                     (64.6)  (35.4)  (100)
## 
## Column percent 
##                   Saku001_men$Dead
## Saku001_men$BF_JAP  FALSE        %  TRUE      %
##              FALSE    775  (11.27)   331    (9)
##              TRUE    6099  (88.73)  3347   (91)
##              Total   6874    (100)  3678  (100)
sum(Saku001_men$Person_years[Saku001_men$BF_JAP == TRUE], 
    na.rm = TRUE)#usually
## [1] 162862.2
sum(Saku001_men$Person_years[Saku001_men$BF_JAP == FALSE], 
    na.rm = TRUE)#not usually
## [1] 18470.57
#Western-style breakfast  
tabpct(Saku001_men$BF_WEST, Saku001_men$Dead,
       graph = FALSE, decimal = 2)
## 
## Original table 
##                    Saku001_men$Dead
## Saku001_men$BF_WEST  FALSE   TRUE  Total
##               FALSE   6162   3360   9522
##               TRUE     709    317   1026
##               Total   6871   3677  10548
## 
## Row percent 
##                    Saku001_men$Dead
## Saku001_men$BF_WEST   FALSE    TRUE  Total
##               FALSE    6162    3360   9522
##                      (64.7)  (35.3)  (100)
##               TRUE      709     317   1026
##                      (69.1)  (30.9)  (100)
## 
## Column percent 
##                    Saku001_men$Dead
## Saku001_men$BF_WEST  FALSE        %  TRUE        %
##               FALSE   6162  (89.68)  3360  (91.38)
##               TRUE     709  (10.32)   317   (8.62)
##               Total   6871    (100)  3677    (100)
sum(Saku001_men$Person_years[Saku001_men$BF_WEST == TRUE], 
    na.rm = TRUE)#usually
## [1] 17097.56
sum(Saku001_men$Person_years[Saku001_men$BF_WEST == FALSE], 
    na.rm = TRUE)#not usually
## [1] 164161.6
#Chagayu at breakfast  
tabpct(Saku001_men$BF_KAYU, Saku001_men$Dead,
       graph = FALSE, decimal = 2)
## 
## Original table 
##                    Saku001_men$Dead
## Saku001_men$BF_KAYU  FALSE   TRUE  Total
##               FALSE   6842   3642  10484
##               TRUE      29     35     64
##               Total   6871   3677  10548
## 
## Row percent 
##                    Saku001_men$Dead
## Saku001_men$BF_KAYU   FALSE    TRUE  Total
##               FALSE    6842    3642  10484
##                      (65.3)  (34.7)  (100)
##               TRUE       29      35     64
##                      (45.3)  (54.7)  (100)
## 
## Column percent 
##                    Saku001_men$Dead
## Saku001_men$BF_KAYU  FALSE        %  TRUE        %
##               FALSE   6842  (99.58)  3642  (99.05)
##               TRUE      29   (0.42)    35   (0.95)
##               Total   6871    (100)  3677    (100)
sum(Saku001_men$Person_years[Saku001_men$BF_KAYU == TRUE], 
    na.rm = TRUE)#usually
## [1] 905.6893
sum(Saku001_men$Person_years[Saku001_men$BF_KAYU == FALSE], 
    na.rm = TRUE)#not usually
## [1] 180353.5
#Other style breakfast  
tabpct(Saku001_men$BF_OTH, Saku001_men$Dead,
       graph = FALSE, decimal = 2)
## 
## Original table 
##                   Saku001_men$Dead
## Saku001_men$BF_OTH  FALSE   TRUE  Total
##              FALSE   6778   3589  10367
##              TRUE      93     88    181
##              Total   6871   3677  10548
## 
## Row percent 
##                   Saku001_men$Dead
## Saku001_men$BF_OTH   FALSE    TRUE  Total
##              FALSE    6778    3589  10367
##                     (65.4)  (34.6)  (100)
##              TRUE       93      88    181
##                     (51.4)  (48.6)  (100)
## 
## Column percent 
##                   Saku001_men$Dead
## Saku001_men$BF_OTH  FALSE        %  TRUE        %
##              FALSE   6778  (98.65)  3589  (97.61)
##              TRUE      93   (1.35)    88   (2.39)
##              Total   6871    (100)  3677    (100)
sum(Saku001_men$Person_years[Saku001_men$BF_OTH == TRUE], 
    na.rm = TRUE)#usually
## [1] 2824.26
sum(Saku001_men$Person_years[Saku001_men$BF_OTH == FALSE], 
    na.rm = TRUE)#not usually
## [1] 178435
#Cut breakfast
tabpct(Saku001_men$BF_NON, Saku001_men$Dead,
       graph = FALSE, decimal = 2)
## 
## Original table 
##                   Saku001_men$Dead
## Saku001_men$BF_NON  FALSE   TRUE  Total
##              FALSE   6627   3605  10232
##              TRUE     247     73    320
##              Total   6874   3678  10552
## 
## Row percent 
##                   Saku001_men$Dead
## Saku001_men$BF_NON   FALSE    TRUE  Total
##              FALSE    6627    3605  10232
##                     (64.8)  (35.2)  (100)
##              TRUE      247      73    320
##                     (77.2)  (22.8)  (100)
## 
## Column percent 
##                   Saku001_men$Dead
## Saku001_men$BF_NON  FALSE        %  TRUE        %
##              FALSE   6627  (96.41)  3605  (98.02)
##              TRUE     247   (3.59)    73   (1.98)
##              Total   6874    (100)  3678    (100)
sum(Saku001_men$Person_years[Saku001_men$BF_NON == 1], 
    na.rm = TRUE)#yes
## [1] 0
sum(Saku001_men$Person_years[Saku001_men$BF_NON == 2], 
    na.rm = TRUE)#no
## [1] 0
#Supper at ordinary time
tabpct(Saku001_men$SUP_TIM1, Saku001_men$Dead,
       graph = FALSE, decimal = 2)
## 
## Original table 
##                     Saku001_men$Dead
## Saku001_men$SUP_TIM1  FALSE   TRUE  Total
##                FALSE   1539    360   1899
##                TRUE    5273   3243   8516
##                Total   6812   3603  10415
## 
## Row percent 
##                     Saku001_men$Dead
## Saku001_men$SUP_TIM1   FALSE    TRUE  Total
##                FALSE    1539     360   1899
##                         (81)    (19)  (100)
##                TRUE     5273    3243   8516
##                       (61.9)  (38.1)  (100)
## 
## Column percent 
##                     Saku001_men$Dead
## Saku001_men$SUP_TIM1  FALSE        %  TRUE        %
##                FALSE   1539  (22.59)   360   (9.99)
##                TRUE    5273  (77.41)  3243  (90.01)
##                Total   6812    (100)  3603    (100)
sum(Saku001_men$Person_years[Saku001_men$SUP_TIM1 == TRUE], 
    na.rm = TRUE)#yes
## [1] 144764.4
sum(Saku001_men$Person_years[Saku001_men$SUP_TIM1 == FALSE], 
    na.rm = TRUE)#no
## [1] 34520.52
#女性の場合

#Japanese-style breakfast  
tabpct(Saku001_women$BF_JAP, Saku001_women$Dead,
       graph = FALSE, decimal = 2)
## 
## Original table 
##                     Saku001_women$Dead
## Saku001_women$BF_JAP  FALSE   TRUE  Total
##                FALSE   1000    259   1259
##                TRUE    8188   2717  10905
##                Total   9188   2976  12164
## 
## Row percent 
##                     Saku001_women$Dead
## Saku001_women$BF_JAP   FALSE    TRUE  Total
##                FALSE    1000     259   1259
##                       (79.4)  (20.6)  (100)
##                TRUE     8188    2717  10905
##                       (75.1)  (24.9)  (100)
## 
## Column percent 
##                     Saku001_women$Dead
## Saku001_women$BF_JAP  FALSE        %  TRUE       %
##                FALSE   1000  (10.88)   259   (8.7)
##                TRUE    8188  (89.12)  2717  (91.3)
##                Total   9188    (100)  2976   (100)
sum(Saku001_women$Person_years[Saku001_women$BF_JAP == TRUE], 
    na.rm = TRUE)#usually
## [1] 199613.9
sum(Saku001_women$Person_years[Saku001_women$BF_JAP == FALSE], 
    na.rm = TRUE)#not usually
## [1] 22382.08
#Western-style breakfast  
tabpct(Saku001_women$BF_WEST, Saku001_women$Dead,
       graph = FALSE, decimal = 2)
## 
## Original table 
##                      Saku001_women$Dead
## Saku001_women$BF_WEST  FALSE   TRUE  Total
##                 FALSE   8024   2703  10727
##                 TRUE    1161    273   1434
##                 Total   9185   2976  12161
## 
## Row percent 
##                      Saku001_women$Dead
## Saku001_women$BF_WEST   FALSE    TRUE  Total
##                 FALSE    8024    2703  10727
##                        (74.8)  (25.2)  (100)
##                 TRUE     1161     273   1434
##                          (81)    (19)  (100)
## 
## Column percent 
##                      Saku001_women$Dead
## Saku001_women$BF_WEST  FALSE        %  TRUE        %
##                 FALSE   8024  (87.36)  2703  (90.83)
##                 TRUE    1161  (12.64)   273   (9.17)
##                 Total   9185    (100)  2976    (100)
sum(Saku001_women$Person_years[Saku001_women$BF_WEST == TRUE], 
    na.rm = TRUE)#usually
## [1] 25661.36
sum(Saku001_women$Person_years[Saku001_women$BF_WEST == FALSE], 
    na.rm = TRUE)#not usually
## [1] 196271.5
#Chagayu at breakfast  
tabpct(Saku001_women$BF_KAYU, Saku001_women$Dead,
       graph = FALSE, decimal = 2)
## 
## Original table 
##                      Saku001_women$Dead
## Saku001_women$BF_KAYU  FALSE   TRUE  Total
##                 FALSE   9146   2955  12101
##                 TRUE      39     21     60
##                 Total   9185   2976  12161
## 
## Row percent 
##                      Saku001_women$Dead
## Saku001_women$BF_KAYU   FALSE    TRUE  Total
##                 FALSE    9146    2955  12101
##                        (75.6)  (24.4)  (100)
##                 TRUE       39      21     60
##                          (65)    (35)  (100)
## 
## Column percent 
##                      Saku001_women$Dead
## Saku001_women$BF_KAYU  FALSE        %  TRUE        %
##                 FALSE   9146  (99.58)  2955  (99.29)
##                 TRUE      39   (0.42)    21   (0.71)
##                 Total   9185    (100)  2976    (100)
sum(Saku001_women$Person_years[Saku001_women$BF_KAYU == TRUE], 
    na.rm = TRUE)#usually
## [1] 991.0089
sum(Saku001_women$Person_years[Saku001_women$BF_KAYU == FALSE], 
    na.rm = TRUE)#not usually
## [1] 220941.9
#Other style breakfast  
tabpct(Saku001_women$BF_OTH, Saku001_women$Dead,
       graph = FALSE, decimal = 2)
## 
## Original table 
##                     Saku001_women$Dead
## Saku001_women$BF_OTH  FALSE   TRUE  Total
##                FALSE   9083   2907  11990
##                TRUE     102     69    171
##                Total   9185   2976  12161
## 
## Row percent 
##                     Saku001_women$Dead
## Saku001_women$BF_OTH   FALSE    TRUE  Total
##                FALSE    9083    2907  11990
##                       (75.8)  (24.2)  (100)
##                TRUE      102      69    171
##                       (59.6)  (40.4)  (100)
## 
## Column percent 
##                     Saku001_women$Dead
## Saku001_women$BF_OTH  FALSE        %  TRUE        %
##                FALSE   9083  (98.89)  2907  (97.68)
##                TRUE     102   (1.11)    69   (2.32)
##                Total   9185    (100)  2976    (100)
sum(Saku001_women$Person_years[Saku001_women$BF_OTH == TRUE], 
    na.rm = TRUE)#usually
## [1] 2829.802
sum(Saku001_women$Person_years[Saku001_women$BF_OTH == FALSE], 
    na.rm = TRUE)#not usually
## [1] 219103.1
#Cut breakfast
tabpct(Saku001_women$BF_NON, Saku001_women$Dead,
       graph = FALSE, decimal = 2)
## 
## Original table 
##                     Saku001_women$Dead
## Saku001_women$BF_NON  FALSE   TRUE  Total
##                FALSE   8917   2922  11839
##                TRUE     271     54    325
##                Total   9188   2976  12164
## 
## Row percent 
##                     Saku001_women$Dead
## Saku001_women$BF_NON   FALSE    TRUE  Total
##                FALSE    8917    2922  11839
##                       (75.3)  (24.7)  (100)
##                TRUE      271      54    325
##                       (83.4)  (16.6)  (100)
## 
## Column percent 
##                     Saku001_women$Dead
## Saku001_women$BF_NON  FALSE        %  TRUE        %
##                FALSE   8917  (97.05)  2922  (98.19)
##                TRUE     271   (2.95)    54   (1.81)
##                Total   9188    (100)  2976    (100)
sum(Saku001_women$Person_years[Saku001_women$BF_NON == TRUE], 
    na.rm = TRUE)#yes
## [1] 5976.753
sum(Saku001_women$Person_years[Saku001_women$BF_NON == FALSE], 
    na.rm = TRUE)#no
## [1] 216019.2
#Supper at ordinary time
tabpct(Saku001_women$SUP_TIM1, Saku001_women$Dead,
       graph = FALSE, decimal = 2)
## 
## Original table 
##                       Saku001_women$Dead
## Saku001_women$SUP_TIM1  FALSE   TRUE  Total
##                  FALSE    867    199   1066
##                  TRUE    8215   2690  10905
##                  Total   9082   2889  11971
## 
## Row percent 
##                       Saku001_women$Dead
## Saku001_women$SUP_TIM1   FALSE    TRUE  Total
##                  FALSE     867     199   1066
##                         (81.3)  (18.7)  (100)
##                  TRUE     8215    2690  10905
##                         (75.3)  (24.7)  (100)
## 
## Column percent 
##                       Saku001_women$Dead
## Saku001_women$SUP_TIM1  FALSE        %  TRUE        %
##                  FALSE    867   (9.55)   199   (6.89)
##                  TRUE    8215  (90.45)  2690  (93.11)
##                  Total   9082    (100)  2889    (100)
sum(Saku001_women$Person_years[Saku001_women$SUP_TIM1 == TRUE], 
    na.rm = TRUE)#yes
## [1] 199375.3
sum(Saku001_women$Person_years[Saku001_women$SUP_TIM1 == FALSE], 
    na.rm = TRUE)#no
## [1] 19684.23