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 <pdalgd@gmail.com> wrote:

>
> 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 <annie.zhang2010@gmail.com> 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
>
> --
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Email: pd.mes@cbs.dk  Priv: PDalgd@gmail.com
> "Døden skal tape!" --- Nordahl Grieg
>
>
>
>
>
>
>
>

	[[alternative HTML version deleted]]

