Skip to contents
library(microCTr)
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

Read in data:

key <- read_key_excel(mctr_ex("example-treatment.xlsx"))

trab <- read_trabecular_excel(mctr_ex("example-treatment.xlsx"), key)

cort <- read_cortical_excel(mctr_ex("example-treatment.xlsx"), key)

mfe <- read_mfe_excel(mctr_ex("example-treatment.xlsx"), key)

Femoral Metaphysis

Trabecular

Results

F.Met.Tb <- trab |> 
    filter(Site == "Met")

F.Met.Tb_res <- compare_groups(F.Met.Tb)
print_results(F.Met.Tb_res)

BV/TV

Sex Treatment n Mean SEM P Sig
M Veh 3 6.823333 0.9544516
M AP 3 11.270000 2.4272275 0.1634109

SMI

Sex Treatment n Mean SEM P Sig
M Veh 3 3.062633 0.0842023
M AP 3 2.540433 0.4642092 0.3304351

Tb.N

Sex Treatment n Mean SEM P Sig
M Veh 3 2.622667 0.1034977
M AP 3 3.078867 0.2032346 0.1160821

Tb.Th

Sex Treatment n Mean SEM P Sig
M Veh 3 0.0647333 0.0035634
M AP 3 0.0692333 0.0018022 0.3228037

Tb.Sp

Sex Treatment n Mean SEM P Sig
M Veh 3 0.3787667 0.0179088
M AP 3 0.3138333 0.0202536 0.0742147

BV/TV

Sex Treatment n Mean SEM P Sig
F Veh 3 2.6900000 0.9304479
F AP 3 0.8733333 0.4045711 0.1478599

SMI

Sex Treatment n Mean SEM P Sig
F Veh 3 3.827900 0.3064820
F AP 3 3.894533 0.2333696 0.8710705

Tb.N

Sex Treatment n Mean SEM P Sig
F Veh 3 2.301133 0.3748643
F AP 3 1.915700 0.0921935 0.3745704

Tb.Th

Sex Treatment n Mean SEM P Sig
F Veh 3 0.0564333 0.0111202
F AP 3 0.0374333 0.0019099 0.1674765

Tb.Sp

Sex Treatment n Mean SEM P Sig
F Veh 3 0.4697667 0.0979182
F AP 3 0.5225000 0.0220239 0.6270709

Data

print_data(F.Met.Tb)
AS Sex Treatment BV/TV SMI Tb.N Tb.Th Tb.Sp
1369 M AP 12.53 2.4409 3.3321 0.0658 0.2862
1420 M AP 6.58 3.3896 2.6769 0.0719 0.3533
1421 M AP 14.70 1.7908 3.2276 0.0700 0.3020
1365 M Veh 5.43 3.2274 2.4599 0.0620 0.4123
1370 M Veh 6.39 3.0104 2.5933 0.0604 0.3729
1422 M Veh 8.65 2.9501 2.8148 0.0718 0.3511
AS Sex Treatment BV/TV SMI Tb.N Tb.Th Tb.Sp
1367 F AP 0.23 4.1722 1.7888 0.0337 0.5579
1368 F AP 0.77 4.0806 2.0950 0.0400 0.4821
1371 F AP 1.62 3.4308 1.8633 0.0386 0.5275
1366 F Veh 4.47 3.7246 2.6656 0.0593 0.3709
1372 F Veh 1.33 4.4028 1.5515 0.0741 0.6656
1373 F Veh 2.27 3.3563 2.6863 0.0359 0.3728

Combined Sexes

F.Met.Tb |> 
    mutate(Sex = "B") |> 
    compare_groups() |> 
    print_results()

BV/TV

Sex Treatment n Mean SEM P Sig
B Veh 6 4.756667 1.099802
B AP 6 6.071667 2.572072 0.6483756

SMI

Sex Treatment n Mean SEM P Sig
B Veh 6 3.445267 0.2224543
B AP 6 3.217483 0.3816669 0.6173249

Tb.N

Sex Treatment n Mean SEM P Sig
B Veh 6 2.461900 0.1881919
B AP 6 2.497283 0.2785833 0.9182606

