[R] function to solve equations

Yash Gandhi yashman84 at yahoo.com
Thu Sep 10 21:35:19 CEST 2009


Hi, 

I am trying to solve this equation prob = exp(-3.33 + 0.0102*x)/(1+exp(-3.33 + 0.0102*x)). I want to write a function where I call the function and enter the 'prob' value and the output should be the 'x'. Im not sure how to write this. I have a basic structure but im not sure if its correct. 

calc <- function(prob){
prob <- exp(-3.33+0.0102*x)/(1+exp(-3.33 + 0.0102*x))
solve(prob)
x
}

Thanks

Yash Gandhi




More information about the R-help mailing list