Re: [R] Finding points with equal probability between normaldistributions

From: Dimitris Rizopoulos <dimitris.rizopoulos_at_med.kuleuven.be>
Date: Mon 07 Aug 2006 - 21:18:50 EST

if you want to base it on Normality, then you can use:

prob <- function(x){

    dnorm((x - 5.2) / 2.1) / 2.1 - dnorm((x - 4.2) / 1.1) / 1.1 }

uniroot(prob, c(-3, 3))

otherwise if you want to estimate it you can use Uwe's solution.

I hope it helps.

Best,
Dimitris



Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium

Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


> Dear mailing list,
>
> For two normal distributions, e.g:
>
> r1 =rnorm(20,5.2,2.1)
> r2 =rnorm(20,4.2,1.1)
> plot(density(r2), col="blue")
> lines(density(r1), col="red")
>
> Is there a way in R to compute/estimate the point(s) x where the
> density of the
> two distributions cross (ie where x has equal probability of
> belonging to
> either of the two distributions)?
>
> Many Thanks
>
> Eleni Rapsomaniki
> PhD student
> Birkbeck College, UK
>
> ______________________________________________
> 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.
>

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



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 00:25:40 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 - 02:21:20 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.