In the "MASS" library there is a data set called "menarche", there are 3 variables:
1) "Age" (average age of age homogeneous groups of girls),
2) "Total" (number of girls in each group),
3) "Menarche" (number of girls in the group who have reached menarche)
Don't be awkward for this data, most of us are over 18 to use R/SAS.

1). glm( ) is the function used to
do generalized linear models. With "family=" set to "binomial" with a "logit" link, glm( )
produces a logistic regression.
Because we are using glm( ) with binomial
errors in the response variable, the ordinary assumptions of least squares
linear regression (normality and homoscedasticity) don't apply.

2. our data frame does not contain a row for every case (i.e., every girl upon whom
data were collected). Therefore, we do not have a binary (0,1) coded response
variable. However, No problem! If we feed glm( ) a table (or matrix) in which the
first column is number of successes and the second column is number of
failures, R will take care of the coding for us. In the above analysis, we made
that table on the fly inside the model formula by binding "Menarche" and
"Total − Menarche" into the columns of a table using
cbind( ).

Let's look at how closely the fitted values from our logistic regression
match the observed values...

The following requests also produce useful results: glm.out$coef,
glm.out$fitted, glm.out$resid, glm.out$effects, and anova(glm.out).

Recall that the response variable is log odds, so the coefficient of "Age"
can be interpreted as "for every one year increase in age the odds of having
reached menarche increase by exp(1.632) = 5.11 times."

To evaluate the overall performance of the model, look at the null deviance
and residual deviance near the bottom of the print out. Null deviance shows how
well the response is predicted by a model with nothing but an intercept (grand
mean). This is essentially a chi square value on 24 degrees of freedom(p-value will be very small due to the large deviance), and
indicates very little fit (a highly significant difference between fitted values
and observed values); which means the null model is not good.

Adding in our predictors--just "Age" in this case--decreased
the deviance by 3667 points on 1 degree of freedom. Again, this is interpreted
as a chi square value and indicates a highly significant decrease in deviance.
The residual deviance is 26.7 on 23 degrees of freedom. We use this to test the
overall fit of the model by once again treating this as a chi square value. A
chi square of 26.7 on 23 degrees of freedom yields a p-value of 0.269. The null
hypothesis (i.e., the model) is not rejected. The fitted values are not
significantly different from the observed values.
The copyright of this tutorial is from Prof. King.