mle for the binomial distributed data (number of boys in families) For example I have following dataset of number of boys in families that have 5 kids:

*

*0 boy - 34 (number of such families)

*1 boy - 128 families

*2 boys - 233 families

*3 boys - 267 families

*4 boys - 144 families

*5 boys - 55 families

I want to test if this distribution fits to the binomial.  For this procedure I will use chi-squared test.
But first of all I need to estimate the the parameter $p$ of binomial distribution.  Other parameter $n$ is given (which is 5, of course).  We know, that the mle of binomial distribution is $ \frac{x}{n}$ or $ \sum_{i=0}^n \frac{x_i}{n}$
But I can't understand how can we get the precise mle of binomial distribution (in number), in order to calculate the expected number of boys in $n$ families (by the binomial distribution)
P.S The probability of born the boy is equal to all families
 A: You (null) model is $X \sim \mathcal{Binom}(5,p)$ and to estimate $p$ you just sum up the number of boys, the number of children and divide. In R:
xs <- 0:5
Ns <- c(34, 128, 233, 267, 144, 55)
boys <- sum(xs*Ns)
children <- 5*sum(Ns)
phat <- boys/children

Then you want to test if the distribution really is binomial, that is, that the assumption of a constant probability $p$ over families is reasonable. First, let us try simulation, and visualize the results. I simulate 19 times from the estimated binomial distribution, and plot the results together with the data:

Your given data is in red, and it does not look like a typical sample distribution, as judged by the simulations! So there is some reason for doubt ...
I will leave the chisquare test for you, here is another approach ...
A: To do a chi-square test, one can create a reference binomial population and compare with own test population. The code in R can be:
> pop = c(34,128,233,267,144,55)  # own test population
> N = sum(pop)
> ref = rbinom(N, 5, 0.5)         # reference binomial population
> tab = table(ref)                # tabulate
> tab
ref
  0   1   2   3   4   5 
 25 131 291 268 121  25 
> chisq.test(pop, tab)

Output:
    Pearson's Chi-squared test

data:  pop and tab
X-squared = 24, df = 20, p-value = 0.2424

Warning message:
In chisq.test(pop, tab) : Chi-squared approximation may be incorrect

So, your population is likely to have binomial distribution.
