Skip to content

Commit

Permalink
refactor theoretical.df
Browse files Browse the repository at this point in the history
  • Loading branch information
phelps-sg committed Dec 29, 2023
1 parent 28d43ba commit 4acd303
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions jupyter-book/R-MixedModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,13 @@
}

theoretical.df <- function(group) {
generate.data <- function(frequencies) theoretical.data(group, frequencies)
case_when(
group == 'Selfish' ~ theoretical.data('Selfish', c(0, 0, 0, 0)),
group == 'Cooperative' ~ theoretical.data('Cooperative', c(1/6, 3/6, 1, 1)),
group == 'Competitive' ~ theoretical.data('Competitive', c(1/6, 1/6, 1/6, 1/6)),
group == 'Altruistic' ~ theoretical.data('Altruistic', c(1, 1, 1, 1)),
group == 'Control' ~ theoretical.data('Control', c(NA, NA, NA, NA))
group == 'Selfish' ~ generate.data(c(0, 0, 0, 0)),
group == 'Cooperative' ~ generate.data(c(1/6, 3/6, 1, 1)),
group == 'Competitive' ~ generate.data(c(1/6, 1/6, 1/6, 1/6)),
group == 'Altruistic' ~ generate.data(c(1, 1, 1, 1)),
group == 'Control' ~ generate.data('Control', c(NA, NA, NA, NA))
)
}

Expand Down

0 comments on commit 4acd303

Please sign in to comment.