R/pq_fun.R

Defines functions pq_fun

Documented in pq_fun

pq_fun <-
function(p1, p2){
  
  k = length(p1)
  res <- sapply(1:(k-1), function(i) sum(p1[(i+1):k]) + p1[i] * 0.5)
  res <- c(res, p1[k] * 0.5)
  return(res)
}

Try the OptOTrials package in your browser

Any scripts or data that you put into this service are public.

OptOTrials documentation built on Sept. 9, 2025, 5:46 p.m.