Tb.Th

Sex Treatment n Mean SEM P Sig
B Veh 6 0.0605833 0.0055422
B AP 6 0.0533333 0.0072070 0.4437173

Tb.Sp

Sex Treatment n Mean SEM P Sig
B Veh 6 0.4242667 0.0489468
B AP 6 0.4181667 0.0485401 0.9312342

Plots

plot_groups(F.Met.Tb) |> print_plots()

Cortical

Results

F.Met.Ct <- cort |> 
    filter(Site == "Met")

F.Met.Ct_res <- compare_groups(F.Met.Ct)
print_results(F.Met.Ct_res)

Ct.vBMD

Sex Treatment n Mean SEM P Sig
M Veh 3 976.8301 28.10868
M AP 3 971.5598 12.52560 0.8723318

Ct.Th

Sex Treatment n Mean SEM P Sig
M Veh 3 0.1537694 0.0127316
M AP 3 0.1753586 0.0151205 0.3361194

End.Circ

Sex Treatment n Mean SEM P Sig
M Veh 3 5.176924 0.1880809
M AP 3 5.040476 0.0978681 0.5549024

Peri.Circ

Sex Treatment n Mean SEM P Sig
M Veh 3 6.143086 0.1091875
M AP 3 6.142287 0.0217786 0.9946171

Ct.Po

Sex Treatment n Mean SEM P Sig
M Veh 3 0.4166667 0.0520683
M AP 3 0.5700000 0.0577350 0.1198625

Ct.Po.V

Sex Treatment n Mean SEM P Sig
M Veh 3 0.0018945 0.0002686
M AP 3 0.0029679 0.0005180 0.1396504

Ct.vBMD

Sex Treatment n Mean SEM P Sig
F Veh 3 1026.733 9.273449
F AP 3 1035.355 21.831231 0.7346231

Ct.Th

Sex Treatment n Mean SEM P Sig
F Veh 3 0.1716939 0.0072706
F AP 3 0.1661655 0.0113987 0.7035521

End.Circ

Sex Treatment n Mean SEM P Sig
F Veh 3 4.378283 0.0216160
F AP 3 4.537838 0.2189289 0.5424096

Peri.Circ

Sex Treatment n Mean SEM P Sig
F Veh 3 5.457068 0.0274877
F AP 3 5.581887 0.1493985 0.4574109

Ct.Po

Sex Treatment n Mean SEM P Sig
F Veh 3 0.4500000 0.1126943
F AP 3 0.4166667 0.0290593 0.7887815

Ct.Po.V

Sex Treatment n Mean SEM P Sig
F Veh 3 0.0019526 0.0004102
F AP 3 0.0018369 0.0001779 0.8086217

Data

print_data(F.Met.Ct)
AS Sex Treatment Ct.vBMD Ct.Th End.Circ Peri.Circ Ct.Po Ct.Po.V
1369 M AP 993.8760 0.1598030 5.101290 6.105362 0.57 0.0026796
1420 M AP 950.5446 0.1606772 5.171193 6.180758 0.47 0.0022504
1421 M AP 970.2587 0.2055954 4.848946 6.140740 0.67 0.0039738
1365 M Veh 937.0490 0.1288335 5.532782 6.342267 0.41 0.0016466
1370 M Veh 1031.1211 0.1617731 5.104573 6.121024 0.51 0.0024312
1422 M Veh 962.3201 0.1707016 4.893416 5.965966 0.33 0.0016058
AS Sex Treatment Ct.vBMD Ct.Th End.Circ Peri.Circ Ct.Po Ct.Po.V
1367 F AP 994.8683 0.1454220 4.892437 5.806151 0.37 0.0015111
1368 F AP 1041.4412 0.1683477 4.582989 5.640749 0.47 0.0021235
1371 F AP 1069.7556 0.1847267 4.138088 5.298761 0.41 0.0018762
1366 F Veh 1011.4732 0.1828342 4.336643 5.485424 0.26 0.0012256
1372 F Veh 1043.4922 0.1742175 4.389037 5.483678 0.44 0.0019866
1373 F Veh 1025.2334 0.1580301 4.409169 5.402102 0.65 0.0026455

