Re: [R] How to do a target value search analogous to Excel Solver

2011-11-07 Thread jolo999
Works fine. Thanks for the quick reply!! -- View this message in context: http://r.789695.n4.nabble.com/How-to-do-a-target-value-search-analogous-to-Excel-Solver-tp3998347p3998729.html Sent from the R help mailing list archive at Nabble.com. __ R-help@

Re: [R] How to do a target value search analogous to Excel Solver

2011-11-07 Thread Joshua Wiley
Hi, Try this: set.seed(1) z <- rnorm(1,0,1) y <- function(x, z, xc){2*x - 1 + z - xc} ## uniroot finds a 0 value, so offset function by 5.5 uniroot(y, z = z, xc = 5.5, interval = c(-100, 100)) ## use the root and now no offset y(3.563227, z, 0) see ?uniroot for help Cheers, Josh On Mon, Nov