Paul Bernal
2020-Jul-22 02:26 UTC
[R] Testing wether my dataset follows a poisson distribution with R
Dear friends, I have a sample dataset, which is basically the number of transits through a particular waterway, and is on a daily basis. MyDat <- dataset$DailyTransits What I?d like to do is to test whether MyDat follows a poisson distribution or not. What R function could accomplish this? Any help and/or guidance will be greatly appreciated, Best regards, Paul [[alternative HTML version deleted]]
David Winsemius
2020-Jul-22 03:03 UTC
[R] Testing wether my dataset follows a poisson distribution with R
Your first check might be to see in the mean and sd are "reasonably" close. Next approach would be to see if the `qqplot` of that vector has an arguably straight-line relationship with a random draw from a Poisson random generator function with the same mean. ?rpois ?qqplot And do remember that Rhelp is a plain-text mailing list. -- David On 7/21/20 7:26 PM, Paul Bernal wrote:> Dear friends, > > I have a sample dataset, which is basically the number of transits through > a particular waterway, and is on a daily basis. > > MyDat <- dataset$DailyTransits > > What I?d like to do is to test whether MyDat follows a poisson distribution > or not. What R function could accomplish this? > > Any help and/or guidance will be greatly appreciated, > > Best regards, > > Paul > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.
Bert Gunter
2020-Jul-22 04:50 UTC
[R] Testing wether my dataset follows a poisson distribution with R
That is logically impossible. You can only show that there is insufficient evidence (according to whatever evidentiary criterion you have chosen) to show that the data were *not* a (iid or other) sample from a Poisson. This may seem esoteric, but it is not. (The simplest incantation is that you can reject, but not accept a hypothesis in the classical N-P frequentist framework ). Given sufficient data, you will almost always have enough evidence to be formally inconsistent with any prechosen model/distribution. This does not mean that the model is not useful, however. Further discussion would meander even farther offtopic. These are statistical (and philosophy of science) issues that don't properly belong here. Mea culpa. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Jul 21, 2020 at 7:27 PM Paul Bernal <paulbernal07 at gmail.com> wrote:> Dear friends, > > I have a sample dataset, which is basically the number of transits through > a particular waterway, and is on a daily basis. > > MyDat <- dataset$DailyTransits > > What I?d like to do is to test whether MyDat follows a poisson distribution > or not. What R function could accomplish this? > > Any help and/or guidance will be greatly appreciated, > > Best regards, > > Paul > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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]]
Rolf Turner
2020-Jul-22 11:31 UTC
[R] [FORGED] Testing wether my dataset follows a poisson distribution with R
On 22/07/20 2:26 pm, Paul Bernal wrote:> Dear friends, > > I have a sample dataset, which is basically the number of transits through > a particular waterway, and is on a daily basis. > > MyDat <- dataset$DailyTransits > > What I?d like to do is to test whether MyDat follows a poisson distribution > or not. What R function could accomplish this? > > Any help and/or guidance will be greatly appreciated,I presume (your question is a bit vague) that you want to do a goodness of fit test of the Poisson distribution to your data. Doing such a test would, I think, involve the assumption that your observations are independent and identically distributed (i.i.d.). Since you appear to have a time series of daily counts, this assumption is unlikely to be valid. Modelling such a time series and investigating whether the underlying marginal distributions are Poisson is likely to be a fairly subtle problem. Others may be able to offer more insight here. However such a discussion would be about statistical theory and methodology and hence inappropriate for this list. If you make the (likely to be untenable) assumption that your data are i.i.d. then such a g.o.f. test is probably most appropriately done using a chi-squared goodness of fit test. The function chisq.test() would help you. Getting the details right may prove a bit tricky, but if you can't handle that, then you should probably seek "local" statistical advice. In fact, you should (in view of the likely lack of independence of your data) seek local statistical advice in any case. cheers, Rolf Turner P.S. Please note that it's "whether" not "wether". (A wether is a castrated ram.) Also "Poisson" should be capitalised. (It's a bloke's name.) R. T. -- Honorary Research Fellow Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276