I am a newbie to R and am stuck and would appreciate any help. I have a nonlinear function of the form:
f <- function (p2){ p_hat=(n1*p1+n2*p2)/(n1+n2)