# Hypothesis testing with the geometric distribution for dummies

I'm a newbie at stats and I need some help. Can anybody tell me, in the most "stupid friendly" way, how to perform hyphotesis testing with a geometric distribution for 2 samples? please take into account that, until a month ago, Statistics for me was mean, mode and std dev...

• Testing what hypothesis? Equality of $p$ parameter? Something else? – Glen_b Apr 9 '14 at 23:17

## 1 Answer

I'm going to assume you want to test equality of the $p$ parameter against the two sided alternative.

The usual way to construct a test would be to make a test statistic from the likelihood ratio, but it's not the only choice.

The LRT takes the ratio of the likelihood for the null to the likelihood for the alternative.

To go into details of the calculation, it would help if you said which of the two common forms of geometric you were looking at - the "number of failures" or the "number of trials" version. (Otherwise you'll be reading through two sets of explanations only one of which is of interest to you.)

Frankly, if I was trying to do such a problem, I'd actually do it using a GLM (which will take care of the LRT calculations).

Specifically, I'd do it in R using the negative binomial functions for GLMs supplied in the package MASS (which comes with R) such as glm.nb to fit the GLM (and possibly anova.negbin to do testing, though in your particular example one can get it from the glm summary output). For those, you can supply the parameter of the negative binomial which specifies the geometric.