# This is the definition of a 'naive' p-value based on a Z-test for a one-armed trial
PValue(
g1 = \(smean1, n1, sigma, ...) pnorm(smean1*sqrt(n1)/sigma, lower.tail=FALSE),
g2 = \(smean1, smean2, n1, n2, ...) pnorm((n1 * smean1 + n2 * smean2)/(n1 + n2) *
sqrt(n1+n2)/sigma, lower.tail=FALSE),
label="My custom p-value")
Run the code above in your browser using DataLab