R/p2_fun.R

Defines functions p2_fun

Documented in p2_fun

p2_fun <-
function(p1, theta){
  
  Q1j = cumsum(p1)
  Q2j = Q1j / (Q1j+(1-Q1j)*exp(-theta))
  
  p2 = c(Q2j[1], diff(Q2j))
  return(p2)
}

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.