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]]
The diff function would be helpful. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil@dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. 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 [[alternative HTML version deleted]] _____________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]]
Sigh.... Homework? -- Bert On Thu, Sep 8, 2011 at 6:47 PM, annie Zhang <annie.zhang2010 at 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 > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
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 at 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 at cbs.dk Priv: PDalgd at gmail.com "D?den skal tape!" --- Nordahl Grieg