Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visual_power hard coded for m = 20 #16

Open
emitanaka opened this issue Oct 25, 2020 · 3 comments
Open

visual_power hard coded for m = 20 #16

emitanaka opened this issue Oct 25, 2020 · 3 comments

Comments

@emitanaka
Copy link
Contributor

The power calculation looks like it is hardcoded for when the lineup size is 20? The 19 below should be m-1 I think?

visual_power <- function(data, m=20) {
  pic_id <- NULL
  detected <- NULL
  nchoices_wgt <- NULL

  data <- data %>% mutate(
    nchoices_wgt = (m-lengths(strsplit(as.character(data$response), ",")))/19) #<<
  visual_p <- data %>% group_by(pic_id) %>%
    summarise(power = sum(detected*nchoices_wgt)/length(detected), n=length(detected))
  return(visual_p)
}
@heike
Copy link
Collaborator

heike commented Oct 25, 2020 via email

@dicook
Copy link
Owner

dicook commented Oct 25, 2020

The simple fix is done. Thanks @emitanaka

@dicook
Copy link
Owner

dicook commented Oct 25, 2020

@heike do you have the formula for multiple targets? This code is very specifically geared to the early experiments, assuming the data structure contains pic_id, detected, mchoices_wgt, too. I'd forgotten that I added this function - I put it in because how to make the calculation was a bit hidden in the published papers. It could be better written generally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants