Thanks Eik... ..the uniroot() was the function I was looking for. Best regards, /J
On Thu, Dec 12, 2013 at 4:27 PM, Eik Vettorazzi <e.vettora...@uke.de> wrote: > Assuming r, sd1 and sd2 as known(fixed) components, this works: > > X <- pnorm(q=q,sd=sd1)*r+pnorm(q=q,sd=sd2)*(1-r) > > uniroot(function(x)pnorm(q=x,sd=sd1)*r+pnorm(q=x,sd=sd2)*(1-r)-X,c(-1e6,1e6)) > > > Cheers > > Am 12.12.2013 15:58, schrieb Johannes Radinger: > > Thanks for the fast response. Of course I totally overlooked qnorm as I > had > > a more complex task in my head. > > > > I wanted to reverse following equation: > > r=0.67 > > q=-150 > > sd1=100 > > sd2=1000 > > > > X <- pnorm(q=q,sd=sd1)*r+pnorm(q=q,sd=sd2)*(1-r) > > > > Maybe its mathematically really easy, but somehow I don't get it how to > do > > reverse and provide X and > > get q especially with the presence of r respectively as weighting factors > > for the two distributions. > > > > /J > > > > > > On Thu, Dec 12, 2013 at 3:09 PM, Dániel Kehl <ke...@ktk.pte.hu> wrote: > > > >> Looks like homework. > >> > >> Try ?qnorm > >> ________________________________________ > >> Feladó: r-help-boun...@r-project.org [r-help-boun...@r-project.org] ; > >> meghatalmazó: Johannes Radinger [johannesradin...@gmail.com] > >> Küldve: 2013. december 12. 14:56 > >> To: R help > >> Tárgy: [R] Solving a normal distribution pnorm for q > >> > >> Hi, > >> > >> > >> > >> I found follwowing example of pnorm here: > >> > >> > >> > http://www.r-tutor.com/elementary-statistics/probability-distributions/normal-distribution > >> > >> > >> > >> Problem > >> > >> Assume that the test scores of a college entrance exam fits a normal > >> distribution. Furthermore, the mean test score is 72, and the standard > >> deviation is 15.2. What is the percentage of students scoring 84 or > more in > >> the exam? > >> > >> > >> > >> Solution > >> > >>> pnorm(84, mean=72, sd=15.2, lower.tail=FALSE) > >> > >> [1] 0.21492 > >> > >> > >> > >> That is straight forward, however what if I want to know the score the > best > >> 30% students are reaching at least. So I know the solution of pnorm but > >> want to know its q. How can that be achieved in R? > >> > >> > >> > >> Any suggestions? > >> > >> > >> > >> /Johannes > >> > >> [[alternative HTML version deleted]] > >> > >> ______________________________________________ > >> R-help@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. > >> > > > > [[alternative HTML version deleted]] > > > > > > > > ______________________________________________ > > R-help@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. > > > > -- > Eik Vettorazzi > Institut für Medizinische Biometrie und Epidemiologie > Universitätsklinikum Hamburg-Eppendorf > > Martinistr. 52 > 20246 Hamburg > > T ++49/40/7410-58243 > F ++49/40/7410-57790 > -- > > Besuchen Sie uns auf: www.uke.de > _____________________________________________________________________ > > Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen > Rechts; Gerichtsstand: Hamburg > Vorstandsmitglieder: Prof. Dr. Christian Gerloff (Vertreter des > Vorsitzenden), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik > _____________________________________________________________________ > > SAVE PAPER - THINK BEFORE PRINTING > > [[alternative HTML version deleted]]
______________________________________________ R-help@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.