library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
# function
func_Skel_Age <- function(sk.age, gender, fracture, thres_age){
qx = c( 2.059, 0.175, 0.204, 0.033, 0.064, 0.032, 0.096, 0.094, 0.000, 0.000, 0.000, 0.000, 0.060, 0.151, 0.153, 0.185, 0.369, 0.437, 0.589, 0.445, 0.577, 0.579, 0.317, 0.476, 0.441, 0.713, 0.895, 0.477, 0.543, 0.611, 0.507, 0.638, 0.572, 0.740, 0.849, 0.620, 0.840, 0.729, 0.960, 0.771, 0.906, 1.306, 1.020, 1.419, 1.055, 1.160, 1.448, 1.782, 1.712, 2.112, 1.873, 2.174, 2.949, 2.198, 2.617, 3.138, 4.276, 4.323, 4.333, 5.031, 5.880, 5.611, 6.368, 7.896, 7.888, 8.288, 11.187, 12.640, 12.769, 13.729, 15.648, 16.632, 18.592, 20.907, 24.536, 27.730, 28.554, 30.961, 36.073, 41.158, 47.602, 51.960, 61.761, 66.589, 78.630, 92.359, 100.496, 112.117, 128.829, 151.725, 162.987, 179.113, 204.320, 222.943, 235.269, 245.015, 294.884, 340.168, 345.695, 350.626, 364.807, 350.383, 338.862, 283.469, 550.671, 435.282, 1000.000)
age = 0:106
fx_hr = sk.age$est[sk.age$sex == gender & sk.age$fx == fracture]
Lx1 = qx
lx1 = qx
Tx1 = qx
Ex1 = qx
Lx2 = qx
lx2 = qx
Tx2 = qx
Ex2 = qx
length = length(qx)-1
Lx1[1] = 100000
Lx1[length+1] = NA
Tx1[length+1] = NA
Ex1[length+1] = NA
Lx2[1] = 100000
Lx2[length+1] = NA
Tx2[length+1] = NA
Ex2[length+1] = NA
for (x in 2:length) {
Lx1[x] = Lx1[x-1]*(1-(qx[x-1]*1.00)/1000)
Lx2[x] = Lx2[x-1]*(1-(qx[x-1]*fx_hr)/1000)
}
lx1 = (Lx1 + lead(Lx1))/2
lx1[length] = 0
lx1[length+1] = NA
lx2 = (Lx2 + lead(Lx2))/2
lx2[length] = 0
lx2[length+1] = NA
for (x in 1:length) {
Tx1[x] = sum(lx1[x:length])
Tx2[x] = sum(lx2[x:length])
}
Ex1 = Tx1 / Lx1
Ex2 = Tx2 / Lx2
Lx1 = round(Lx1)
lx1 = round(lx1)
Tx1 = round(Tx1)
Ex1 = round(Ex1,1)
Lx2 = round(Lx2)
lx2 = round(lx2)
Tx2 = round(Tx2)
Ex2 = round(Ex2,1)
Diff = Ex1- Ex2
Skel.Age = age+Diff
print(Skel.Age)
df = data.frame(age, qx, Ex1, Ex2, Diff, Skel.Age)
df$fx = fracture
skage = subset(df, age>thres_age, select = c(age, fx, Skel.Age))
skage
}
sk.age = read.csv("C:\\Garvan\\Skeletal age\\Analysis\\Skeletal_age.csv")
any_fx_men = func_Skel_Age(sk.age, "Men", "Any fracture",49)
## [1] 5.0 5.9 6.9 7.9 8.9 9.9 10.9 11.9 12.9 13.9 14.9 15.9
## [13] 16.9 17.9 18.9 19.8 20.8 21.9 22.8 23.8 24.8 25.8 26.7 27.7
## [25] 28.8 29.7 30.7 31.7 32.7 33.6 34.7 35.6 36.6 37.6 38.6 39.5
## [37] 40.6 41.5 42.5 43.5 44.5 45.5 46.4 47.4 48.4 49.3 50.3 51.3
## [49] 52.3 53.3 54.2 55.2 56.2 57.2 58.1 59.1 60.0 61.0 61.9 62.9
## [61] 63.8 64.8 65.7 66.6 67.6 68.6 69.5 70.4 71.4 72.3 73.2 74.1
## [73] 75.1 75.9 76.9 77.8 78.7 79.6 80.5 81.5 82.3 83.3 84.2 85.0
## [85] 86.0 86.9 87.8 88.7 89.6 90.6 91.5 92.4 93.4 94.3 95.2 96.2
## [97] 97.1 98.0 99.0 100.0 100.9 101.8 102.5 103.3 104.2 105.0 NA
any_fx_men
## age fx Skel.Age
## 51 50 Any fracture 54.2
## 52 51 Any fracture 55.2
## 53 52 Any fracture 56.2
## 54 53 Any fracture 57.2
## 55 54 Any fracture 58.1
## 56 55 Any fracture 59.1
## 57 56 Any fracture 60.0
## 58 57 Any fracture 61.0
## 59 58 Any fracture 61.9
## 60 59 Any fracture 62.9
## 61 60 Any fracture 63.8
## 62 61 Any fracture 64.8
## 63 62 Any fracture 65.7
## 64 63 Any fracture 66.6
## 65 64 Any fracture 67.6
## 66 65 Any fracture 68.6
## 67 66 Any fracture 69.5
## 68 67 Any fracture 70.4
## 69 68 Any fracture 71.4
## 70 69 Any fracture 72.3
## 71 70 Any fracture 73.2
## 72 71 Any fracture 74.1
## 73 72 Any fracture 75.1
## 74 73 Any fracture 75.9
## 75 74 Any fracture 76.9
## 76 75 Any fracture 77.8
## 77 76 Any fracture 78.7
## 78 77 Any fracture 79.6
## 79 78 Any fracture 80.5
## 80 79 Any fracture 81.5
## 81 80 Any fracture 82.3
## 82 81 Any fracture 83.3
## 83 82 Any fracture 84.2
## 84 83 Any fracture 85.0
## 85 84 Any fracture 86.0
## 86 85 Any fracture 86.9
## 87 86 Any fracture 87.8
## 88 87 Any fracture 88.7
## 89 88 Any fracture 89.6
## 90 89 Any fracture 90.6
## 91 90 Any fracture 91.5
## 92 91 Any fracture 92.4
## 93 92 Any fracture 93.4
## 94 93 Any fracture 94.3
## 95 94 Any fracture 95.2
## 96 95 Any fracture 96.2
## 97 96 Any fracture 97.1
## 98 97 Any fracture 98.0
## 99 98 Any fracture 99.0
## 100 99 Any fracture 100.0
## 101 100 Any fracture 100.9
## 102 101 Any fracture 101.8
## 103 102 Any fracture 102.5
## 104 103 Any fracture 103.3
## 105 104 Any fracture 104.2
## 106 105 Any fracture 105.0
## 107 106 Any fracture NA
hip_fx_men = func_Skel_Age(sk.age, "Men", "Hip", 49)
## [1] 8.3 9.0 10.1 11.1 12.1 13.1 14.1 15.1 16.0 17.0 18.0 19.0
## [13] 20.0 21.0 22.0 23.0 24.0 25.0 26.0 26.9 27.9 28.9 29.8 30.8
## [25] 31.8 32.7 33.7 34.7 35.6 36.6 37.6 38.5 39.5 40.5 41.5 42.4
## [37] 43.4 44.4 45.3 46.3 47.2 48.3 49.2 50.1 51.1 52.0 53.0 53.9
## [49] 54.9 55.9 56.8 57.8 58.8 59.7 60.6 61.5 62.5 63.4 64.3 65.2
## [61] 66.1 67.1 67.9 68.8 69.7 70.7 71.5 72.4 73.3 74.2 75.0 75.8
## [73] 76.8 77.6 78.5 79.3 80.2 81.1 81.9 82.8 83.6 84.5 85.3 86.1
## [85] 87.0 87.8 88.7 89.5 90.4 91.3 92.2 93.0 94.0 94.8 95.7 96.7
## [97] 97.6 98.5 99.4 100.5 101.4 102.2 102.9 103.6 104.3 105.0 NA
hip_fx_men
## age fx Skel.Age
## 51 50 Hip 56.8
## 52 51 Hip 57.8
## 53 52 Hip 58.8
## 54 53 Hip 59.7
## 55 54 Hip 60.6
## 56 55 Hip 61.5
## 57 56 Hip 62.5
## 58 57 Hip 63.4
## 59 58 Hip 64.3
## 60 59 Hip 65.2
## 61 60 Hip 66.1
## 62 61 Hip 67.1
## 63 62 Hip 67.9
## 64 63 Hip 68.8
## 65 64 Hip 69.7
## 66 65 Hip 70.7
## 67 66 Hip 71.5
## 68 67 Hip 72.4
## 69 68 Hip 73.3
## 70 69 Hip 74.2
## 71 70 Hip 75.0
## 72 71 Hip 75.8
## 73 72 Hip 76.8
## 74 73 Hip 77.6
## 75 74 Hip 78.5
## 76 75 Hip 79.3
## 77 76 Hip 80.2
## 78 77 Hip 81.1
## 79 78 Hip 81.9
## 80 79 Hip 82.8
## 81 80 Hip 83.6
## 82 81 Hip 84.5
## 83 82 Hip 85.3
## 84 83 Hip 86.1
## 85 84 Hip 87.0
## 86 85 Hip 87.8
## 87 86 Hip 88.7
## 88 87 Hip 89.5
## 89 88 Hip 90.4
## 90 89 Hip 91.3
## 91 90 Hip 92.2
## 92 91 Hip 93.0
## 93 92 Hip 94.0
## 94 93 Hip 94.8
## 95 94 Hip 95.7
## 96 95 Hip 96.7
## 97 96 Hip 97.6
## 98 97 Hip 98.5
## 99 98 Hip 99.4
## 100 99 Hip 100.5
## 101 100 Hip 101.4
## 102 101 Hip 102.2
## 103 102 Hip 102.9
## 104 103 Hip 103.6
## 105 104 Hip 104.3
## 106 105 Hip 105.0
## 107 106 Hip NA
femur_fx_men = func_Skel_Age(sk.age, "Men", "Femur", 49)
## [1] 7.7 8.5 9.5 10.5 11.5 12.5 13.5 14.5 15.4 16.4 17.4 18.4
## [13] 19.4 20.4 21.4 22.4 23.4 24.4 25.4 26.3 27.4 28.3 29.2 30.2
## [25] 31.2 32.2 33.1 34.1 35.1 36.0 37.1 38.0 38.9 40.0 40.9 41.8
## [37] 42.9 43.8 44.8 45.8 46.7 47.8 48.7 49.6 50.6 51.5 52.5 53.4
## [49] 54.4 55.4 56.3 57.3 58.3 59.2 60.1 61.1 62.0 62.9 63.9 64.8
## [61] 65.7 66.6 67.5 68.4 69.4 70.3 71.1 72.0 73.0 73.8 74.7 75.5
## [73] 76.5 77.3 78.2 79.0 80.0 80.8 81.6 82.6 83.3 84.3 85.1 85.9
## [85] 86.8 87.7 88.6 89.4 90.3 91.2 92.1 92.9 93.9 94.7 95.7 96.6
## [97] 97.5 98.4 99.4 100.4 101.3 102.2 102.8 103.5 104.3 105.0 NA
femur_fx_men
## age fx Skel.Age
## 51 50 Femur 56.3
## 52 51 Femur 57.3
## 53 52 Femur 58.3
## 54 53 Femur 59.2
## 55 54 Femur 60.1
## 56 55 Femur 61.1
## 57 56 Femur 62.0
## 58 57 Femur 62.9
## 59 58 Femur 63.9
## 60 59 Femur 64.8
## 61 60 Femur 65.7
## 62 61 Femur 66.6
## 63 62 Femur 67.5
## 64 63 Femur 68.4
## 65 64 Femur 69.4
## 66 65 Femur 70.3
## 67 66 Femur 71.1
## 68 67 Femur 72.0
## 69 68 Femur 73.0
## 70 69 Femur 73.8
## 71 70 Femur 74.7
## 72 71 Femur 75.5
## 73 72 Femur 76.5
## 74 73 Femur 77.3
## 75 74 Femur 78.2
## 76 75 Femur 79.0
## 77 76 Femur 80.0
## 78 77 Femur 80.8
## 79 78 Femur 81.6
## 80 79 Femur 82.6
## 81 80 Femur 83.3
## 82 81 Femur 84.3
## 83 82 Femur 85.1
## 84 83 Femur 85.9
## 85 84 Femur 86.8
## 86 85 Femur 87.7
## 87 86 Femur 88.6
## 88 87 Femur 89.4
## 89 88 Femur 90.3
## 90 89 Femur 91.2
## 91 90 Femur 92.1
## 92 91 Femur 92.9
## 93 92 Femur 93.9
## 94 93 Femur 94.7
## 95 94 Femur 95.7
## 96 95 Femur 96.6
## 97 96 Femur 97.5
## 98 97 Femur 98.4
## 99 98 Femur 99.4
## 100 99 Femur 100.4
## 101 100 Femur 101.3
## 102 101 Femur 102.2
## 103 102 Femur 102.8
## 104 103 Femur 103.5
## 105 104 Femur 104.3
## 106 105 Femur 105.0
## 107 106 Femur NA
pelvis_fx_men = func_Skel_Age(sk.age, "Men", "Pelvis", 49)
## [1] 6.9 7.7 8.8 9.8 10.8 11.8 12.7 13.7 14.7 15.7 16.7 17.7
## [13] 18.7 19.7 20.7 21.7 22.7 23.7 24.7 25.6 26.6 27.6 28.5 29.5
## [25] 30.5 31.5 32.4 33.4 34.4 35.3 36.4 37.3 38.3 39.3 40.3 41.2
## [37] 42.2 43.2 44.1 45.1 46.1 47.1 48.0 49.0 50.0 50.9 51.9 52.8
## [49] 53.8 54.8 55.7 56.7 57.7 58.7 59.6 60.5 61.5 62.4 63.3 64.2
## [61] 65.2 66.1 67.0 67.9 68.9 69.8 70.7 71.6 72.5 73.4 74.3 75.1
## [73] 76.1 76.9 77.8 78.7 79.6 80.5 81.3 82.3 83.1 84.0 84.9 85.7
## [85] 86.6 87.5 88.4 89.2 90.1 91.1 92.0 92.8 93.8 94.6 95.5 96.5
## [97] 97.4 98.3 99.3 100.3 101.2 102.1 102.7 103.5 104.3 105.0 NA
pelvis_fx_men
## age fx Skel.Age
## 51 50 Pelvis 55.7
## 52 51 Pelvis 56.7
## 53 52 Pelvis 57.7
## 54 53 Pelvis 58.7
## 55 54 Pelvis 59.6
## 56 55 Pelvis 60.5
## 57 56 Pelvis 61.5
## 58 57 Pelvis 62.4
## 59 58 Pelvis 63.3
## 60 59 Pelvis 64.2
## 61 60 Pelvis 65.2
## 62 61 Pelvis 66.1
## 63 62 Pelvis 67.0
## 64 63 Pelvis 67.9
## 65 64 Pelvis 68.9
## 66 65 Pelvis 69.8
## 67 66 Pelvis 70.7
## 68 67 Pelvis 71.6
## 69 68 Pelvis 72.5
## 70 69 Pelvis 73.4
## 71 70 Pelvis 74.3
## 72 71 Pelvis 75.1
## 73 72 Pelvis 76.1
## 74 73 Pelvis 76.9
## 75 74 Pelvis 77.8
## 76 75 Pelvis 78.7
## 77 76 Pelvis 79.6
## 78 77 Pelvis 80.5
## 79 78 Pelvis 81.3
## 80 79 Pelvis 82.3
## 81 80 Pelvis 83.1
## 82 81 Pelvis 84.0
## 83 82 Pelvis 84.9
## 84 83 Pelvis 85.7
## 85 84 Pelvis 86.6
## 86 85 Pelvis 87.5
## 87 86 Pelvis 88.4
## 88 87 Pelvis 89.2
## 89 88 Pelvis 90.1
## 90 89 Pelvis 91.1
## 91 90 Pelvis 92.0
## 92 91 Pelvis 92.8
## 93 92 Pelvis 93.8
## 94 93 Pelvis 94.6
## 95 94 Pelvis 95.5
## 96 95 Pelvis 96.5
## 97 96 Pelvis 97.4
## 98 97 Pelvis 98.3
## 99 98 Pelvis 99.3
## 100 99 Pelvis 100.3
## 101 100 Pelvis 101.2
## 102 101 Pelvis 102.1
## 103 102 Pelvis 102.7
## 104 103 Pelvis 103.5
## 105 104 Pelvis 104.3
## 106 105 Pelvis 105.0
## 107 106 Pelvis NA
vert_fx_men = func_Skel_Age(sk.age, "Men", "Vertebrae", 49)
## [1] 6.0 6.8 7.9 8.8 9.8 10.8 11.8 12.8 13.8 14.8 15.8 16.8
## [13] 17.8 18.8 19.8 20.7 21.7 22.8 23.7 24.7 25.7 26.7 27.6 28.6
## [25] 29.6 30.6 31.5 32.6 33.5 34.5 35.5 36.5 37.4 38.5 39.4 40.3
## [37] 41.4 42.3 43.3 44.3 45.3 46.3 47.2 48.1 49.2 50.1 51.1 52.0
## [49] 53.0 54.1 54.9 56.0 56.9 57.9 58.8 59.8 60.8 61.7 62.6 63.6
## [61] 64.5 65.5 66.4 67.3 68.2 69.2 70.1 71.0 72.0 72.9 73.7 74.6
## [73] 75.6 76.4 77.3 78.2 79.2 80.1 80.9 81.9 82.7 83.7 84.5 85.4
## [85] 86.3 87.2 88.1 88.9 89.9 90.8 91.7 92.6 93.6 94.4 95.4 96.3
## [97] 97.3 98.2 99.1 100.1 101.1 101.9 102.6 103.4 104.2 105.0 NA
vert_fx_men
## age fx Skel.Age
## 51 50 Vertebrae 54.9
## 52 51 Vertebrae 56.0
## 53 52 Vertebrae 56.9
## 54 53 Vertebrae 57.9
## 55 54 Vertebrae 58.8
## 56 55 Vertebrae 59.8
## 57 56 Vertebrae 60.8
## 58 57 Vertebrae 61.7
## 59 58 Vertebrae 62.6
## 60 59 Vertebrae 63.6
## 61 60 Vertebrae 64.5
## 62 61 Vertebrae 65.5
## 63 62 Vertebrae 66.4
## 64 63 Vertebrae 67.3
## 65 64 Vertebrae 68.2
## 66 65 Vertebrae 69.2
## 67 66 Vertebrae 70.1
## 68 67 Vertebrae 71.0
## 69 68 Vertebrae 72.0
## 70 69 Vertebrae 72.9
## 71 70 Vertebrae 73.7
## 72 71 Vertebrae 74.6
## 73 72 Vertebrae 75.6
## 74 73 Vertebrae 76.4
## 75 74 Vertebrae 77.3
## 76 75 Vertebrae 78.2
## 77 76 Vertebrae 79.2
## 78 77 Vertebrae 80.1
## 79 78 Vertebrae 80.9
## 80 79 Vertebrae 81.9
## 81 80 Vertebrae 82.7
## 82 81 Vertebrae 83.7
## 83 82 Vertebrae 84.5
## 84 83 Vertebrae 85.4
## 85 84 Vertebrae 86.3
## 86 85 Vertebrae 87.2
## 87 86 Vertebrae 88.1
## 88 87 Vertebrae 88.9
## 89 88 Vertebrae 89.9
## 90 89 Vertebrae 90.8
## 91 90 Vertebrae 91.7
## 92 91 Vertebrae 92.6
## 93 92 Vertebrae 93.6
## 94 93 Vertebrae 94.4
## 95 94 Vertebrae 95.4
## 96 95 Vertebrae 96.3
## 97 96 Vertebrae 97.3
## 98 97 Vertebrae 98.2
## 99 98 Vertebrae 99.1
## 100 99 Vertebrae 100.1
## 101 100 Vertebrae 101.1
## 102 101 Vertebrae 101.9
## 103 102 Vertebrae 102.6
## 104 103 Vertebrae 103.4
## 105 104 Vertebrae 104.2
## 106 105 Vertebrae 105.0
## 107 106 Vertebrae NA
hum_fx_men = func_Skel_Age(sk.age, "Men", "Humerus", 49)
## [1] 6.0 6.8 7.9 8.9 9.9 10.9 11.9 12.9 13.8 14.8 15.8 16.8
## [13] 17.8 18.8 19.8 20.8 21.8 22.8 23.8 24.7 25.8 26.7 27.7 28.6
## [25] 29.7 30.6 31.6 32.6 33.6 34.5 35.6 36.5 37.5 38.5 39.5 40.4
## [37] 41.4 42.4 43.3 44.4 45.3 46.3 47.3 48.2 49.2 50.1 51.2 52.1
## [49] 53.1 54.1 55.0 56.0 57.0 58.0 58.9 59.8 60.8 61.7 62.7 63.6
## [61] 64.5 65.5 66.4 67.3 68.3 69.2 70.1 71.0 72.0 72.9 73.8 74.6
## [73] 75.6 76.4 77.4 78.3 79.2 80.1 81.0 81.9 82.7 83.7 84.6 85.4
## [85] 86.3 87.2 88.1 89.0 89.9 90.8 91.8 92.6 93.6 94.4 95.4 96.3
## [97] 97.3 98.2 99.1 100.2 101.1 101.9 102.6 103.4 104.2 105.0 NA
hum_fx_men
## age fx Skel.Age
## 51 50 Humerus 55.0
## 52 51 Humerus 56.0
## 53 52 Humerus 57.0
## 54 53 Humerus 58.0
## 55 54 Humerus 58.9
## 56 55 Humerus 59.8
## 57 56 Humerus 60.8
## 58 57 Humerus 61.7
## 59 58 Humerus 62.7
## 60 59 Humerus 63.6
## 61 60 Humerus 64.5
## 62 61 Humerus 65.5
## 63 62 Humerus 66.4
## 64 63 Humerus 67.3
## 65 64 Humerus 68.3
## 66 65 Humerus 69.2
## 67 66 Humerus 70.1
## 68 67 Humerus 71.0
## 69 68 Humerus 72.0
## 70 69 Humerus 72.9
## 71 70 Humerus 73.8
## 72 71 Humerus 74.6
## 73 72 Humerus 75.6
## 74 73 Humerus 76.4
## 75 74 Humerus 77.4
## 76 75 Humerus 78.3
## 77 76 Humerus 79.2
## 78 77 Humerus 80.1
## 79 78 Humerus 81.0
## 80 79 Humerus 81.9
## 81 80 Humerus 82.7
## 82 81 Humerus 83.7
## 83 82 Humerus 84.6
## 84 83 Humerus 85.4
## 85 84 Humerus 86.3
## 86 85 Humerus 87.2
## 87 86 Humerus 88.1
## 88 87 Humerus 89.0
## 89 88 Humerus 89.9
## 90 89 Humerus 90.8
## 91 90 Humerus 91.8
## 92 91 Humerus 92.6
## 93 92 Humerus 93.6
## 94 93 Humerus 94.4
## 95 94 Humerus 95.4
## 96 95 Humerus 96.3
## 97 96 Humerus 97.3
## 98 97 Humerus 98.2
## 99 98 Humerus 99.1
## 100 99 Humerus 100.2
## 101 100 Humerus 101.1
## 102 101 Humerus 101.9
## 103 102 Humerus 102.6
## 104 103 Humerus 103.4
## 105 104 Humerus 104.2
## 106 105 Humerus 105.0
## 107 106 Humerus NA
rib_fx_men = func_Skel_Age(sk.age, "Men", "Rib", 49)
## [1] 3.4 4.3 5.3 6.3 7.3 8.3 9.3 10.3 11.3 12.3 13.3 14.3
## [13] 15.3 16.3 17.3 18.3 19.2 20.3 21.3 22.2 23.3 24.2 25.2 26.2
## [25] 27.2 28.2 29.1 30.2 31.1 32.1 33.2 34.1 35.1 36.1 37.1 38.0
## [37] 39.1 40.1 41.0 42.1 43.0 44.1 45.0 45.9 47.0 47.9 49.0 49.9
## [49] 50.9 51.9 52.8 53.9 54.9 55.9 56.8 57.8 58.8 59.7 60.7 61.6
## [61] 62.6 63.6 64.6 65.5 66.5 67.5 68.4 69.3 70.3 71.3 72.2 73.1
## [73] 74.1 75.0 76.0 76.9 77.9 78.8 79.8 80.8 81.6 82.6 83.6 84.4
## [85] 85.4 86.3 87.3 88.2 89.1 90.2 91.1 92.0 93.0 93.9 94.9 95.9
## [97] 96.8 97.8 98.7 99.7 100.7 101.6 102.3 103.2 104.1 105.0 NA
rib_fx_men
## age fx Skel.Age
## 51 50 Rib 52.8
## 52 51 Rib 53.9
## 53 52 Rib 54.9
## 54 53 Rib 55.9
## 55 54 Rib 56.8
## 56 55 Rib 57.8
## 57 56 Rib 58.8
## 58 57 Rib 59.7
## 59 58 Rib 60.7
## 60 59 Rib 61.6
## 61 60 Rib 62.6
## 62 61 Rib 63.6
## 63 62 Rib 64.6
## 64 63 Rib 65.5
## 65 64 Rib 66.5
## 66 65 Rib 67.5
## 67 66 Rib 68.4
## 68 67 Rib 69.3
## 69 68 Rib 70.3
## 70 69 Rib 71.3
## 71 70 Rib 72.2
## 72 71 Rib 73.1
## 73 72 Rib 74.1
## 74 73 Rib 75.0
## 75 74 Rib 76.0
## 76 75 Rib 76.9
## 77 76 Rib 77.9
## 78 77 Rib 78.8
## 79 78 Rib 79.8
## 80 79 Rib 80.8
## 81 80 Rib 81.6
## 82 81 Rib 82.6
## 83 82 Rib 83.6
## 84 83 Rib 84.4
## 85 84 Rib 85.4
## 86 85 Rib 86.3
## 87 86 Rib 87.3
## 88 87 Rib 88.2
## 89 88 Rib 89.1
## 90 89 Rib 90.2
## 91 90 Rib 91.1
## 92 91 Rib 92.0
## 93 92 Rib 93.0
## 94 93 Rib 93.9
## 95 94 Rib 94.9
## 96 95 Rib 95.9
## 97 96 Rib 96.8
## 98 97 Rib 97.8
## 99 98 Rib 98.7
## 100 99 Rib 99.7
## 101 100 Rib 100.7
## 102 101 Rib 101.6
## 103 102 Rib 102.3
## 104 103 Rib 103.2
## 105 104 Rib 104.1
## 106 105 Rib 105.0
## 107 106 Rib NA
clav_fx_men = func_Skel_Age(sk.age, "Men", "Clavicle", 49)
## [1] 4.3 5.2 6.3 7.2 8.2 9.2 10.2 11.2 12.2 13.2 14.2 15.2
## [13] 16.2 17.2 18.2 19.2 20.2 21.2 22.2 23.1 24.2 25.1 26.1 27.1
## [25] 28.1 29.1 30.0 31.1 32.0 33.0 34.0 35.0 35.9 37.0 38.0 38.9
## [37] 40.0 40.9 41.9 42.9 43.8 44.9 45.8 46.8 47.8 48.7 49.8 50.7
## [49] 51.7 52.7 53.6 54.6 55.6 56.6 57.5 58.5 59.5 60.5 61.4 62.4
## [61] 63.3 64.3 65.2 66.2 67.1 68.1 69.0 69.9 71.0 71.9 72.8 73.7
## [73] 74.7 75.5 76.5 77.4 78.4 79.3 80.2 81.2 82.0 83.0 83.9 84.8
## [85] 85.7 86.7 87.6 88.5 89.4 90.4 91.4 92.2 93.2 94.1 95.1 96.0
## [97] 97.0 97.9 98.9 99.9 100.8 101.7 102.4 103.3 104.1 105.0 NA
clav_fx_men
## age fx Skel.Age
## 51 50 Clavicle 53.6
## 52 51 Clavicle 54.6
## 53 52 Clavicle 55.6
## 54 53 Clavicle 56.6
## 55 54 Clavicle 57.5
## 56 55 Clavicle 58.5
## 57 56 Clavicle 59.5
## 58 57 Clavicle 60.5
## 59 58 Clavicle 61.4
## 60 59 Clavicle 62.4
## 61 60 Clavicle 63.3
## 62 61 Clavicle 64.3
## 63 62 Clavicle 65.2
## 64 63 Clavicle 66.2
## 65 64 Clavicle 67.1
## 66 65 Clavicle 68.1
## 67 66 Clavicle 69.0
## 68 67 Clavicle 69.9
## 69 68 Clavicle 71.0
## 70 69 Clavicle 71.9
## 71 70 Clavicle 72.8
## 72 71 Clavicle 73.7
## 73 72 Clavicle 74.7
## 74 73 Clavicle 75.5
## 75 74 Clavicle 76.5
## 76 75 Clavicle 77.4
## 77 76 Clavicle 78.4
## 78 77 Clavicle 79.3
## 79 78 Clavicle 80.2
## 80 79 Clavicle 81.2
## 81 80 Clavicle 82.0
## 82 81 Clavicle 83.0
## 83 82 Clavicle 83.9
## 84 83 Clavicle 84.8
## 85 84 Clavicle 85.7
## 86 85 Clavicle 86.7
## 87 86 Clavicle 87.6
## 88 87 Clavicle 88.5
## 89 88 Clavicle 89.4
## 90 89 Clavicle 90.4
## 91 90 Clavicle 91.4
## 92 91 Clavicle 92.2
## 93 92 Clavicle 93.2
## 94 93 Clavicle 94.1
## 95 94 Clavicle 95.1
## 96 95 Clavicle 96.0
## 97 96 Clavicle 97.0
## 98 97 Clavicle 97.9
## 99 98 Clavicle 98.9
## 100 99 Clavicle 99.9
## 101 100 Clavicle 100.8
## 102 101 Clavicle 101.7
## 103 102 Clavicle 102.4
## 104 103 Clavicle 103.3
## 105 104 Clavicle 104.1
## 106 105 Clavicle 105.0
## 107 106 Clavicle NA
leg_fx_men = func_Skel_Age(sk.age, "Men", "Lower leg", 49)
## [1] 3.2 4.1 5.1 6.1 7.1 8.1 9.1 10.1 11.1 12.1 13.1 14.1
## [13] 15.1 16.1 17.1 18.1 19.0 20.1 21.1 22.0 23.1 24.0 25.0 26.0
## [25] 27.0 28.0 28.9 30.0 30.9 31.9 33.0 33.9 34.9 36.0 36.9 37.9
## [37] 38.9 39.9 40.8 41.9 42.8 43.9 44.8 45.8 46.8 47.7 48.8 49.7
## [49] 50.7 51.8 52.7 53.7 54.7 55.7 56.6 57.6 58.6 59.6 60.5 61.5
## [61] 62.4 63.5 64.4 65.3 66.3 67.3 68.2 69.2 70.2 71.1 72.1 73.0
## [73] 74.0 74.9 75.9 76.8 77.8 78.7 79.7 80.6 81.5 82.5 83.5 84.3
## [85] 85.3 86.3 87.2 88.1 89.1 90.1 91.0 91.9 93.0 93.8 94.8 95.8
## [97] 96.8 97.7 98.6 99.7 100.6 101.5 102.3 103.2 104.1 105.0 NA
leg_fx_men
## age fx Skel.Age
## 51 50 Lower leg 52.7
## 52 51 Lower leg 53.7
## 53 52 Lower leg 54.7
## 54 53 Lower leg 55.7
## 55 54 Lower leg 56.6
## 56 55 Lower leg 57.6
## 57 56 Lower leg 58.6
## 58 57 Lower leg 59.6
## 59 58 Lower leg 60.5
## 60 59 Lower leg 61.5
## 61 60 Lower leg 62.4
## 62 61 Lower leg 63.5
## 63 62 Lower leg 64.4
## 64 63 Lower leg 65.3
## 65 64 Lower leg 66.3
## 66 65 Lower leg 67.3
## 67 66 Lower leg 68.2
## 68 67 Lower leg 69.2
## 69 68 Lower leg 70.2
## 70 69 Lower leg 71.1
## 71 70 Lower leg 72.1
## 72 71 Lower leg 73.0
## 73 72 Lower leg 74.0
## 74 73 Lower leg 74.9
## 75 74 Lower leg 75.9
## 76 75 Lower leg 76.8
## 77 76 Lower leg 77.8
## 78 77 Lower leg 78.7
## 79 78 Lower leg 79.7
## 80 79 Lower leg 80.6
## 81 80 Lower leg 81.5
## 82 81 Lower leg 82.5
## 83 82 Lower leg 83.5
## 84 83 Lower leg 84.3
## 85 84 Lower leg 85.3
## 86 85 Lower leg 86.3
## 87 86 Lower leg 87.2
## 88 87 Lower leg 88.1
## 89 88 Lower leg 89.1
## 90 89 Lower leg 90.1
## 91 90 Lower leg 91.0
## 92 91 Lower leg 91.9
## 93 92 Lower leg 93.0
## 94 93 Lower leg 93.8
## 95 94 Lower leg 94.8
## 96 95 Lower leg 95.8
## 97 96 Lower leg 96.8
## 98 97 Lower leg 97.7
## 99 98 Lower leg 98.6
## 100 99 Lower leg 99.7
## 101 100 Lower leg 100.6
## 102 101 Lower leg 101.5
## 103 102 Lower leg 102.3
## 104 103 Lower leg 103.2
## 105 104 Lower leg 104.1
## 106 105 Lower leg 105.0
## 107 106 Lower leg NA
library(dplyr)
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v ggplot2 3.3.5 v purrr 0.3.4
## v tibble 3.1.6 v stringr 1.4.0
## v tidyr 1.2.0 v forcats 0.5.1
## v readr 2.1.2
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
df_list = list(any_fx_men, hip_fx_men, femur_fx_men, pelvis_fx_men, vert_fx_men, hum_fx_men, rib_fx_men, clav_fx_men, leg_fx_men)
sa.men = df_list %>% reduce(full_join, by = "age")
head(sa.men)
## age fx.x Skel.Age.x fx.y Skel.Age.y fx.x.x Skel.Age.x.x fx.y.y
## 1 50 Any fracture 54.2 Hip 56.8 Femur 56.3 Pelvis
## 2 51 Any fracture 55.2 Hip 57.8 Femur 57.3 Pelvis
## 3 52 Any fracture 56.2 Hip 58.8 Femur 58.3 Pelvis
## 4 53 Any fracture 57.2 Hip 59.7 Femur 59.2 Pelvis
## 5 54 Any fracture 58.1 Hip 60.6 Femur 60.1 Pelvis
## 6 55 Any fracture 59.1 Hip 61.5 Femur 61.1 Pelvis
## Skel.Age.y.y fx.x.x.x Skel.Age.x.x.x fx.y.y.y Skel.Age.y.y.y fx.x.x.x.x
## 1 55.7 Vertebrae 54.9 Humerus 55.0 Rib
## 2 56.7 Vertebrae 56.0 Humerus 56.0 Rib
## 3 57.7 Vertebrae 56.9 Humerus 57.0 Rib
## 4 58.7 Vertebrae 57.9 Humerus 58.0 Rib
## 5 59.6 Vertebrae 58.8 Humerus 58.9 Rib
## 6 60.5 Vertebrae 59.8 Humerus 59.8 Rib
## Skel.Age.x.x.x.x fx.y.y.y.y Skel.Age.y.y.y.y fx Skel.Age
## 1 52.8 Clavicle 53.6 Lower leg 52.7
## 2 53.9 Clavicle 54.6 Lower leg 53.7
## 3 54.9 Clavicle 55.6 Lower leg 54.7
## 4 55.9 Clavicle 56.6 Lower leg 55.7
## 5 56.8 Clavicle 57.5 Lower leg 56.6
## 6 57.8 Clavicle 58.5 Lower leg 57.6
# function
func_Skel_Age <- function(sk.age, gender, fracture, thres_age){
qx = c(1.331, 0.148, 0.072, 0.035, 0.034, 0.034, 0.067, 0.131, 0.032, 0.063, 0.124, 0.124, 0.095, 0.191, 0.096, 0.162, 0.130, 0.294, 0.163, 0.063, 0.187, 0.218, 0.185, 0.210, 0.147, 0.320, 0.200, 0.251, 0.217, 0.370, 0.210, 0.317, 0.377, 0.304, 0.225, 0.398, 0.317, 0.433, 0.665, 0.523, 0.526, 0.709, 0.900, 0.630, 0.498, 0.705, 1.026, 1.067, 1.556, 1.456, 1.452, 1.313, 1.448, 2.205, 2.413, 2.365, 2.487, 2.633, 2.636, 2.993, 3.567, 3.901, 5.035, 5.070, 5.352, 6.482, 6.636, 7.310, 7.955, 9.231, 9.933, 12.446, 14.182, 15.618, 16.567, 16.675, 19.111, 23.939, 26.242, 27.700, 35.226, 34.403, 44.070, 50.708, 58.747, 66.721, 64.897, 81.356, 96.449, 114.857, 126.731, 137.871, 161.417, 180.891, 209.809, 229.592, 241.967, 282.213, 299.071, 322.506, 378.927, 330.566, 366.203, 400.171, 327.020, 329.680, 1000.000)
age = 0:106
fx_hr = sk.age$est[sk.age$sex == gender & sk.age$fx == fracture]
Lx1 = qx
lx1 = qx
Tx1 = qx
Ex1 = qx
Lx2 = qx
lx2 = qx
Tx2 = qx
Ex2 = qx
length = length(qx)-1
Lx1[1] = 100000
Lx1[length+1] = NA
Tx1[length+1] = NA
Ex1[length+1] = NA
Lx2[1] = 100000
Lx2[length+1] = NA
Tx2[length+1] = NA
Ex2[length+1] = NA
for (x in 2:length) {
Lx1[x] = Lx1[x-1]*(1-(qx[x-1]*1.00)/1000)
Lx2[x] = Lx2[x-1]*(1-(qx[x-1]*fx_hr)/1000)
}
lx1 = (Lx1 + lead(Lx1))/2
lx1[length] = 0
lx1[length+1] = NA
lx2 = (Lx2 + lead(Lx2))/2
lx2[length] = 0
lx2[length+1] = NA
for (x in 1:length) {
Tx1[x] = sum(lx1[x:length])
Tx2[x] = sum(lx2[x:length])
}
Ex1 = Tx1 / Lx1
Ex2 = Tx2 / Lx2
Lx1 = round(Lx1)
lx1 = round(lx1)
Tx1 = round(Tx1)
Ex1 = round(Ex1,1)
Lx2 = round(Lx2)
lx2 = round(lx2)
Tx2 = round(Tx2)
Ex2 = round(Ex2,1)
Diff = Ex1- Ex2
Skel.Age = age+Diff
print(Skel.Age)
df = data.frame(age, qx, Ex1, Ex2, Diff, Skel.Age)
df$fx = fracture
skage = subset(df, age>thres_age, select = c(age, fx, Skel.Age))
skage
}
any_fx_women = func_Skel_Age(sk.age, "Women", "Any fracture",49)
## [1] 3.7 4.7 5.6 6.6 7.6 8.6 9.6 10.6 11.6 12.6 13.6 14.7
## [13] 15.7 16.7 17.6 18.6 19.6 20.6 21.6 22.5 23.5 24.6 25.6 26.6
## [25] 27.6 28.6 29.5 30.5 31.6 32.6 33.5 34.5 35.5 36.5 37.6 38.5
## [37] 39.5 40.5 41.5 42.5 43.5 44.5 45.4 46.5 47.4 48.4 49.3 50.4
## [49] 51.3 52.4 53.3 54.3 55.3 56.3 57.3 58.2 59.2 60.2 61.2 62.1
## [61] 63.1 64.1 65.0 66.0 66.9 67.9 68.9 69.8 70.8 71.7 72.7 73.7
## [73] 74.6 75.5 76.4 77.4 78.3 79.3 80.3 81.2 82.0 83.0 83.9 84.8
## [85] 85.7 86.7 87.7 88.6 89.5 90.4 91.3 92.2 93.2 94.1 95.1 96.0
## [97] 96.9 97.9 98.8 99.8 100.7 101.6 102.4 103.3 104.0 105.0 NA
any_fx_women
## age fx Skel.Age
## 51 50 Any fracture 53.3
## 52 51 Any fracture 54.3
## 53 52 Any fracture 55.3
## 54 53 Any fracture 56.3
## 55 54 Any fracture 57.3
## 56 55 Any fracture 58.2
## 57 56 Any fracture 59.2
## 58 57 Any fracture 60.2
## 59 58 Any fracture 61.2
## 60 59 Any fracture 62.1
## 61 60 Any fracture 63.1
## 62 61 Any fracture 64.1
## 63 62 Any fracture 65.0
## 64 63 Any fracture 66.0
## 65 64 Any fracture 66.9
## 66 65 Any fracture 67.9
## 67 66 Any fracture 68.9
## 68 67 Any fracture 69.8
## 69 68 Any fracture 70.8
## 70 69 Any fracture 71.7
## 71 70 Any fracture 72.7
## 72 71 Any fracture 73.7
## 73 72 Any fracture 74.6
## 74 73 Any fracture 75.5
## 75 74 Any fracture 76.4
## 76 75 Any fracture 77.4
## 77 76 Any fracture 78.3
## 78 77 Any fracture 79.3
## 79 78 Any fracture 80.3
## 80 79 Any fracture 81.2
## 81 80 Any fracture 82.0
## 82 81 Any fracture 83.0
## 83 82 Any fracture 83.9
## 84 83 Any fracture 84.8
## 85 84 Any fracture 85.7
## 86 85 Any fracture 86.7
## 87 86 Any fracture 87.7
## 88 87 Any fracture 88.6
## 89 88 Any fracture 89.5
## 90 89 Any fracture 90.4
## 91 90 Any fracture 91.3
## 92 91 Any fracture 92.2
## 93 92 Any fracture 93.2
## 94 93 Any fracture 94.1
## 95 94 Any fracture 95.1
## 96 95 Any fracture 96.0
## 97 96 Any fracture 96.9
## 98 97 Any fracture 97.9
## 99 98 Any fracture 98.8
## 100 99 Any fracture 99.8
## 101 100 Any fracture 100.7
## 102 101 Any fracture 101.6
## 103 102 Any fracture 102.4
## 104 103 Any fracture 103.3
## 105 104 Any fracture 104.0
## 106 105 Any fracture 105.0
## 107 106 Any fracture NA
hip_fx_women = func_Skel_Age(sk.age, "Women", "Hip", 49)
## [1] 6.0 6.9 7.9 8.9 9.9 10.9 11.9 12.9 13.9 14.8 15.8 16.9
## [13] 17.9 18.9 19.9 20.9 21.8 22.8 23.8 24.8 25.8 26.8 27.8 28.8
## [25] 29.8 30.8 31.7 32.7 33.8 34.8 35.7 36.7 37.7 38.6 39.7 40.7
## [37] 41.7 42.6 43.6 44.6 45.6 46.6 47.5 48.5 49.5 50.5 51.4 52.4
## [49] 53.4 54.4 55.3 56.3 57.2 58.3 59.2 60.1 61.1 62.1 63.1 63.9
## [61] 64.9 65.9 66.8 67.7 68.6 69.6 70.5 71.4 72.4 73.3 74.2 75.2
## [73] 76.1 76.9 77.8 78.7 79.6 80.6 81.5 82.4 83.1 84.1 84.9 85.8
## [85] 86.7 87.6 88.5 89.4 90.2 91.1 92.0 92.8 93.8 94.7 95.6 96.5
## [97] 97.4 98.4 99.3 100.2 101.1 101.9 102.7 103.5 104.1 105.0 NA
hip_fx_women
## age fx Skel.Age
## 51 50 Hip 55.3
## 52 51 Hip 56.3
## 53 52 Hip 57.2
## 54 53 Hip 58.3
## 55 54 Hip 59.2
## 56 55 Hip 60.1
## 57 56 Hip 61.1
## 58 57 Hip 62.1
## 59 58 Hip 63.1
## 60 59 Hip 63.9
## 61 60 Hip 64.9
## 62 61 Hip 65.9
## 63 62 Hip 66.8
## 64 63 Hip 67.7
## 65 64 Hip 68.6
## 66 65 Hip 69.6
## 67 66 Hip 70.5
## 68 67 Hip 71.4
## 69 68 Hip 72.4
## 70 69 Hip 73.3
## 71 70 Hip 74.2
## 72 71 Hip 75.2
## 73 72 Hip 76.1
## 74 73 Hip 76.9
## 75 74 Hip 77.8
## 76 75 Hip 78.7
## 77 76 Hip 79.6
## 78 77 Hip 80.6
## 79 78 Hip 81.5
## 80 79 Hip 82.4
## 81 80 Hip 83.1
## 82 81 Hip 84.1
## 83 82 Hip 84.9
## 84 83 Hip 85.8
## 85 84 Hip 86.7
## 86 85 Hip 87.6
## 87 86 Hip 88.5
## 88 87 Hip 89.4
## 89 88 Hip 90.2
## 90 89 Hip 91.1
## 91 90 Hip 92.0
## 92 91 Hip 92.8
## 93 92 Hip 93.8
## 94 93 Hip 94.7
## 95 94 Hip 95.6
## 96 95 Hip 96.5
## 97 96 Hip 97.4
## 98 97 Hip 98.4
## 99 98 Hip 99.3
## 100 99 Hip 100.2
## 101 100 Hip 101.1
## 102 101 Hip 101.9
## 103 102 Hip 102.7
## 104 103 Hip 103.5
## 105 104 Hip 104.1
## 106 105 Hip 105.0
## 107 106 Hip NA
femur_fx_women = func_Skel_Age(sk.age, "Women", "Femur", 49)
## [1] 6.1 7.0 8.0 8.9 9.9 10.9 11.9 12.9 13.9 14.9 15.9 17.0
## [13] 18.0 18.9 19.9 20.9 21.9 22.9 23.8 24.8 25.8 26.9 27.9 28.8
## [25] 29.8 30.8 31.8 32.7 33.8 34.8 35.8 36.7 37.7 38.7 39.8 40.7
## [37] 41.7 42.7 43.6 44.7 45.6 46.6 47.5 48.6 49.5 50.5 51.5 52.5
## [49] 53.4 54.4 55.3 56.4 57.3 58.3 59.3 60.2 61.1 62.1 63.1 64.0
## [61] 64.9 65.9 66.8 67.8 68.7 69.7 70.6 71.5 72.4 73.3 74.2 75.2
## [73] 76.1 77.0 77.8 78.8 79.6 80.6 81.5 82.4 83.2 84.1 85.0 85.8
## [85] 86.7 87.6 88.5 89.4 90.3 91.1 92.0 92.8 93.8 94.7 95.6 96.5
## [97] 97.4 98.4 99.3 100.2 101.1 101.9 102.7 103.5 104.1 105.0 NA
femur_fx_women
## age fx Skel.Age
## 51 50 Femur 55.3
## 52 51 Femur 56.4
## 53 52 Femur 57.3
## 54 53 Femur 58.3
## 55 54 Femur 59.3
## 56 55 Femur 60.2
## 57 56 Femur 61.1
## 58 57 Femur 62.1
## 59 58 Femur 63.1
## 60 59 Femur 64.0
## 61 60 Femur 64.9
## 62 61 Femur 65.9
## 63 62 Femur 66.8
## 64 63 Femur 67.8
## 65 64 Femur 68.7
## 66 65 Femur 69.7
## 67 66 Femur 70.6
## 68 67 Femur 71.5
## 69 68 Femur 72.4
## 70 69 Femur 73.3
## 71 70 Femur 74.2
## 72 71 Femur 75.2
## 73 72 Femur 76.1
## 74 73 Femur 77.0
## 75 74 Femur 77.8
## 76 75 Femur 78.8
## 77 76 Femur 79.6
## 78 77 Femur 80.6
## 79 78 Femur 81.5
## 80 79 Femur 82.4
## 81 80 Femur 83.2
## 82 81 Femur 84.1
## 83 82 Femur 85.0
## 84 83 Femur 85.8
## 85 84 Femur 86.7
## 86 85 Femur 87.6
## 87 86 Femur 88.5
## 88 87 Femur 89.4
## 89 88 Femur 90.3
## 90 89 Femur 91.1
## 91 90 Femur 92.0
## 92 91 Femur 92.8
## 93 92 Femur 93.8
## 94 93 Femur 94.7
## 95 94 Femur 95.6
## 96 95 Femur 96.5
## 97 96 Femur 97.4
## 98 97 Femur 98.4
## 99 98 Femur 99.3
## 100 99 Femur 100.2
## 101 100 Femur 101.1
## 102 101 Femur 101.9
## 103 102 Femur 102.7
## 104 103 Femur 103.5
## 105 104 Femur 104.1
## 106 105 Femur 105.0
## 107 106 Femur NA
pelvis_fx_women = func_Skel_Age(sk.age, "Women", "Pelvis", 49)
## [1] 5.0 5.9 6.9 7.9 8.9 9.8 10.8 11.8 12.8 13.8 14.8 15.9
## [13] 16.9 17.9 18.8 19.8 20.8 21.8 22.8 23.7 24.7 25.8 26.8 27.8
## [25] 28.8 29.7 30.7 31.7 32.8 33.8 34.7 35.7 36.7 37.6 38.7 39.7
## [37] 40.7 41.6 42.6 43.7 44.6 45.6 46.5 47.6 48.5 49.5 50.5 51.5
## [49] 52.4 53.5 54.4 55.4 56.3 57.4 58.3 59.2 60.2 61.2 62.2 63.1
## [61] 64.1 65.0 66.0 66.9 67.8 68.9 69.8 70.7 71.7 72.6 73.5 74.5
## [73] 75.4 76.3 77.2 78.1 79.0 80.0 80.9 81.8 82.6 83.6 84.5 85.4
## [85] 86.3 87.2 88.1 89.0 89.9 90.8 91.7 92.6 93.6 94.4 95.3 96.3
## [97] 97.2 98.2 99.1 100.0 100.9 101.8 102.6 103.4 104.1 105.0 NA
pelvis_fx_women
## age fx Skel.Age
## 51 50 Pelvis 54.4
## 52 51 Pelvis 55.4
## 53 52 Pelvis 56.3
## 54 53 Pelvis 57.4
## 55 54 Pelvis 58.3
## 56 55 Pelvis 59.2
## 57 56 Pelvis 60.2
## 58 57 Pelvis 61.2
## 59 58 Pelvis 62.2
## 60 59 Pelvis 63.1
## 61 60 Pelvis 64.1
## 62 61 Pelvis 65.0
## 63 62 Pelvis 66.0
## 64 63 Pelvis 66.9
## 65 64 Pelvis 67.8
## 66 65 Pelvis 68.9
## 67 66 Pelvis 69.8
## 68 67 Pelvis 70.7
## 69 68 Pelvis 71.7
## 70 69 Pelvis 72.6
## 71 70 Pelvis 73.5
## 72 71 Pelvis 74.5
## 73 72 Pelvis 75.4
## 74 73 Pelvis 76.3
## 75 74 Pelvis 77.2
## 76 75 Pelvis 78.1
## 77 76 Pelvis 79.0
## 78 77 Pelvis 80.0
## 79 78 Pelvis 80.9
## 80 79 Pelvis 81.8
## 81 80 Pelvis 82.6
## 82 81 Pelvis 83.6
## 83 82 Pelvis 84.5
## 84 83 Pelvis 85.4
## 85 84 Pelvis 86.3
## 86 85 Pelvis 87.2
## 87 86 Pelvis 88.1
## 88 87 Pelvis 89.0
## 89 88 Pelvis 89.9
## 90 89 Pelvis 90.8
## 91 90 Pelvis 91.7
## 92 91 Pelvis 92.6
## 93 92 Pelvis 93.6
## 94 93 Pelvis 94.4
## 95 94 Pelvis 95.3
## 96 95 Pelvis 96.3
## 97 96 Pelvis 97.2
## 98 97 Pelvis 98.2
## 99 98 Pelvis 99.1
## 100 99 Pelvis 100.0
## 101 100 Pelvis 100.9
## 102 101 Pelvis 101.8
## 103 102 Pelvis 102.6
## 104 103 Pelvis 103.4
## 105 104 Pelvis 104.1
## 106 105 Pelvis 105.0
## 107 106 Pelvis NA
vert_fx_women = func_Skel_Age(sk.age, "Women", "Vertebrae", 49)
## [1] 5.0 5.9 6.9 7.9 8.9 9.8 10.8 11.8 12.8 13.8 14.8 15.9
## [13] 16.9 17.9 18.8 19.8 20.8 21.8 22.8 23.7 24.7 25.8 26.8 27.8
## [25] 28.8 29.7 30.7 31.7 32.8 33.8 34.7 35.7 36.7 37.6 38.7 39.7
## [37] 40.7 41.6 42.6 43.7 44.6 45.6 46.5 47.6 48.5 49.5 50.5 51.5
## [49] 52.4 53.5 54.4 55.4 56.3 57.4 58.3 59.2 60.2 61.2 62.2 63.1
## [61] 64.1 65.0 66.0 66.9 67.8 68.9 69.8 70.7 71.7 72.6 73.5 74.5
## [73] 75.4 76.3 77.2 78.1 79.0 80.0 80.9 81.8 82.6 83.6 84.5 85.4
## [85] 86.3 87.2 88.1 89.0 89.9 90.8 91.7 92.6 93.6 94.4 95.3 96.3
## [97] 97.2 98.2 99.1 100.0 100.9 101.8 102.6 103.4 104.1 105.0 NA
vert_fx_women
## age fx Skel.Age
## 51 50 Vertebrae 54.4
## 52 51 Vertebrae 55.4
## 53 52 Vertebrae 56.3
## 54 53 Vertebrae 57.4
## 55 54 Vertebrae 58.3
## 56 55 Vertebrae 59.2
## 57 56 Vertebrae 60.2
## 58 57 Vertebrae 61.2
## 59 58 Vertebrae 62.2
## 60 59 Vertebrae 63.1
## 61 60 Vertebrae 64.1
## 62 61 Vertebrae 65.0
## 63 62 Vertebrae 66.0
## 64 63 Vertebrae 66.9
## 65 64 Vertebrae 67.8
## 66 65 Vertebrae 68.9
## 67 66 Vertebrae 69.8
## 68 67 Vertebrae 70.7
## 69 68 Vertebrae 71.7
## 70 69 Vertebrae 72.6
## 71 70 Vertebrae 73.5
## 72 71 Vertebrae 74.5
## 73 72 Vertebrae 75.4
## 74 73 Vertebrae 76.3
## 75 74 Vertebrae 77.2
## 76 75 Vertebrae 78.1
## 77 76 Vertebrae 79.0
## 78 77 Vertebrae 80.0
## 79 78 Vertebrae 80.9
## 80 79 Vertebrae 81.8
## 81 80 Vertebrae 82.6
## 82 81 Vertebrae 83.6
## 83 82 Vertebrae 84.5
## 84 83 Vertebrae 85.4
## 85 84 Vertebrae 86.3
## 86 85 Vertebrae 87.2
## 87 86 Vertebrae 88.1
## 88 87 Vertebrae 89.0
## 89 88 Vertebrae 89.9
## 90 89 Vertebrae 90.8
## 91 90 Vertebrae 91.7
## 92 91 Vertebrae 92.6
## 93 92 Vertebrae 93.6
## 94 93 Vertebrae 94.4
## 95 94 Vertebrae 95.3
## 96 95 Vertebrae 96.3
## 97 96 Vertebrae 97.2
## 98 97 Vertebrae 98.2
## 99 98 Vertebrae 99.1
## 100 99 Vertebrae 100.0
## 101 100 Vertebrae 100.9
## 102 101 Vertebrae 101.8
## 103 102 Vertebrae 102.6
## 104 103 Vertebrae 103.4
## 105 104 Vertebrae 104.1
## 106 105 Vertebrae 105.0
## 107 106 Vertebrae NA
hum_fx_women = func_Skel_Age(sk.age, "Women", "Humerus", 49)
## [1] 2.9 3.9 4.8 5.8 6.8 7.8 8.8 9.8 10.8 11.8 12.8 13.9
## [13] 14.9 15.9 16.8 17.8 18.8 19.8 20.8 21.8 22.8 23.8 24.8 25.8
## [25] 26.8 27.8 28.7 29.7 30.8 31.8 32.8 33.8 34.7 35.7 36.8 37.8
## [37] 38.7 39.7 40.7 41.8 42.7 43.7 44.7 45.7 46.7 47.6 48.6 49.7
## [49] 50.6 51.6 52.6 53.6 54.5 55.6 56.6 57.5 58.5 59.5 60.5 61.4
## [61] 62.4 63.4 64.4 65.3 66.3 67.3 68.2 69.2 70.2 71.1 72.1 73.1
## [73] 74.0 75.0 75.9 76.9 77.8 78.8 79.8 80.7 81.6 82.6 83.5 84.5
## [85] 85.4 86.4 87.3 88.2 89.2 90.1 91.0 92.0 93.0 93.9 94.8 95.8
## [97] 96.7 97.7 98.7 99.6 100.6 101.4 102.3 103.2 104.0 105.0 NA
hum_fx_women
## age fx Skel.Age
## 51 50 Humerus 52.6
## 52 51 Humerus 53.6
## 53 52 Humerus 54.5
## 54 53 Humerus 55.6
## 55 54 Humerus 56.6
## 56 55 Humerus 57.5
## 57 56 Humerus 58.5
## 58 57 Humerus 59.5
## 59 58 Humerus 60.5
## 60 59 Humerus 61.4
## 61 60 Humerus 62.4
## 62 61 Humerus 63.4
## 63 62 Humerus 64.4
## 64 63 Humerus 65.3
## 65 64 Humerus 66.3
## 66 65 Humerus 67.3
## 67 66 Humerus 68.2
## 68 67 Humerus 69.2
## 69 68 Humerus 70.2
## 70 69 Humerus 71.1
## 71 70 Humerus 72.1
## 72 71 Humerus 73.1
## 73 72 Humerus 74.0
## 74 73 Humerus 75.0
## 75 74 Humerus 75.9
## 76 75 Humerus 76.9
## 77 76 Humerus 77.8
## 78 77 Humerus 78.8
## 79 78 Humerus 79.8
## 80 79 Humerus 80.7
## 81 80 Humerus 81.6
## 82 81 Humerus 82.6
## 83 82 Humerus 83.5
## 84 83 Humerus 84.5
## 85 84 Humerus 85.4
## 86 85 Humerus 86.4
## 87 86 Humerus 87.3
## 88 87 Humerus 88.2
## 89 88 Humerus 89.2
## 90 89 Humerus 90.1
## 91 90 Humerus 91.0
## 92 91 Humerus 92.0
## 93 92 Humerus 93.0
## 94 93 Humerus 93.9
## 95 94 Humerus 94.8
## 96 95 Humerus 95.8
## 97 96 Humerus 96.7
## 98 97 Humerus 97.7
## 99 98 Humerus 98.7
## 100 99 Humerus 99.6
## 101 100 Humerus 100.6
## 102 101 Humerus 101.4
## 103 102 Humerus 102.3
## 104 103 Humerus 103.2
## 105 104 Humerus 104.0
## 106 105 Humerus 105.0
## 107 106 Humerus NA
rib_fx_women = func_Skel_Age(sk.age, "Women", "Rib", 49)
## [1] 3.1 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.1
## [13] 15.1 16.0 17.0 18.0 19.0 20.0 21.0 21.9 22.9 24.0 25.0 26.0
## [25] 27.0 28.0 28.9 29.9 31.0 32.0 33.0 33.9 34.9 35.9 37.0 38.0
## [37] 38.9 39.9 40.9 41.9 42.9 43.9 44.8 45.9 46.8 47.8 48.8 49.8
## [49] 50.8 51.8 52.7 53.8 54.7 55.7 56.8 57.7 58.7 59.7 60.7 61.6
## [61] 62.6 63.6 64.5 65.5 66.4 67.5 68.4 69.3 70.3 71.3 72.2 73.2
## [73] 74.2 75.1 76.0 77.0 77.9 79.0 79.9 80.8 81.7 82.7 83.6 84.5
## [85] 85.5 86.4 87.4 88.3 89.3 90.2 91.1 92.0 93.1 93.9 94.9 95.9
## [97] 96.8 97.8 98.7 99.7 100.6 101.5 102.3 103.2 104.0 105.0 NA
rib_fx_women
## age fx Skel.Age
## 51 50 Rib 52.7
## 52 51 Rib 53.8
## 53 52 Rib 54.7
## 54 53 Rib 55.7
## 55 54 Rib 56.8
## 56 55 Rib 57.7
## 57 56 Rib 58.7
## 58 57 Rib 59.7
## 59 58 Rib 60.7
## 60 59 Rib 61.6
## 61 60 Rib 62.6
## 62 61 Rib 63.6
## 63 62 Rib 64.5
## 64 63 Rib 65.5
## 65 64 Rib 66.4
## 66 65 Rib 67.5
## 67 66 Rib 68.4
## 68 67 Rib 69.3
## 69 68 Rib 70.3
## 70 69 Rib 71.3
## 71 70 Rib 72.2
## 72 71 Rib 73.2
## 73 72 Rib 74.2
## 74 73 Rib 75.1
## 75 74 Rib 76.0
## 76 75 Rib 77.0
## 77 76 Rib 77.9
## 78 77 Rib 79.0
## 79 78 Rib 79.9
## 80 79 Rib 80.8
## 81 80 Rib 81.7
## 82 81 Rib 82.7
## 83 82 Rib 83.6
## 84 83 Rib 84.5
## 85 84 Rib 85.5
## 86 85 Rib 86.4
## 87 86 Rib 87.4
## 88 87 Rib 88.3
## 89 88 Rib 89.3
## 90 89 Rib 90.2
## 91 90 Rib 91.1
## 92 91 Rib 92.0
## 93 92 Rib 93.1
## 94 93 Rib 93.9
## 95 94 Rib 94.9
## 96 95 Rib 95.9
## 97 96 Rib 96.8
## 98 97 Rib 97.8
## 99 98 Rib 98.7
## 100 99 Rib 99.7
## 101 100 Rib 100.6
## 102 101 Rib 101.5
## 103 102 Rib 102.3
## 104 103 Rib 103.2
## 105 104 Rib 104.0
## 106 105 Rib 105.0
## 107 106 Rib NA
clav_fx_women = func_Skel_Age(sk.age, "Women", "Clavicle", 49)
## [1] 3.7 4.6 5.6 6.6 7.6 8.6 9.6 10.6 11.5 12.5 13.5 14.6
## [13] 15.6 16.6 17.6 18.6 19.5 20.5 21.5 22.5 23.5 24.6 25.5 26.5
## [25] 27.5 28.5 29.5 30.5 31.5 32.5 33.5 34.5 35.4 36.4 37.5 38.5
## [37] 39.5 40.4 41.4 42.5 43.4 44.4 45.4 46.4 47.4 48.3 49.3 50.3
## [49] 51.3 52.3 53.2 54.3 55.2 56.2 57.2 58.1 59.1 60.1 61.1 62.0
## [61] 63.0 64.0 65.0 65.9 66.9 67.9 68.8 69.7 70.7 71.7 72.6 73.6
## [73] 74.5 75.5 76.4 77.4 78.3 79.3 80.2 81.2 82.0 83.0 83.9 84.8
## [85] 85.7 86.7 87.6 88.5 89.5 90.4 91.3 92.2 93.2 94.1 95.0 96.0
## [97] 96.9 97.9 98.8 99.8 100.7 101.6 102.4 103.3 104.0 105.0 NA
clav_fx_women
## age fx Skel.Age
## 51 50 Clavicle 53.2
## 52 51 Clavicle 54.3
## 53 52 Clavicle 55.2
## 54 53 Clavicle 56.2
## 55 54 Clavicle 57.2
## 56 55 Clavicle 58.1
## 57 56 Clavicle 59.1
## 58 57 Clavicle 60.1
## 59 58 Clavicle 61.1
## 60 59 Clavicle 62.0
## 61 60 Clavicle 63.0
## 62 61 Clavicle 64.0
## 63 62 Clavicle 65.0
## 64 63 Clavicle 65.9
## 65 64 Clavicle 66.9
## 66 65 Clavicle 67.9
## 67 66 Clavicle 68.8
## 68 67 Clavicle 69.7
## 69 68 Clavicle 70.7
## 70 69 Clavicle 71.7
## 71 70 Clavicle 72.6
## 72 71 Clavicle 73.6
## 73 72 Clavicle 74.5
## 74 73 Clavicle 75.5
## 75 74 Clavicle 76.4
## 76 75 Clavicle 77.4
## 77 76 Clavicle 78.3
## 78 77 Clavicle 79.3
## 79 78 Clavicle 80.2
## 80 79 Clavicle 81.2
## 81 80 Clavicle 82.0
## 82 81 Clavicle 83.0
## 83 82 Clavicle 83.9
## 84 83 Clavicle 84.8
## 85 84 Clavicle 85.7
## 86 85 Clavicle 86.7
## 87 86 Clavicle 87.6
## 88 87 Clavicle 88.5
## 89 88 Clavicle 89.5
## 90 89 Clavicle 90.4
## 91 90 Clavicle 91.3
## 92 91 Clavicle 92.2
## 93 92 Clavicle 93.2
## 94 93 Clavicle 94.1
## 95 94 Clavicle 95.0
## 96 95 Clavicle 96.0
## 97 96 Clavicle 96.9
## 98 97 Clavicle 97.9
## 99 98 Clavicle 98.8
## 100 99 Clavicle 99.8
## 101 100 Clavicle 100.7
## 102 101 Clavicle 101.6
## 103 102 Clavicle 102.4
## 104 103 Clavicle 103.3
## 105 104 Clavicle 104.0
## 106 105 Clavicle 105.0
## 107 106 Clavicle NA
leg_fx_women = func_Skel_Age(sk.age, "Women", "Lower leg", 49)
## [1] 2.3 3.3 4.2 5.2 6.2 7.2 8.2 9.2 10.2 11.2 12.2 13.3
## [13] 14.3 15.3 16.2 17.2 18.2 19.2 20.2 21.2 22.2 23.2 24.2 25.2
## [25] 26.2 27.2 28.2 29.2 30.2 31.2 32.2 33.2 34.2 35.1 36.2 37.2
## [37] 38.2 39.2 40.1 41.2 42.2 43.1 44.1 45.1 46.1 47.1 48.1 49.1
## [49] 50.1 51.1 52.0 53.1 54.0 55.0 56.1 57.0 58.0 59.0 60.0 60.9
## [61] 61.9 62.9 63.9 64.8 65.8 66.9 67.8 68.7 69.8 70.7 71.7 72.7
## [73] 73.6 74.6 75.5 76.5 77.5 78.5 79.4 80.4 81.3 82.3 83.2 84.2
## [85] 85.1 86.1 87.1 88.0 89.0 89.9 90.8 91.8 92.8 93.7 94.7 95.7
## [97] 96.6 97.6 98.5 99.5 100.4 101.3 102.2 103.2 104.0 105.0 NA
leg_fx_women
## age fx Skel.Age
## 51 50 Lower leg 52.0
## 52 51 Lower leg 53.1
## 53 52 Lower leg 54.0
## 54 53 Lower leg 55.0
## 55 54 Lower leg 56.1
## 56 55 Lower leg 57.0
## 57 56 Lower leg 58.0
## 58 57 Lower leg 59.0
## 59 58 Lower leg 60.0
## 60 59 Lower leg 60.9
## 61 60 Lower leg 61.9
## 62 61 Lower leg 62.9
## 63 62 Lower leg 63.9
## 64 63 Lower leg 64.8
## 65 64 Lower leg 65.8
## 66 65 Lower leg 66.9
## 67 66 Lower leg 67.8
## 68 67 Lower leg 68.7
## 69 68 Lower leg 69.8
## 70 69 Lower leg 70.7
## 71 70 Lower leg 71.7
## 72 71 Lower leg 72.7
## 73 72 Lower leg 73.6
## 74 73 Lower leg 74.6
## 75 74 Lower leg 75.5
## 76 75 Lower leg 76.5
## 77 76 Lower leg 77.5
## 78 77 Lower leg 78.5
## 79 78 Lower leg 79.4
## 80 79 Lower leg 80.4
## 81 80 Lower leg 81.3
## 82 81 Lower leg 82.3
## 83 82 Lower leg 83.2
## 84 83 Lower leg 84.2
## 85 84 Lower leg 85.1
## 86 85 Lower leg 86.1
## 87 86 Lower leg 87.1
## 88 87 Lower leg 88.0
## 89 88 Lower leg 89.0
## 90 89 Lower leg 89.9
## 91 90 Lower leg 90.8
## 92 91 Lower leg 91.8
## 93 92 Lower leg 92.8
## 94 93 Lower leg 93.7
## 95 94 Lower leg 94.7
## 96 95 Lower leg 95.7
## 97 96 Lower leg 96.6
## 98 97 Lower leg 97.6
## 99 98 Lower leg 98.5
## 100 99 Lower leg 99.5
## 101 100 Lower leg 100.4
## 102 101 Lower leg 101.3
## 103 102 Lower leg 102.2
## 104 103 Lower leg 103.2
## 105 104 Lower leg 104.0
## 106 105 Lower leg 105.0
## 107 106 Lower leg NA
library(dplyr)
library(tidyverse)
df_list = list(any_fx_women, hip_fx_women, femur_fx_women, pelvis_fx_women, vert_fx_women, hum_fx_women, rib_fx_women, clav_fx_women, leg_fx_women)
sa.women = df_list %>% reduce(full_join, by = "age")
head(sa.women)
## age fx.x Skel.Age.x fx.y Skel.Age.y fx.x.x Skel.Age.x.x fx.y.y
## 1 50 Any fracture 53.3 Hip 55.3 Femur 55.3 Pelvis
## 2 51 Any fracture 54.3 Hip 56.3 Femur 56.4 Pelvis
## 3 52 Any fracture 55.3 Hip 57.2 Femur 57.3 Pelvis
## 4 53 Any fracture 56.3 Hip 58.3 Femur 58.3 Pelvis
## 5 54 Any fracture 57.3 Hip 59.2 Femur 59.3 Pelvis
## 6 55 Any fracture 58.2 Hip 60.1 Femur 60.2 Pelvis
## Skel.Age.y.y fx.x.x.x Skel.Age.x.x.x fx.y.y.y Skel.Age.y.y.y fx.x.x.x.x
## 1 54.4 Vertebrae 54.4 Humerus 52.6 Rib
## 2 55.4 Vertebrae 55.4 Humerus 53.6 Rib
## 3 56.3 Vertebrae 56.3 Humerus 54.5 Rib
## 4 57.4 Vertebrae 57.4 Humerus 55.6 Rib
## 5 58.3 Vertebrae 58.3 Humerus 56.6 Rib
## 6 59.2 Vertebrae 59.2 Humerus 57.5 Rib
## Skel.Age.x.x.x.x fx.y.y.y.y Skel.Age.y.y.y.y fx Skel.Age
## 1 52.7 Clavicle 53.2 Lower leg 52.0
## 2 53.8 Clavicle 54.3 Lower leg 53.1
## 3 54.7 Clavicle 55.2 Lower leg 54.0
## 4 55.7 Clavicle 56.2 Lower leg 55.0
## 5 56.8 Clavicle 57.2 Lower leg 56.1
## 6 57.7 Clavicle 58.1 Lower leg 57.0
sa.both = rbind(sa.men, sa.women)
sa.both
## age fx.x Skel.Age.x fx.y Skel.Age.y fx.x.x Skel.Age.x.x fx.y.y
## 1 50 Any fracture 54.2 Hip 56.8 Femur 56.3 Pelvis
## 2 51 Any fracture 55.2 Hip 57.8 Femur 57.3 Pelvis
## 3 52 Any fracture 56.2 Hip 58.8 Femur 58.3 Pelvis
## 4 53 Any fracture 57.2 Hip 59.7 Femur 59.2 Pelvis
## 5 54 Any fracture 58.1 Hip 60.6 Femur 60.1 Pelvis
## 6 55 Any fracture 59.1 Hip 61.5 Femur 61.1 Pelvis
## 7 56 Any fracture 60.0 Hip 62.5 Femur 62.0 Pelvis
## 8 57 Any fracture 61.0 Hip 63.4 Femur 62.9 Pelvis
## 9 58 Any fracture 61.9 Hip 64.3 Femur 63.9 Pelvis
## 10 59 Any fracture 62.9 Hip 65.2 Femur 64.8 Pelvis
## 11 60 Any fracture 63.8 Hip 66.1 Femur 65.7 Pelvis
## 12 61 Any fracture 64.8 Hip 67.1 Femur 66.6 Pelvis
## 13 62 Any fracture 65.7 Hip 67.9 Femur 67.5 Pelvis
## 14 63 Any fracture 66.6 Hip 68.8 Femur 68.4 Pelvis
## 15 64 Any fracture 67.6 Hip 69.7 Femur 69.4 Pelvis
## 16 65 Any fracture 68.6 Hip 70.7 Femur 70.3 Pelvis
## 17 66 Any fracture 69.5 Hip 71.5 Femur 71.1 Pelvis
## 18 67 Any fracture 70.4 Hip 72.4 Femur 72.0 Pelvis
## 19 68 Any fracture 71.4 Hip 73.3 Femur 73.0 Pelvis
## 20 69 Any fracture 72.3 Hip 74.2 Femur 73.8 Pelvis
## 21 70 Any fracture 73.2 Hip 75.0 Femur 74.7 Pelvis
## 22 71 Any fracture 74.1 Hip 75.8 Femur 75.5 Pelvis
## 23 72 Any fracture 75.1 Hip 76.8 Femur 76.5 Pelvis
## 24 73 Any fracture 75.9 Hip 77.6 Femur 77.3 Pelvis
## 25 74 Any fracture 76.9 Hip 78.5 Femur 78.2 Pelvis
## 26 75 Any fracture 77.8 Hip 79.3 Femur 79.0 Pelvis
## 27 76 Any fracture 78.7 Hip 80.2 Femur 80.0 Pelvis
## 28 77 Any fracture 79.6 Hip 81.1 Femur 80.8 Pelvis
## 29 78 Any fracture 80.5 Hip 81.9 Femur 81.6 Pelvis
## 30 79 Any fracture 81.5 Hip 82.8 Femur 82.6 Pelvis
## 31 80 Any fracture 82.3 Hip 83.6 Femur 83.3 Pelvis
## 32 81 Any fracture 83.3 Hip 84.5 Femur 84.3 Pelvis
## 33 82 Any fracture 84.2 Hip 85.3 Femur 85.1 Pelvis
## 34 83 Any fracture 85.0 Hip 86.1 Femur 85.9 Pelvis
## 35 84 Any fracture 86.0 Hip 87.0 Femur 86.8 Pelvis
## 36 85 Any fracture 86.9 Hip 87.8 Femur 87.7 Pelvis
## 37 86 Any fracture 87.8 Hip 88.7 Femur 88.6 Pelvis
## 38 87 Any fracture 88.7 Hip 89.5 Femur 89.4 Pelvis
## 39 88 Any fracture 89.6 Hip 90.4 Femur 90.3 Pelvis
## 40 89 Any fracture 90.6 Hip 91.3 Femur 91.2 Pelvis
## 41 90 Any fracture 91.5 Hip 92.2 Femur 92.1 Pelvis
## 42 91 Any fracture 92.4 Hip 93.0 Femur 92.9 Pelvis
## 43 92 Any fracture 93.4 Hip 94.0 Femur 93.9 Pelvis
## 44 93 Any fracture 94.3 Hip 94.8 Femur 94.7 Pelvis
## 45 94 Any fracture 95.2 Hip 95.7 Femur 95.7 Pelvis
## 46 95 Any fracture 96.2 Hip 96.7 Femur 96.6 Pelvis
## 47 96 Any fracture 97.1 Hip 97.6 Femur 97.5 Pelvis
## 48 97 Any fracture 98.0 Hip 98.5 Femur 98.4 Pelvis
## 49 98 Any fracture 99.0 Hip 99.4 Femur 99.4 Pelvis
## 50 99 Any fracture 100.0 Hip 100.5 Femur 100.4 Pelvis
## 51 100 Any fracture 100.9 Hip 101.4 Femur 101.3 Pelvis
## 52 101 Any fracture 101.8 Hip 102.2 Femur 102.2 Pelvis
## 53 102 Any fracture 102.5 Hip 102.9 Femur 102.8 Pelvis
## 54 103 Any fracture 103.3 Hip 103.6 Femur 103.5 Pelvis
## 55 104 Any fracture 104.2 Hip 104.3 Femur 104.3 Pelvis
## 56 105 Any fracture 105.0 Hip 105.0 Femur 105.0 Pelvis
## 57 106 Any fracture NA Hip NA Femur NA Pelvis
## 58 50 Any fracture 53.3 Hip 55.3 Femur 55.3 Pelvis
## 59 51 Any fracture 54.3 Hip 56.3 Femur 56.4 Pelvis
## 60 52 Any fracture 55.3 Hip 57.2 Femur 57.3 Pelvis
## 61 53 Any fracture 56.3 Hip 58.3 Femur 58.3 Pelvis
## 62 54 Any fracture 57.3 Hip 59.2 Femur 59.3 Pelvis
## 63 55 Any fracture 58.2 Hip 60.1 Femur 60.2 Pelvis
## 64 56 Any fracture 59.2 Hip 61.1 Femur 61.1 Pelvis
## 65 57 Any fracture 60.2 Hip 62.1 Femur 62.1 Pelvis
## 66 58 Any fracture 61.2 Hip 63.1 Femur 63.1 Pelvis
## 67 59 Any fracture 62.1 Hip 63.9 Femur 64.0 Pelvis
## 68 60 Any fracture 63.1 Hip 64.9 Femur 64.9 Pelvis
## 69 61 Any fracture 64.1 Hip 65.9 Femur 65.9 Pelvis
## 70 62 Any fracture 65.0 Hip 66.8 Femur 66.8 Pelvis
## 71 63 Any fracture 66.0 Hip 67.7 Femur 67.8 Pelvis
## 72 64 Any fracture 66.9 Hip 68.6 Femur 68.7 Pelvis
## 73 65 Any fracture 67.9 Hip 69.6 Femur 69.7 Pelvis
## 74 66 Any fracture 68.9 Hip 70.5 Femur 70.6 Pelvis
## 75 67 Any fracture 69.8 Hip 71.4 Femur 71.5 Pelvis
## 76 68 Any fracture 70.8 Hip 72.4 Femur 72.4 Pelvis
## 77 69 Any fracture 71.7 Hip 73.3 Femur 73.3 Pelvis
## 78 70 Any fracture 72.7 Hip 74.2 Femur 74.2 Pelvis
## 79 71 Any fracture 73.7 Hip 75.2 Femur 75.2 Pelvis
## 80 72 Any fracture 74.6 Hip 76.1 Femur 76.1 Pelvis
## 81 73 Any fracture 75.5 Hip 76.9 Femur 77.0 Pelvis
## 82 74 Any fracture 76.4 Hip 77.8 Femur 77.8 Pelvis
## 83 75 Any fracture 77.4 Hip 78.7 Femur 78.8 Pelvis
## 84 76 Any fracture 78.3 Hip 79.6 Femur 79.6 Pelvis
## 85 77 Any fracture 79.3 Hip 80.6 Femur 80.6 Pelvis
## 86 78 Any fracture 80.3 Hip 81.5 Femur 81.5 Pelvis
## 87 79 Any fracture 81.2 Hip 82.4 Femur 82.4 Pelvis
## 88 80 Any fracture 82.0 Hip 83.1 Femur 83.2 Pelvis
## 89 81 Any fracture 83.0 Hip 84.1 Femur 84.1 Pelvis
## 90 82 Any fracture 83.9 Hip 84.9 Femur 85.0 Pelvis
## 91 83 Any fracture 84.8 Hip 85.8 Femur 85.8 Pelvis
## 92 84 Any fracture 85.7 Hip 86.7 Femur 86.7 Pelvis
## 93 85 Any fracture 86.7 Hip 87.6 Femur 87.6 Pelvis
## 94 86 Any fracture 87.7 Hip 88.5 Femur 88.5 Pelvis
## 95 87 Any fracture 88.6 Hip 89.4 Femur 89.4 Pelvis
## 96 88 Any fracture 89.5 Hip 90.2 Femur 90.3 Pelvis
## 97 89 Any fracture 90.4 Hip 91.1 Femur 91.1 Pelvis
## 98 90 Any fracture 91.3 Hip 92.0 Femur 92.0 Pelvis
## 99 91 Any fracture 92.2 Hip 92.8 Femur 92.8 Pelvis
## 100 92 Any fracture 93.2 Hip 93.8 Femur 93.8 Pelvis
## 101 93 Any fracture 94.1 Hip 94.7 Femur 94.7 Pelvis
## 102 94 Any fracture 95.1 Hip 95.6 Femur 95.6 Pelvis
## 103 95 Any fracture 96.0 Hip 96.5 Femur 96.5 Pelvis
## 104 96 Any fracture 96.9 Hip 97.4 Femur 97.4 Pelvis
## 105 97 Any fracture 97.9 Hip 98.4 Femur 98.4 Pelvis
## 106 98 Any fracture 98.8 Hip 99.3 Femur 99.3 Pelvis
## 107 99 Any fracture 99.8 Hip 100.2 Femur 100.2 Pelvis
## 108 100 Any fracture 100.7 Hip 101.1 Femur 101.1 Pelvis
## 109 101 Any fracture 101.6 Hip 101.9 Femur 101.9 Pelvis
## 110 102 Any fracture 102.4 Hip 102.7 Femur 102.7 Pelvis
## 111 103 Any fracture 103.3 Hip 103.5 Femur 103.5 Pelvis
## 112 104 Any fracture 104.0 Hip 104.1 Femur 104.1 Pelvis
## 113 105 Any fracture 105.0 Hip 105.0 Femur 105.0 Pelvis
## 114 106 Any fracture NA Hip NA Femur NA Pelvis
## Skel.Age.y.y fx.x.x.x Skel.Age.x.x.x fx.y.y.y Skel.Age.y.y.y fx.x.x.x.x
## 1 55.7 Vertebrae 54.9 Humerus 55.0 Rib
## 2 56.7 Vertebrae 56.0 Humerus 56.0 Rib
## 3 57.7 Vertebrae 56.9 Humerus 57.0 Rib
## 4 58.7 Vertebrae 57.9 Humerus 58.0 Rib
## 5 59.6 Vertebrae 58.8 Humerus 58.9 Rib
## 6 60.5 Vertebrae 59.8 Humerus 59.8 Rib
## 7 61.5 Vertebrae 60.8 Humerus 60.8 Rib
## 8 62.4 Vertebrae 61.7 Humerus 61.7 Rib
## 9 63.3 Vertebrae 62.6 Humerus 62.7 Rib
## 10 64.2 Vertebrae 63.6 Humerus 63.6 Rib
## 11 65.2 Vertebrae 64.5 Humerus 64.5 Rib
## 12 66.1 Vertebrae 65.5 Humerus 65.5 Rib
## 13 67.0 Vertebrae 66.4 Humerus 66.4 Rib
## 14 67.9 Vertebrae 67.3 Humerus 67.3 Rib
## 15 68.9 Vertebrae 68.2 Humerus 68.3 Rib
## 16 69.8 Vertebrae 69.2 Humerus 69.2 Rib
## 17 70.7 Vertebrae 70.1 Humerus 70.1 Rib
## 18 71.6 Vertebrae 71.0 Humerus 71.0 Rib
## 19 72.5 Vertebrae 72.0 Humerus 72.0 Rib
## 20 73.4 Vertebrae 72.9 Humerus 72.9 Rib
## 21 74.3 Vertebrae 73.7 Humerus 73.8 Rib
## 22 75.1 Vertebrae 74.6 Humerus 74.6 Rib
## 23 76.1 Vertebrae 75.6 Humerus 75.6 Rib
## 24 76.9 Vertebrae 76.4 Humerus 76.4 Rib
## 25 77.8 Vertebrae 77.3 Humerus 77.4 Rib
## 26 78.7 Vertebrae 78.2 Humerus 78.3 Rib
## 27 79.6 Vertebrae 79.2 Humerus 79.2 Rib
## 28 80.5 Vertebrae 80.1 Humerus 80.1 Rib
## 29 81.3 Vertebrae 80.9 Humerus 81.0 Rib
## 30 82.3 Vertebrae 81.9 Humerus 81.9 Rib
## 31 83.1 Vertebrae 82.7 Humerus 82.7 Rib
## 32 84.0 Vertebrae 83.7 Humerus 83.7 Rib
## 33 84.9 Vertebrae 84.5 Humerus 84.6 Rib
## 34 85.7 Vertebrae 85.4 Humerus 85.4 Rib
## 35 86.6 Vertebrae 86.3 Humerus 86.3 Rib
## 36 87.5 Vertebrae 87.2 Humerus 87.2 Rib
## 37 88.4 Vertebrae 88.1 Humerus 88.1 Rib
## 38 89.2 Vertebrae 88.9 Humerus 89.0 Rib
## 39 90.1 Vertebrae 89.9 Humerus 89.9 Rib
## 40 91.1 Vertebrae 90.8 Humerus 90.8 Rib
## 41 92.0 Vertebrae 91.7 Humerus 91.8 Rib
## 42 92.8 Vertebrae 92.6 Humerus 92.6 Rib
## 43 93.8 Vertebrae 93.6 Humerus 93.6 Rib
## 44 94.6 Vertebrae 94.4 Humerus 94.4 Rib
## 45 95.5 Vertebrae 95.4 Humerus 95.4 Rib
## 46 96.5 Vertebrae 96.3 Humerus 96.3 Rib
## 47 97.4 Vertebrae 97.3 Humerus 97.3 Rib
## 48 98.3 Vertebrae 98.2 Humerus 98.2 Rib
## 49 99.3 Vertebrae 99.1 Humerus 99.1 Rib
## 50 100.3 Vertebrae 100.1 Humerus 100.2 Rib
## 51 101.2 Vertebrae 101.1 Humerus 101.1 Rib
## 52 102.1 Vertebrae 101.9 Humerus 101.9 Rib
## 53 102.7 Vertebrae 102.6 Humerus 102.6 Rib
## 54 103.5 Vertebrae 103.4 Humerus 103.4 Rib
## 55 104.3 Vertebrae 104.2 Humerus 104.2 Rib
## 56 105.0 Vertebrae 105.0 Humerus 105.0 Rib
## 57 NA Vertebrae NA Humerus NA Rib
## 58 54.4 Vertebrae 54.4 Humerus 52.6 Rib
## 59 55.4 Vertebrae 55.4 Humerus 53.6 Rib
## 60 56.3 Vertebrae 56.3 Humerus 54.5 Rib
## 61 57.4 Vertebrae 57.4 Humerus 55.6 Rib
## 62 58.3 Vertebrae 58.3 Humerus 56.6 Rib
## 63 59.2 Vertebrae 59.2 Humerus 57.5 Rib
## 64 60.2 Vertebrae 60.2 Humerus 58.5 Rib
## 65 61.2 Vertebrae 61.2 Humerus 59.5 Rib
## 66 62.2 Vertebrae 62.2 Humerus 60.5 Rib
## 67 63.1 Vertebrae 63.1 Humerus 61.4 Rib
## 68 64.1 Vertebrae 64.1 Humerus 62.4 Rib
## 69 65.0 Vertebrae 65.0 Humerus 63.4 Rib
## 70 66.0 Vertebrae 66.0 Humerus 64.4 Rib
## 71 66.9 Vertebrae 66.9 Humerus 65.3 Rib
## 72 67.8 Vertebrae 67.8 Humerus 66.3 Rib
## 73 68.9 Vertebrae 68.9 Humerus 67.3 Rib
## 74 69.8 Vertebrae 69.8 Humerus 68.2 Rib
## 75 70.7 Vertebrae 70.7 Humerus 69.2 Rib
## 76 71.7 Vertebrae 71.7 Humerus 70.2 Rib
## 77 72.6 Vertebrae 72.6 Humerus 71.1 Rib
## 78 73.5 Vertebrae 73.5 Humerus 72.1 Rib
## 79 74.5 Vertebrae 74.5 Humerus 73.1 Rib
## 80 75.4 Vertebrae 75.4 Humerus 74.0 Rib
## 81 76.3 Vertebrae 76.3 Humerus 75.0 Rib
## 82 77.2 Vertebrae 77.2 Humerus 75.9 Rib
## 83 78.1 Vertebrae 78.1 Humerus 76.9 Rib
## 84 79.0 Vertebrae 79.0 Humerus 77.8 Rib
## 85 80.0 Vertebrae 80.0 Humerus 78.8 Rib
## 86 80.9 Vertebrae 80.9 Humerus 79.8 Rib
## 87 81.8 Vertebrae 81.8 Humerus 80.7 Rib
## 88 82.6 Vertebrae 82.6 Humerus 81.6 Rib
## 89 83.6 Vertebrae 83.6 Humerus 82.6 Rib
## 90 84.5 Vertebrae 84.5 Humerus 83.5 Rib
## 91 85.4 Vertebrae 85.4 Humerus 84.5 Rib
## 92 86.3 Vertebrae 86.3 Humerus 85.4 Rib
## 93 87.2 Vertebrae 87.2 Humerus 86.4 Rib
## 94 88.1 Vertebrae 88.1 Humerus 87.3 Rib
## 95 89.0 Vertebrae 89.0 Humerus 88.2 Rib
## 96 89.9 Vertebrae 89.9 Humerus 89.2 Rib
## 97 90.8 Vertebrae 90.8 Humerus 90.1 Rib
## 98 91.7 Vertebrae 91.7 Humerus 91.0 Rib
## 99 92.6 Vertebrae 92.6 Humerus 92.0 Rib
## 100 93.6 Vertebrae 93.6 Humerus 93.0 Rib
## 101 94.4 Vertebrae 94.4 Humerus 93.9 Rib
## 102 95.3 Vertebrae 95.3 Humerus 94.8 Rib
## 103 96.3 Vertebrae 96.3 Humerus 95.8 Rib
## 104 97.2 Vertebrae 97.2 Humerus 96.7 Rib
## 105 98.2 Vertebrae 98.2 Humerus 97.7 Rib
## 106 99.1 Vertebrae 99.1 Humerus 98.7 Rib
## 107 100.0 Vertebrae 100.0 Humerus 99.6 Rib
## 108 100.9 Vertebrae 100.9 Humerus 100.6 Rib
## 109 101.8 Vertebrae 101.8 Humerus 101.4 Rib
## 110 102.6 Vertebrae 102.6 Humerus 102.3 Rib
## 111 103.4 Vertebrae 103.4 Humerus 103.2 Rib
## 112 104.1 Vertebrae 104.1 Humerus 104.0 Rib
## 113 105.0 Vertebrae 105.0 Humerus 105.0 Rib
## 114 NA Vertebrae NA Humerus NA Rib
## Skel.Age.x.x.x.x fx.y.y.y.y Skel.Age.y.y.y.y fx Skel.Age
## 1 52.8 Clavicle 53.6 Lower leg 52.7
## 2 53.9 Clavicle 54.6 Lower leg 53.7
## 3 54.9 Clavicle 55.6 Lower leg 54.7
## 4 55.9 Clavicle 56.6 Lower leg 55.7
## 5 56.8 Clavicle 57.5 Lower leg 56.6
## 6 57.8 Clavicle 58.5 Lower leg 57.6
## 7 58.8 Clavicle 59.5 Lower leg 58.6
## 8 59.7 Clavicle 60.5 Lower leg 59.6
## 9 60.7 Clavicle 61.4 Lower leg 60.5
## 10 61.6 Clavicle 62.4 Lower leg 61.5
## 11 62.6 Clavicle 63.3 Lower leg 62.4
## 12 63.6 Clavicle 64.3 Lower leg 63.5
## 13 64.6 Clavicle 65.2 Lower leg 64.4
## 14 65.5 Clavicle 66.2 Lower leg 65.3
## 15 66.5 Clavicle 67.1 Lower leg 66.3
## 16 67.5 Clavicle 68.1 Lower leg 67.3
## 17 68.4 Clavicle 69.0 Lower leg 68.2
## 18 69.3 Clavicle 69.9 Lower leg 69.2
## 19 70.3 Clavicle 71.0 Lower leg 70.2
## 20 71.3 Clavicle 71.9 Lower leg 71.1
## 21 72.2 Clavicle 72.8 Lower leg 72.1
## 22 73.1 Clavicle 73.7 Lower leg 73.0
## 23 74.1 Clavicle 74.7 Lower leg 74.0
## 24 75.0 Clavicle 75.5 Lower leg 74.9
## 25 76.0 Clavicle 76.5 Lower leg 75.9
## 26 76.9 Clavicle 77.4 Lower leg 76.8
## 27 77.9 Clavicle 78.4 Lower leg 77.8
## 28 78.8 Clavicle 79.3 Lower leg 78.7
## 29 79.8 Clavicle 80.2 Lower leg 79.7
## 30 80.8 Clavicle 81.2 Lower leg 80.6
## 31 81.6 Clavicle 82.0 Lower leg 81.5
## 32 82.6 Clavicle 83.0 Lower leg 82.5
## 33 83.6 Clavicle 83.9 Lower leg 83.5
## 34 84.4 Clavicle 84.8 Lower leg 84.3
## 35 85.4 Clavicle 85.7 Lower leg 85.3
## 36 86.3 Clavicle 86.7 Lower leg 86.3
## 37 87.3 Clavicle 87.6 Lower leg 87.2
## 38 88.2 Clavicle 88.5 Lower leg 88.1
## 39 89.1 Clavicle 89.4 Lower leg 89.1
## 40 90.2 Clavicle 90.4 Lower leg 90.1
## 41 91.1 Clavicle 91.4 Lower leg 91.0
## 42 92.0 Clavicle 92.2 Lower leg 91.9
## 43 93.0 Clavicle 93.2 Lower leg 93.0
## 44 93.9 Clavicle 94.1 Lower leg 93.8
## 45 94.9 Clavicle 95.1 Lower leg 94.8
## 46 95.9 Clavicle 96.0 Lower leg 95.8
## 47 96.8 Clavicle 97.0 Lower leg 96.8
## 48 97.8 Clavicle 97.9 Lower leg 97.7
## 49 98.7 Clavicle 98.9 Lower leg 98.6
## 50 99.7 Clavicle 99.9 Lower leg 99.7
## 51 100.7 Clavicle 100.8 Lower leg 100.6
## 52 101.6 Clavicle 101.7 Lower leg 101.5
## 53 102.3 Clavicle 102.4 Lower leg 102.3
## 54 103.2 Clavicle 103.3 Lower leg 103.2
## 55 104.1 Clavicle 104.1 Lower leg 104.1
## 56 105.0 Clavicle 105.0 Lower leg 105.0
## 57 NA Clavicle NA Lower leg NA
## 58 52.7 Clavicle 53.2 Lower leg 52.0
## 59 53.8 Clavicle 54.3 Lower leg 53.1
## 60 54.7 Clavicle 55.2 Lower leg 54.0
## 61 55.7 Clavicle 56.2 Lower leg 55.0
## 62 56.8 Clavicle 57.2 Lower leg 56.1
## 63 57.7 Clavicle 58.1 Lower leg 57.0
## 64 58.7 Clavicle 59.1 Lower leg 58.0
## 65 59.7 Clavicle 60.1 Lower leg 59.0
## 66 60.7 Clavicle 61.1 Lower leg 60.0
## 67 61.6 Clavicle 62.0 Lower leg 60.9
## 68 62.6 Clavicle 63.0 Lower leg 61.9
## 69 63.6 Clavicle 64.0 Lower leg 62.9
## 70 64.5 Clavicle 65.0 Lower leg 63.9
## 71 65.5 Clavicle 65.9 Lower leg 64.8
## 72 66.4 Clavicle 66.9 Lower leg 65.8
## 73 67.5 Clavicle 67.9 Lower leg 66.9
## 74 68.4 Clavicle 68.8 Lower leg 67.8
## 75 69.3 Clavicle 69.7 Lower leg 68.7
## 76 70.3 Clavicle 70.7 Lower leg 69.8
## 77 71.3 Clavicle 71.7 Lower leg 70.7
## 78 72.2 Clavicle 72.6 Lower leg 71.7
## 79 73.2 Clavicle 73.6 Lower leg 72.7
## 80 74.2 Clavicle 74.5 Lower leg 73.6
## 81 75.1 Clavicle 75.5 Lower leg 74.6
## 82 76.0 Clavicle 76.4 Lower leg 75.5
## 83 77.0 Clavicle 77.4 Lower leg 76.5
## 84 77.9 Clavicle 78.3 Lower leg 77.5
## 85 79.0 Clavicle 79.3 Lower leg 78.5
## 86 79.9 Clavicle 80.2 Lower leg 79.4
## 87 80.8 Clavicle 81.2 Lower leg 80.4
## 88 81.7 Clavicle 82.0 Lower leg 81.3
## 89 82.7 Clavicle 83.0 Lower leg 82.3
## 90 83.6 Clavicle 83.9 Lower leg 83.2
## 91 84.5 Clavicle 84.8 Lower leg 84.2
## 92 85.5 Clavicle 85.7 Lower leg 85.1
## 93 86.4 Clavicle 86.7 Lower leg 86.1
## 94 87.4 Clavicle 87.6 Lower leg 87.1
## 95 88.3 Clavicle 88.5 Lower leg 88.0
## 96 89.3 Clavicle 89.5 Lower leg 89.0
## 97 90.2 Clavicle 90.4 Lower leg 89.9
## 98 91.1 Clavicle 91.3 Lower leg 90.8
## 99 92.0 Clavicle 92.2 Lower leg 91.8
## 100 93.1 Clavicle 93.2 Lower leg 92.8
## 101 93.9 Clavicle 94.1 Lower leg 93.7
## 102 94.9 Clavicle 95.0 Lower leg 94.7
## 103 95.9 Clavicle 96.0 Lower leg 95.7
## 104 96.8 Clavicle 96.9 Lower leg 96.6
## 105 97.8 Clavicle 97.9 Lower leg 97.6
## 106 98.7 Clavicle 98.8 Lower leg 98.5
## 107 99.7 Clavicle 99.8 Lower leg 99.5
## 108 100.6 Clavicle 100.7 Lower leg 100.4
## 109 101.5 Clavicle 101.6 Lower leg 101.3
## 110 102.3 Clavicle 102.4 Lower leg 102.2
## 111 103.2 Clavicle 103.3 Lower leg 103.2
## 112 104.0 Clavicle 104.0 Lower leg 104.0
## 113 105.0 Clavicle 105.0 Lower leg 105.0
## 114 NA Clavicle NA Lower leg NA
write.csv(sa.both, "C:\\Garvan\\Skeletal age\\Analysis\\Skeletal_age_both.csv", row.names = FALSE)
library(readxl)
library(tidyverse)
library(gridExtra)
##
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
##
## combine
sa = read_excel("C:/Garvan/Skeletal age/Analysis/Skeletal age data.xlsx")
head(sa)
## # A tibble: 6 x 11
## gender age fracture hip femur pelvis vertebral humerus rib clavicle
## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 Men 50 54.2 56.8 56.3 55.7 54.9 55 52.8 53.6
## 2 Men 51 55.2 57.8 57.3 56.7 56 56 53.9 54.6
## 3 Men 52 56.2 58.8 58.3 57.7 56.9 57 54.9 55.6
## 4 Men 53 57.2 59.7 59.2 58.7 57.9 58 55.9 56.6
## 5 Men 54 58.1 60.6 60.1 59.6 58.8 58.9 56.8 57.5
## 6 Men 55 59.1 61.5 61.1 60.5 59.8 59.8 57.8 58.5
## # ... with 1 more variable: lowerleg <dbl>
p1 = ggplot(data=sa, aes(x=age, y=fracture, color=gender)) + geom_line() + geom_abline(intercept = 0, slope=1, size=0.5, linetype = "dashed") + scale_y_continuous(breaks = seq(from = 50, to = 110, by = 5)) + scale_x_continuous(breaks = seq(from = 50, to = 110, by = 5)) + labs(title="Any fracture", x="Chronological age (years)", y="Skeletal age (years)") + theme(legend.position="none")
p2 = ggplot(data=sa, aes(x=age, y=hip, color=gender)) + geom_line() + geom_abline(intercept = 0, slope=1, size=0.5, linetype = "dashed") + scale_y_continuous(breaks = seq(from = 50, to = 110, by = 5)) + scale_x_continuous(breaks = seq(from = 50, to = 110, by = 5)) + labs(title="Hip fracture", x="Chronological age (years)", y="Skeletal age (years)") + theme(legend.position="none")
p3 = ggplot(data=sa, aes(x=age, y= femur, color=gender)) + geom_line() + geom_abline(intercept = 0, slope=1, size=0.5, linetype = "dashed") + scale_y_continuous(breaks = seq(from = 50, to = 110, by = 5)) + scale_x_continuous(breaks = seq(from = 50, to = 110, by = 5)) + labs(title="Femur fracture", x="Chronological age (years)", y="Skeletal age (years)") + theme(legend.position="none")
p4 = ggplot(data=sa, aes(x=age, y=pelvis, color=gender)) + geom_line() + geom_abline(intercept = 0, slope=1, size=0.5, linetype = "dashed") + scale_y_continuous(breaks = seq(from = 50, to = 110, by = 5)) + scale_x_continuous(breaks = seq(from = 50, to = 110, by = 5)) + labs(title="Pelvis fracture", x="Chronological age (years)", y="Skeletal age (years)") + theme(legend.position="none")
p5 = ggplot(data=sa, aes(x=age, y= vertebral, color=gender)) + geom_line() + geom_abline(intercept = 0, slope=1, size=0.5, linetype = "dashed") + scale_y_continuous(breaks = seq(from = 50, to = 110, by = 5)) + scale_x_continuous(breaks = seq(from = 50, to = 110, by = 5)) + labs(title="Vetebral fracture", x="Chronological age (years)", y="Skeletal age (years)") + theme(legend.position="none")
p6 = ggplot(data=sa, aes(x=age, y= humerus, color=gender)) + geom_line() + geom_abline(intercept = 0, slope=1, size=0.5, linetype = "dashed") + scale_y_continuous(breaks = seq(from = 50, to = 110, by = 5)) + scale_x_continuous(breaks = seq(from = 50, to = 110, by = 5)) + labs(title="Humerus fracture", x="Chronological age (years)", y="Skeletal age (years)") + theme(legend.position="none")
p7 = ggplot(data=sa, aes(x=age, y=rib, color=gender)) + geom_line() + geom_abline(intercept = 0, slope=1, size=0.5, linetype = "dashed") + scale_y_continuous(breaks = seq(from = 50, to = 110, by = 5)) + scale_x_continuous(breaks = seq(from = 50, to = 110, by = 5)) + labs(title="Rib fracture", x="Chronological age (years)", y="Skeletal age (years)") + theme(legend.position="none")
p8 = ggplot(data=sa, aes(x=age, y=clavicle, color=gender)) + geom_line() + geom_abline(intercept = 0, slope=1, size=0.5, linetype = "dashed") + scale_y_continuous(breaks = seq(from = 50, to = 110, by = 5)) + scale_x_continuous(breaks = seq(from = 50, to = 110, by = 5)) + labs(title="Clavicle fracture", x="Chronological age (years)", y="Skeletal age (- clavicle fracture (years)") + theme(legend.position="none")
p9 = ggplot(data=sa, aes(x=age, y=lowerleg, color=gender)) + geom_line() + geom_abline(intercept = 0, slope=1, size=0.5, linetype = "dashed") + scale_y_continuous(breaks = seq(from = 50, to = 110, by = 5)) + scale_x_continuous(breaks = seq(from = 50, to = 110, by = 5)) + labs(title="Lower leg fracture", x="Chronological age (years)", y="Skeletal age (years)") + theme(legend.position="none")
grid.arrange(p1, p2, p3, p4, p5, p6, p7, p8, p9, nrow=3)