Combined Sexes

F.Met.Ct |> 
    mutate(Sex = "B") |> 
    compare_groups() |> 
    print_results()

Ct.vBMD

Sex Treatment n Mean SEM P Sig
B Veh 6 1001.782 17.31282
B AP 6 1003.457 18.17114 0.9480782

Ct.Th

Sex Treatment n Mean SEM P Sig
B Veh 6 0.1627317 0.0076848
B AP 6 0.1707620 0.0087142 0.5051941

End.Circ

Sex Treatment n Mean SEM P Sig
B Veh 6 4.777603 0.1976352
B AP 6 4.789157 0.1553507 0.9642461

Peri.Circ

Sex Treatment n Mean SEM P Sig
B Veh 6 5.800077 0.1614513
B AP 6 5.862087 0.1423420 0.7791547

Ct.Po

Sex Treatment n Mean SEM P Sig
B Veh 6 0.4333333 0.0560159
B AP 6 0.4933333 0.0448454 0.4225897

Ct.Po.V

Sex Treatment n Mean SEM P Sig
B Veh 6 0.0019235 0.0002197
B AP 6 0.0024024 0.0003521 0.2753491

Plots

plot_groups(F.Met.Ct) |> print_plots()

Finite Element Analysis

Results

F.Met.FEA <- mfe |> 
    filter(Site == "Met")

F.Met.FEA_res <- compare_groups(F.Met.FEA)
print_results(F.Met.FEA_res)

S

Sex Treatment n Mean SEM P Sig
M Veh 3 21044.60 1047.966
M AP 3 23911.77 2330.997 0.3247147

F.ult

Sex Treatment n Mean SEM P Sig
M Veh 3 62.80777 2.823914
M AP 3 69.97130 6.802546 0.3858295

S

Sex Treatment n Mean SEM P Sig
F Veh 3 19365.07 896.7862
F AP 3 18905.80 560.9074 0.6865443

F.ult

Sex Treatment n Mean SEM P Sig
F Veh 3 57.48377 3.288457
F AP 3 56.71277 1.685434 0.8449172

Data

print_data(F.Met.FEA)
AS Sex Treatment S F.ult
1369 M AP 21953.0 64.8144
1420 M AP 21227.4 61.6466
1421 M AP 28554.9 83.4529
1365 M Veh 19034.1 57.4825
1370 M Veh 21536.9 63.8411
1422 M Veh 22562.8 67.0997
AS Sex Treatment S F.ult
1367 F AP 17811.5 53.5185
1368 F AP 19239.1 57.3774
1371 F AP 19666.8 59.2424
1366 F Veh 20679.9 62.0216
1372 F Veh 19764.1 59.3377
1373 F Veh 17651.2 51.0920

Combined Sexes

F.Met.FEA |> 
    mutate(Sex = "B") |> 
    compare_groups() |> 
    print_results()

S

Sex Treatment n Mean SEM P Sig
B Veh 6 20204.83 722.1727
B AP 6 21408.78 1550.0380 0.4974637

F.ult

Sex Treatment n Mean SEM P Sig
B Veh 6 60.14577 2.274849
B AP 6 63.34203 4.314221 0.5270342

Plots

plot_groups(F.Met.FEA) |> print_plots()

Femoral Diaphysis

Cortical

Results

F.Dia.Ct <- cort |> 
    filter(Site == "Dia")

F.Dia.Ct_res <- compare_groups(F.Dia.Ct)
print_results(F.Dia.Ct_res)

Ct.vBMD

Sex Treatment n Mean SEM P Sig
M Veh 3 1137.277 21.71346
M AP 3 1133.904 13.71586 0.901827

Ct.Th

Sex Treatment n Mean SEM P Sig
M Veh 3 0.2326394 0.0078900
M AP 3 0.2490940 0.0186972 0.4629535

End.Circ

Sex Treatment n Mean SEM P Sig
M Veh 3 3.748416 0.1490889
M AP 3 3.455807 0.1644636 0.2578627

Peri.Circ

