Re: [R] help with R

From: John Fox <jfox_at_mcmaster.ca>
Date: Sat, 12 Jun 2010 21:09:03 -0400

Dear Hannah,

If I understand you correctly, you want a solution when rho is 0.5; if so,

> f <- function(x){
+ pnorm(-x)*pnorm((0.5*dnorm(x)/pnorm(x)-x)/sqrt(1-0.5^2)) - 0.05 + }

> uniroot(f, c(-3, 3))

$root
[1] 0.8031289

$f.root
[1] -1.565857e-06

$iter
[1] 11

$estim.prec
[1] 6.103516e-05

I hope this helps,
 John



John Fox
Senator William McMaster
  Professor of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox

> -----Original Message-----
> From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org]
On
> Behalf Of li li
> Sent: June-12-10 8:31 PM
> To: r-help
> Subject: [R] help with R
>
> Hi all,
> I want to solve the following equation for x with rho <- 0.5
>
> pnorm(-x)*pnorm((rho*dnorm(x)/pnorm(x)-x)/sqrt(1-rho^2))==0.05
>
> Is there a function in R to do this?
>
> Thank you very much!
> Hannah
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org 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_at_r-project.org 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 Sun 13 Jun 2010 - 01:11:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 13 Jun 2010 - 01:20:30 GMT.

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

list of date sections of archive