Re: [R] get mean from cdf

2011-09-09 Thread annie Zhang
Thanks all for your replies. Your responses are very helpful. But it is indeed not my homework! I didn't know these functions, and wanted to avoid the loop. Annie On Fri, Sep 9, 2011 at 1:38 AM, peter dalgaard wrote: > > On Sep 9, 2011, at 03:51 , Jeff Newmiller wrote: > > > The diff function w

Re: [R] get mean from cdf

2011-09-08 Thread peter dalgaard
On Sep 9, 2011, at 03:51 , Jeff Newmiller wrote: > The diff function would be helpful. ...or not: > sum(ppois(0:1000, lambda=2.345, lower=F)) [1] 2.345 (if this was homework: the hard bit is to figure out _why_ this works.) > annie Zhang wrote: > > Hi All, > > How can I get the expected v

Re: [R] get mean from cdf

2011-09-08 Thread Bert Gunter
Sigh Homework? -- Bert On Thu, Sep 8, 2011 at 6:47 PM, annie Zhang wrote: > Hi All, > > How can I get the expected value from a discrete cdf? Is there any R > function that can do this? > > Thanks, > Annie > >        [[alternative HTML version deleted]] > > __

Re: [R] get mean from cdf

2011-09-08 Thread Jeff Newmiller
The diff function would be helpful. --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Contro