Skip to content

Commit

Permalink
Fixed breathing freq for simple FX (#12)
Browse files Browse the repository at this point in the history
Others won't be fixed because the result doesn't change, and all
formulas will be changed anyway for #11.
  • Loading branch information
wleoncio committed Jan 24, 2025
1 parent 346c921 commit 73d7318
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/groups.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
simple <- group(
haukeland_vyntus = c(0.3652, 0.0499, 0.5820, 0.0029),
haukeland = 0.4151,
vyntus = 0.0528,
haukeland = c("0" = 0.5849, "1" = 0.4151),
vyntus = c("0" = 0.9472, "1" = 0.0528),
beta_hat = list(
vo2_ml_min = c(
0.0155584, 0.4371531, 0.0009139, -0.1803019, 0.102317, 3.760053
Expand Down Expand Up @@ -81,15 +81,15 @@ simple <- group(
weighted.mean(results, .self$haukeland_vyntus)
},
breathing_frequency = function(.self, person) {
results = apply(.self$grid, 1, function(config) {
results = apply(expand.grid(0:1), 1, function(config) {
(
- 0.0114363 * person$height
+ 0.0007431 * person$height * person$sex
- 0.1421088 * config["haukeland"]
- 0.1421088 * config
+ 6.693345
) ^ (1 / 0.4)
})
weighted.mean(results, .self$haukeland_vyntus)
weighted.mean(results, .self$haukeland)
}
)

Expand Down

0 comments on commit 73d7318

Please sign in to comment.