1

I want to ask what ways are useful for finding distribution of my data. My data looks like : City - count of votes for president in the election in this town.

I´m using R studio for my work and I don´t know, how to find if my data are from Poisson distribution.

Thanks for help

Severin Pappadeux
  • 18,636
  • 3
  • 38
  • 64
Gyrphos I
  • 11
  • 1
  • It is always good practice to add [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). This will attract people more to think about your problem. But als have a look [here](https://stackoverflow.com/questions/31741742/how-to-identify-the-distribution-of-the-given-data-using-r) where you might find an answer. – MarBlo Jul 01 '20 at 17:24
  • http://www.di.fc.ul.pt/~jpn/r/distributions/fitting.html this could help you. – jandraor Jul 01 '20 at 17:49

1 Answers1

0

For Poisson distribution mean is equal to variance. Compute mean and variance of your data and see if they're close

Example

q <- rpois(10000, 3.3)
mean(q)

output

[1] 3.2973

sd(q)^2

[1] 3.225435

var(q)

[1] 3.225435

Close enough?

After that you could use some standard test like Kolmogorov-Smirnov

Severin Pappadeux
  • 18,636
  • 3
  • 38
  • 64
  • I don't think that this is the right way to detect the distribution shape. Consider you have a data set like this `set.seed(12)` , `data <- cos(runif(1000,-10,10) * sin( rnorm(1000,4,2)))`. We can normalize the data like this `data = 2*(data - mean(data))/sd(data) + 4` . After getting our new data if we call `mean(data)` and `var(data)` , not surprisingly we get **4**. So the mean and the variance of the data is exactly the same. But is it a poisson distiribution? `hist(data,40)` tells no. – maydin Jul 01 '20 at 17:51
  • @maydin Nevertheless, that is where I would start - it is very simple check and if mean differs from variance - you don't have Poisson, no need to run other tests – Severin Pappadeux Jul 01 '20 at 17:53
  • For a starting purpose. You are totaly right! I just misunderstood. – maydin Jul 01 '20 at 17:56