Sign up ×
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.

I have a series of non-negative integers $y=(y_1,y_2,..., y_n)$ and a design matrix $y = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_3 x_1 x_2$, where $x_0$ and $x_1$ are $0$ or $1$, $x_1x_2$ is the interaction, and $\beta_0 \ldots \beta_3$ are parameters we want to estimate. For example, the data look like

y    x1    x2    x1*x2
10   0     0     0
23   0     1     0
18   1     1     1
19   1     0     0
25   0     1     0

I want to estimate the $\beta_0$, $\beta_1$, $\beta_2$ and $\beta_3$ coefficients and perform a test to see if any coefficient is nonzero.

There are several different regression models that might be applied to this case:

  1. Simple linear regression: lm
  2. Poisson regression (when $y$ follows a Poisson distribution): glm with family = poisson
  3. Quasi-poisson regression (when $y$ is over-dispersed; that means $\text{sd}(y) \gt \text{mean}(y)$): glm with family = quasi-poisson
  4. Negative binomial regression (when $y$ is over-dispersed, $\text{sd}(y) \gt \text{mean}(y)$): glm.nb, in MASS package.

The questions I want to ask are:

  1. How should I select the model for this dataset? Is there any way to choose the right model based on some descriptive statistics of my dataset?
  2. How should I check and validate if the fitted selected model is right for my data?

Thanks everyone.

share|improve this question
This is off topic on a programming Q&A site. You should ask at a stats site. – David Heffernan Oct 2 '11 at 15:47
Could you specify what kind of outcome ($y$) you are studying? It might further help to decide among the various modeling strategies you proposed, or suggest other ones. – chl Oct 3 '11 at 11:57
It looks like you're overthinking this one. You have only four distinct categories, corresponding to $(x_1,x_2) \in \{(0,0),(0,1),(1,0),(1,1)\}$. Allowing four parameters is tantamount to fitting the $y$'s separately in each category. Therefore you really have four independent problems and each of them reduces to summarizing a univariate dataset. Where to go from here depends on the nature of the $y$'s and the purpose of the model, neither of which is apparent in the question. – whuber Oct 21 '11 at 20:24
Use a random forest? – Jase Feb 8 '14 at 7:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.