Sex Treatment n Mean SEM P Sig
M Veh 3 5.210133 0.1005365
M AP 3 5.020910 0.0478671 0.1644805

Ct.Po

Sex Treatment n Mean SEM P Sig
M Veh 3 0.1533333 0.0233333
M AP 3 0.1666667 0.0272845 0.7291816

Ct.Po.V

Sex Treatment n Mean SEM P Sig
M Veh 3 0.0008395 0.0001341
M AP 3 0.0009083 0.0001101 0.7121445

Ct.vBMD

Sex Treatment n Mean SEM P Sig
F Veh 3 1172.979 20.46769
F AP 3 1171.590 17.20486 0.9610571

Ct.Th

Sex Treatment n Mean SEM P Sig
F Veh 3 0.2383616 0.0037203
F AP 3 0.2191370 0.0050536 0.0375295 *

End.Circ

Sex Treatment n Mean SEM P Sig
F Veh 3 3.159354 0.0908964
F AP 3 3.351772 0.0857982 0.1985396

Peri.Circ

Sex Treatment n Mean SEM P Sig
F Veh 3 4.657024 0.0736718
F AP 3 4.728650 0.0566192 0.4837906

Ct.Po

Sex Treatment n Mean SEM P Sig
F Veh 3 0.1933333 0.0470225
F AP 3 0.1833333 0.0296273 0.8659565

Ct.Po.V

Sex Treatment n Mean SEM P Sig
F Veh 3 0.0009469 0.0002321
F AP 3 0.0008517 0.0001373 0.7419681

Data

print_data(F.Dia.Ct)
AS Sex Treatment Ct.vBMD Ct.Th End.Circ Peri.Circ Ct.Po Ct.Po.V
1369 M AP 1160.917 0.2153298 3.761454 5.114411 0.22 0.0011037
1420 M AP 1124.532 0.2520573 3.408242 4.991965 0.13 0.0007225
1421 M AP 1116.263 0.2798950 3.197723 4.956355 0.15 0.0008986
1365 M Veh 1114.873 0.2196170 3.963176 5.343070 0.11 0.0005901
1370 M Veh 1180.697 0.2314327 3.820176 5.274311 0.19 0.0010498
1422 M Veh 1116.263 0.2468686 3.461896 5.013018 0.16 0.0008787
AS Sex Treatment Ct.vBMD Ct.Th End.Circ Peri.Circ Ct.Po Ct.Po.V
1367 F AP 1137.300 0.2090300 3.514051 4.827425 0.14 0.0006408
1368 F AP 1191.216 0.2241355 3.318934 4.727219 0.17 0.0008048
1371 F AP 1186.254 0.2242455 3.222330 4.631306 0.24 0.0011095
1366 F Veh 1133.066 0.2315014 3.250066 4.704633 0.10 0.0004834
1372 F Veh 1185.063 0.2392965 3.250435 4.753979 0.23 0.0011564
1373 F Veh 1200.808 0.2442869 2.977562 4.512461 0.25 0.0012007

Combined Sexes

F.Dia.Ct |> 
    mutate(Sex = "B") |> 
    compare_groups() |> 
    print_results()

Ct.vBMD

Sex Treatment n Mean SEM P Sig
B Veh 6 1155.128 15.55024
B AP 6 1152.747 12.95527 0.9086635

Ct.Th

Sex Treatment n Mean SEM P Sig
B Veh 6 0.2355005 0.0041056
B AP 6 0.2341155 0.0109497 0.9080676

End.Circ

Sex Treatment n Mean SEM P Sig
B Veh 6 3.453885 0.1531262
B AP 6 3.403789 0.0861573 0.7813682

Peri.Circ

Sex Treatment n Mean SEM P Sig
B Veh 6 4.933579 0.1356594
B AP 6 4.874780 0.0732816 0.7109249

Ct.Po

Sex Treatment n Mean SEM P Sig
B Veh 6 0.1733333 0.0251219
B AP 6 0.1750000 0.0183938 0.9583649

Ct.Po.V

Sex Treatment n Mean SEM P Sig
B Veh 6 0.0008932 0.0001223
B AP 6 0.0008800 0.0000797 0.9297273

