Re: [R] finding x values to meet a y

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Tue 08 Aug 2006 - 16:43:24 EST

Antonio Olinto wrote:
> Hi,
>
> I'd like to find which values of x will give me a y.
>
> In other words, in the example of a gaussian curve, I want to find the values of
> x that will give me a density, let's say, of 0.02.
>
> curve(((1/(sqrt(2*pi)*10))*exp(-((x-50)^2)/(2*10^2))),xlim=c(0,100))

Numerical optimization might help:

optimize(

   function(x) (1/(sqrt(2*pi)*10) * exp(-((x-50)^2)/(2*10^2)) - 0.02)^2,    interval = c(0, 50))

Uwe Ligges

> Thanks for any help,
>
> Antonio Olinto
>
>
>
>
> -------------------------------------------------
> WebMail Bignet - O seu provedor do litoral
> www.bignet.com.br
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue Aug 08 16:47:50 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 08 Aug 2006 - 18:19:18 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.