Re: R-beta: S Compatibility (again)

Peter Dalgaard BSA (p.dalgaard@biostat.ku.dk)
13 Apr 1998 22:08:42 +0200


To: Luke Tierney <luke@stat.umn.edu>
Subject: Re: R-beta: S Compatibility (again)
From: Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk>
Date: 13 Apr 1998 22:08:42 +0200
In-Reply-To: Luke Tierney's message of Mon, 13 Apr 1998 10:54:14 -0500 (CDT)

Luke Tierney <luke@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@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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._