Plots

plot_groups(F.Dia.Ct) |> print_plots()

Finite Element Analysis

Results

F.Dia.FEA <- mfe |> 
    filter(Site == "Dia")

F.Dia.FEA_res <- compare_groups(F.Dia.FEA)
print_results(F.Dia.FEA_res)

S

Sex Treatment n Mean SEM P Sig
M Veh 3 25764.43 195.4316
M AP 3 25866.53 1258.3419 0.9430977

F.ult

Sex Treatment n Mean SEM P Sig
M Veh 3 79.75080 0.3700545
M AP 3 79.05753 4.1806658 0.8837801

S

Sex Treatment n Mean SEM P Sig
F Veh 3 22957.43 355.9340
F AP 3 21836.50 180.6018 0.0483942 *

F.ult

Sex Treatment n Mean SEM P Sig
F Veh 3 70.49290 1.4903333
F AP 3 67.18843 0.4500421 0.1010458

Data

print_data(F.Dia.FEA)
AS Sex Treatment S F.ult
1369 M AP 23731.1 72.5613
1420 M AP 25780.9 77.7468
1421 M AP 28087.6 86.8645
1365 M Veh 25405.7 79.0997
1370 M Veh 26078.2 80.3811
1422 M Veh 25809.4 79.7716
AS Sex Treatment S F.ult
1367 F AP 21573.7 66.4246
1368 F AP 22182.5 67.9827
1371 F AP 21753.3 67.1580
1366 F Veh 22832.0 70.7212
1372 F Veh 23627.0 72.9525
1373 F Veh 22413.3 67.8050

Combined Sexes

F.Dia.FEA |> 
    mutate(Sex = "B") |> 
    compare_groups() |> 
    print_results()

S

Sex Treatment n Mean SEM P Sig
B Veh 6 24360.93 653.4057
B AP 6 23851.52 1065.4889 0.6921765

F.ult

Sex Treatment n Mean SEM P Sig
B Veh 6 75.12185 2.181065
B AP 6 73.12298 3.252672 0.6208445

Plots

plot_groups(F.Dia.FEA) |> print_plots()

Lumbar Vertebra

Trabecular

Results

Spine.Tb <- trab |> 
    filter(Site == "Spine")

Spine.Tb_res <- compare_groups(Spine.Tb)
print_results(Spine.Tb_res)

BV/TV

Sex Treatment n Mean SEM P Sig
M Veh 3 18.50667 2.729007
M AP 3 19.88333 1.920498 0.7010951

SMI

Sex Treatment n Mean SEM P Sig
M Veh 3 1.2090000 0.2153279
M AP 3 0.7957667 0.1276412 0.1741153

Tb.N

Sex Treatment n Mean SEM P Sig
M Veh 3 3.359600 0.1352918
M AP 3 3.389533 0.3342937 0.9378375

Tb.Th

Sex Treatment n Mean SEM P Sig
M Veh 3 0.0608000 0.0053678
M AP 3 0.0591667 0.0012863 0.7820276

Tb.Sp

Sex Treatment n Mean SEM P Sig
M Veh 3 0.2971333 0.0092326
M AP 3 0.2987667 0.0317294 0.9629486

BV/TV

Sex Treatment n Mean SEM P Sig
F Veh 3 18.27333 1.803416
F AP 3 17.11000 1.621121 0.6564675

SMI

Sex Treatment n Mean SEM P Sig
F Veh 3 0.9251667 0.0829199
F AP 3 0.8524667 0.1574138 0.7037516

Tb.N

Sex Treatment n Mean SEM P Sig
F Veh 3 6.650367 3.8016284
F AP 3 3.046233 0.2479679 0.4432629

Tb.Th

Sex Treatment n Mean SEM P Sig
F Veh 3 0.0532000 0.0041789
F AP 3 0.0579333 0.0012979 0.34024

Tb.Sp

Sex Treatment n Mean SEM P Sig
F Veh 3 0.2866333 0.0982075
F AP 3 0.3354667 0.0314189 0.660476

Data

