Solution (source code)

= Solution

The first fit is a <Bernoulli logistic-regression model> for the probability of a positive response. Its fitted <linear predictor> is
$$
\widehat\eta=-9.772794+0.103181\,\mathrm{npreg}+0.032116\,\mathrm{glu}-0.004767\,\mathrm{bp}-0.001917\,\mathrm{skin}+0.083621\,\mathrm{bmi}+1.820337\,\mathrm{ped}+0.041182\,\mathrm{age},
$$
and its fitted <probability> is $\widehat\pi=(1+e^{-\widehat\eta})^{-1}$. There are eight coefficients. The null <degrees of freedom> identify $n=200$, and the residual <degrees of freedom> are $200-8=192$.

Each slope is a change in the <log odds> per unit of its <covariate>, holding the others fixed. Exponentiating gives conditional <odds ratios>; for example a ten-unit glucose increase multiplies fitted odds by $e^{10(0.032115958)}=1.379$, and a ten-year age increase by $e^{10(0.041182353)}=1.510$. These are changes in odds, not multiplicative changes in probability, and the observational associations are not automatically causal effects. The intercept corresponds to all numerical <covariates> being zero, generally an extrapolation beyond meaningful subjects.

The <standard errors> come from the inverse <Fisher information matrix> of the <logistic regression>. With binomial <dispersion parameter> fixed at one, the displayed t ratios are asymptotic normal <Wald statistics>. In the full fit, glucose and the pedigree measure have clear individual evidence of nonzero slopes, with two-sided $p\simeq2.09\times10^{-6}$ and $0.00609$. The body-mass and age terms are borderline, with $p\simeq0.0504$ and $0.0618$; pregnancy count is weaker, $p\simeq0.110$. Blood pressure and skinfold have little individual evidence after adjustment. These labels should not be converted into a claim that the weaker predictors have no effect, or used as automatic model-selection rules.

A <deviance residual> here is
$$
r_i^D=\operatorname{sign}(y_i-\widehat\pi_i)\sqrt{-2\{y_i\log\widehat\pi_i+(1-y_i)\log(1-\widehat\pi_i)\}}.
$$
Its square is the observation's contribution to <binomial deviance>, so the squared residuals sum to the printed <residual deviance>. The five-number summaries describe the distribution of these signed residuals. The null deviance $256.4142$ belongs to an intercept-only <logistic regression>; the full fitted deviance is $178.3907$. Four <Fisher scoring> iterations record convergence of the numerical likelihood fit.

The second model uses only glucose:
$$
\widehat\eta=-5.503635+0.03778371\,\mathrm{glu}.
$$
Its two coefficients leave $198$ residual <degrees of freedom>. A ten-unit glucose increase multiplies its fitted odds by $e^{0.3778371}\simeq1.459$. This differs from the adjusted multiplier $1.379$, because the models condition on different <covariates>; both adjustment and <noncollapsibility of the odds ratio> can change logistic coefficients. The glucose-only model has deviance $207.3727$, so its maximized <log-likelihood> is lower than the full model's.

For these fixed-dimensional nested models, <analysis of deviance> and <Wilks theorem> give
$$
\begin{array}{c|c|c|c}
\text{comparison}&\text{deviance reduction}&\text{df}&\text{approximate }p\\\hline
\text{null to full}&78.0235&7&3.48\times10^{-14}\\
\text{null to glucose only}&49.0415&1&2.51\times10^{-12}\\
\text{glucose only to full}&28.9820&6&6.13\times10^{-5}
\end{array}
$$
Thus \b[the additional six predictors collectively improve the glucose-only model], even though several individual <Wald tests> are not significant. These comparisons assume independent subjects, an appropriate logistic mean structure, full rank, and regular finite parameter estimates without <separation>.

It would be incorrect to infer that absolute fit is good merely because $178.39<192$. <Individual Bernoulli deviance need not have a chi-squared calibration>: there is just one binary observation per saturated probability, and the saturated dimension increases with sample size. A simple counterexample is an intercept-only model with true probability $1/2$, for which $D/n\to2\log2$, not one. For absolute adequacy, inspect residual patterns and predicted-risk calibration, use meaningful grouped comparisons when appropriate, or calibrate a chosen fit statistic by <parametric bootstrap>. The regular nested-model tests above are not subject to that saturated-model dimensionality problem. Only the displayed summaries and a few example rows are supplied, so patient-level diagnostics or complete numerical refitting cannot be reconstructed from this page alone.