【現役医師】専門医資格取得について、どうお考えですか? 第2章at HOSP
【現役医師】専門医資格取得について、どうお考えですか? 第2章 - 暇つぶし2ch986:卵の名無しさん
18/12/23 11:33:35.17 9jfRvGpH.net
>>940
さっそく、やってみた。
> f=c(179,28,19,13,9,7,6,5,5,4,4,4,5,7,9,10,11,12,14,16,18,19,19,20,21,22,23,24,25,27,28,30,
+ 31,34,37,39,41,43,46,51,57,63,70,77,83,91,99,109,119,130,142,155,167,178,190,202,216,
+ 233,249,265,282,302,326,354,387,420,457,502,549,598,648,700,761,836,927,1026,1142,1284,
+ 1455,1651,1862,2089,2341,2625,2934,3264,3598,3923,4233,4508,4740,4893,4973,5007,4999,
+ 4729,4314,3797,3222,2634,2071,1566,1135,788,523,761)
> m=c(191,31,21,13,10,8,8,8,7,7,7,8,9,11,14,17,21,26,32,37,42,46,49,50,50,50,49,49,50,52,55,
+ 58,60,63,65,67,71,76,82,89,97,104,112,122,134,148,165,183,203,224,246,268,294,324,357,
+ 391,425,461,502,549,601,659,722,792,872,958,1052,1147,1239,1331,1433,1546,1663,1783,
+ 1905,2026,2167,2333,2532,2750,2973,3195,3414,3630,3827,4000,4133,4200,4194,4104,3916,
+ 3681,3388,3046,2669,2272,1875,1494,1145,841,589,392,246,144,79,71)
> LE <-function(ndx,Y,N0=10^5){ # life expectancy
+ n=length(ndx)
+ lx=numeric(n)
+ lx[1]=N0
+ for(i in 1:(n-1))
+ lx[i+1] <- lx[i] - ndx[i]
+ nqx=ndx/lx
+ nLx=numeric(n)
+ for(i in 1:n)
+ nLx[i] <- mean(c(lx[i],lx[i+1]))
+ nLx[n]=0
+ Tx=rev(cumsum(rev(nLx)))
+ le=Tx/lx
+ return(round(le[Y+1],1))
+ }
> LE(m,65)
[1] 19.6
> LE(m,61)
[1] 22.9
>


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch