Skip to content

enhancement: interpolate to get parameters for 80% power across arrays #9

Description

@ejh243

As we don't test every possible value of the parameters, we don't know exactly when we cross the 80% threshold. I wrote some code to use interpolation to calculate a more specific sample size (for example) when the threshold is crossed. I haven't used it because currently it doesn't match up with what the plotting function does, but thought I would record it here as a suggestion for improvement.

# interpolate to get values for minimum 80% power
outPowerCalcs<-rep( NA, length = ncol(allProps)-1)
  for(i in 2:ncol(allProps)){
    overIndex <- which(allProps[,i] > 0.8)[1]
    underIndex <- overIndex-1
    interDist <- (0.8-allProps[underIndex,i])/(allProps[overIndex,i] - allProps[underIndex,i])
    outPowerCalcs[ i - 1] <- allProps[underIndex,1] + (allProps[overIndex,1] - allProps[underIndex,1])*interDist
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions