R-beta: S Compatibility (again)

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Mon Apr 13 22:08:42 CEST 1998


Luke Tierney <luke at stat.umn.edu> writes:

> a much simpler definition is
> 
> pdf.order<-
> function (n, r, pfun, dfun) 
> {
>   con <- round(exp(lgamma(n + 1) - lgamma(r) - lgamma(n - r + 1)))
>   function(x) {
>     Fx <- pfun(x)
>     con * Fx^(r - 1) * (1 - Fx)^(n - r) * dfun(x)
>   }
> }
> 
> > pdf.order(9, 5, pnorm, dnorm)(0)
> [1] 0.981772

Duh.... 

Yes, of course! 

I was thinking in terms of obtaining the substitute() functionality,
not getting the job done.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list