[R] finding ncp for t distribution

Dimitris Rizopoulos dimitris.rizopoulos at med.kuleuven.be
Thu Mar 2 10:17:07 CET 2006


you could try the following:

f <- function(delta, pr, x, df) pt(x, df = df, ncp = delta) - pr
out <- uniroot(f, c(0, 37.62), pr = 0.18, x = 0.9, df = 4)
##########3
out$root
pt(0.9, 4, out$root)


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://www.med.kuleuven.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "Matthieu Dubois" <Matthieu.Dubois at psp.ucl.ac.be>
To: <r-help at stat.math.ethz.ch>
Sent: Thursday, March 02, 2006 9:39 AM
Subject: [R] finding ncp for t distribution


> Dear R-users,
>
>
> I am wondering whether R implements a function returning the non 
> central
> parameter of a t distribution (equivalent of the TnoncT function 
> from
> SAS), given /x/ a value from a t distribution, /df /the  degrees of
> freedom and /p/ the probability of x under this  distribution.
>
>
> Thanks  a lot,
>
>
> Matthieu
>
>
> --
>
> Matthieu Dubois, /Ph.D/. /Student/
>
> Cognitive Neuroscience Unit, UCL, Belgium
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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
> 


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




More information about the R-help mailing list