print_data(Spine.Tb)
AS Sex Treatment BV/TV SMI Tb.N Tb.Th Tb.Sp
1369 M AP 22.89 0.6210 4.0468 0.0603 0.2357
1420 M AP 16.31 1.0443 2.9548 0.0566 0.3364
1421 M AP 20.45 0.7220 3.1670 0.0606 0.3242
1365 M Veh 13.05 1.6310 3.0971 0.0506 0.3155
1370 M Veh 21.34 0.9236 3.5477 0.0688 0.2896
1422 M Veh 21.13 1.0724 3.4340 0.0630 0.2863
AS Sex Treatment BV/TV SMI Tb.N Tb.Th Tb.Sp
1367 F AP 14.47 0.9893 2.5507 0.0604 0.3983
1368 F AP 20.06 0.5385 3.3113 0.0574 0.3034
1371 F AP 16.80 1.0296 3.2767 0.0560 0.3047
1366 F Veh 21.88 0.9869 14.2270 0.0467 0.1110
1372 F Veh 16.44 0.7610 2.3115 0.0610 0.4506
1373 F Veh 16.50 1.0276 3.4126 0.0519 0.2983

Combined Sexes

Spine.Tb |> 
    mutate(Sex = "B") |> 
    compare_groups() |> 
    print_results()

BV/TV

Sex Treatment n Mean SEM P Sig
B Veh 6 18.39000 1.463790
B AP 6 18.49667 1.283681 0.9573871

SMI

Sex Treatment n Mean SEM P Sig
B Veh 6 1.0670833 0.1211463
B AP 6 0.8241167 0.0915152 0.1406183

Tb.N

Sex Treatment n Mean SEM P Sig
B Veh 6 5.004983 1.8535355
B AP 6 3.217883 0.2013475 0.3808612

Tb.Th

Sex Treatment n Mean SEM P Sig
B Veh 6 0.05700 0.0034847
B AP 6 0.05855 0.0008625 0.6820046

Tb.Sp

Sex Treatment n Mean SEM P Sig
B Veh 6 0.2918833 0.0441758
B AP 6 0.3171167 0.0215899 0.6189629

Plots

plot_groups(Spine.Tb) |> print_plots()

Finite Element Analysis

Results

Spine.FEA <- mfe |> 
    filter(Site == "Spine")

Spine.FEA_res <- compare_groups(Spine.FEA)
print_results(Spine.FEA_res)

S

Sex Treatment n Mean SEM P Sig
M Veh 3 13246.1 1149.798
M AP 3 13017.8 1173.430 0.8961932

F.ult

Sex Treatment n Mean SEM P Sig
M Veh 3 36.85257 3.070702
M AP 3 36.39053 3.334880 0.9237248

S

Sex Treatment n Mean SEM P Sig
F Veh 3 11666.43 972.0170
F AP 3 13255.10 668.2957 0.2492934

F.ult

Sex Treatment n Mean SEM P Sig
F Veh 3 32.28470 2.637888
F AP 3 36.62237 2.102163 0.2678456

Data

print_data(Spine.FEA)
AS Sex Treatment S F.ult
1369 M AP 14381.1 40.1282
1420 M AP 10681.8 29.7377
1421 M AP 13990.5 39.3057
1365 M Veh 11480.0 32.2571
1370 M Veh 15404.6 42.6786
1422 M Veh 12853.7 35.6220
AS Sex Treatment S F.ult
1367 F AP 11921.5 32.4752
1368 F AP 13844.5 38.0976
1371 F AP 13999.3 39.2943
1366 F Veh 12449.0 34.2131
1372 F Veh 12816.3 35.5733
1373 F Veh 9734.0 27.0677

Combined Sexes

Spine.FEA |> 
    mutate(Sex = "B") |> 
    compare_groups() |> 
    print_results()

S

Sex Treatment n Mean SEM P Sig
B Veh 6 12456.27 760.3537
B AP 6 13136.45 606.2401 0.5002159

F.ult

Sex Treatment n Mean SEM P Sig
B Veh 6 34.56863 2.078654
B AP 6 36.50645 1.763743 0.4934292

Plots

plot_groups(Spine.FEA) |> print_plots()