Tutorials › Generalized Linear Models › Weight Semantics and Standard Errors

Offsets Weights and Trials · Tutorial 133 of 981

Weight Semantics and Standard Errors

Compare the model-based uncertainty from replication counts with that from relative-precision weights, and see when the same covariance formula has different meanings.

Intermediate 10 min read

What You'll Learn

  • Distinguish frequency weights from variance weights by the sampling model they represent
  • Derive the model-based coefficient covariance for frequency-weighted observations
  • Derive the covariance for independent responses with variances inversely proportional to precision weights
  • Calculate coefficient standard errors in binomial, Gaussian, and Poisson examples
  • Identify when identical numerical weights do not justify identical interpretations of uncertainty
  • Recognize when a model-based covariance formula is not an adequate uncertainty estimate

Why the Meaning of a Weight Matters

In a generalized linear model, weights can enter the coefficient covariance calculation through the same-looking information matrix. That algebraic resemblance does not make the underlying data models interchangeable. A frequency weight says that a record represents replicated observations; a variance weight says that one observation has a specified relative precision. The distinction determines what random data the standard error describes.

Write the linear predictor as \(\eta_i=x_i^{\mathsf T}\beta+o_i\), where \(x_i\) is the covariate vector, \(\beta\) is the coefficient vector, and \(o_i\) is a fixed offset. Let \(\mu_i=E[Y_i]\), and let \(V(\mu_i)\) be the GLM variance function, so that an unweighted response has variance \(\phi V(\mu_i)\). Here \(\phi\) is the dispersion parameter. We focus on model-based covariance estimates, treating \(\phi\) as known unless stated otherwise.

Definition: A frequency weight \(m_i\) is a nonnegative integer giving the number of independent, identically distributed observations represented by row \(i\). A variance weight \(w_i>0\) is a relative precision: under the variance-weight model, one response in row \(i\) has \(\operatorname{Var}(Y_i)=\phi V(\mu_i)/w_i\). These definitions describe different sampling models, even when the weight values are numerically equal.

For compactness, define the information contribution from one unweighted observation at row \(i\) by

$$ D_i=\frac{(d\mu_i/d\eta_i)^2}{V(\mu_i)}. $$

The derivative is evaluated at the model parameters. We assume it exists and that the relevant information matrix is finite and nonsingular. For frequency weights, \(m_i\) identical covariate rows contribute \(m_iD_ix_ix_i^{\mathsf T}\). For variance weights, \(w_iD_ix_ix_i^{\mathsf T}\) is the model-based information contribution under the stated variance model.

Frequency Weights: Replicated Observations

Suppose each row represents \(m_i\) independent responses with the same covariates and mean. Their log-likelihood contributions add. Consequently, the weighted log-likelihood is the ordinary per-observation log-likelihood multiplied by \(m_i\) and summed over rows. Its expected information is the sum of the information from all represented observations.

Result: For independent replicated observations from a regular GLM, the model-based coefficient covariance is estimated by
$$ \widehat{\operatorname{Cov}}_{\mathrm{model}}(\hat\beta) = \phi\left(\sum_i m_iD_ix_ix_i^{\mathsf T}\right)^{-1}. $$
Here the expression is evaluated at the fitted coefficients. If \(\phi\) is estimated, its estimate is substituted in the usual plug-in covariance.

To justify the formula, let \(I_i(\beta)\) denote the expected Fisher information from one observation at row \(i\). Under the regular GLM likelihood assumptions—differentiable likelihood, parameter-independent support, and valid differentiation under the integral—the information identity gives \(I_i(\beta)=-E[\partial^2\ell_i/\partial\beta\partial\beta^{\mathsf T}]\). The GLM mean and variance specification yields \(I_i(\beta)=D_ix_ix_i^{\mathsf T}/\phi\). For \(m_i\) independent observations, log-likelihoods and expected information add, giving

$$ I(\beta)=\frac{1}{\phi}\sum_i m_iD_ix_ix_i^{\mathsf T}. $$

The inverse expected information is the model-based covariance used for the usual likelihood-based standard errors (as a large-sample approximation to the estimator’s covariance). Thus the covariance estimate is \(\phi\left(\sum_i m_iD_ix_ix_i^{\mathsf T}\right)^{-1}\), as claimed. This derivation depends on independent replicated observations; a weight that merely happens to be an integer does not establish that assumption. \(\square\)

Worked Example: Frequency-Weighted Bernoulli Observations

Twelve independent patients have the same covariate pattern, and nine respond. Represent these records by one row with frequency \(m=12\) and observed response proportion \(9/12\). Fit an intercept-only logistic model, with \(\eta=\beta\) and \(p=\exp(\beta)/(1+\exp(\beta))\). Find the fitted coefficient and its model-based standard error.

The Bernoulli log-likelihood for the twelve observations, up to a term not involving \(\beta\), is \(9\log(p)+3\log(1-p)\). Its score is \(9-12p\), so the maximum-likelihood estimate satisfies \(\hat p=9/12=0.75\). Therefore \(\hat\beta=\log(\hat p/(1-\hat p))=\log(3)\).

For the logistic link, \(d\mu/d\eta=p(1-p)\) and \(V(\mu)=p(1-p)\), so \(D=p(1-p)\). At the fitted value, \(D=0.75(0.25)=0.1875\). The total information is \(12(0.1875)=2.25\), and with \(\phi=1\) the estimated coefficient variance is \(1/2.25=4/9\). The standard error is therefore \(\sqrt{4/9}=2/3\).

This uncertainty reflects twelve independent Bernoulli observations with a shared covariate pattern. Treating the proportion \(0.75\) as one Bernoulli observation would discard the replication information and would not give the same standard error.

Variance Weights: One Observation at Each Precision

A variance weight does not assert that a row represents several responses. It specifies how variable the single response is relative to the others. If responses are independent and \(\operatorname{Var}(Y_i)=\phi V(\mu_i)/w_i\), the quasi-score for \(\beta\) is

$$ U(\beta)=\sum_i w_i x_i\frac{d\mu_i/d\eta_i}{V(\mu_i)}(Y_i-\mu_i). $$

The weights appear because a response with smaller variance should contribute more to estimating the mean relationship. The covariance result follows from the variability and sensitivity of this estimating equation.

Result: For independent responses with the stated variance-weight model, the model-based covariance associated with the quasi-score is
$$ \widehat{\operatorname{Cov}}_{\mathrm{model}}(\hat\beta) = \phi\left(\sum_i w_iD_ix_ix_i^{\mathsf T}\right)^{-1}. $$
This formula uses the model-based variance and sensitivity; it is not a claim that variance weighting creates replicated likelihood observations.

For a complete derivation, set \(g_i=(d\mu_i/d\eta_i)/V(\mu_i)\) and \(A=\sum_i w_iD_ix_ix_i^{\mathsf T}\). Independence and the specified response variances give

$$ \operatorname{Var}\{U(\beta)\} =\sum_i w_i^2 x_ix_i^{\mathsf T}g_i^2 \frac{\phi V(\mu_i)}{w_i} =\phi A. $$

The expected negative derivative of the score is \(A\): when differentiating, the term containing \(Y_i-\mu_i\) has expectation zero, while differentiating the mean contributes \((d\mu_i/d\eta_i)^2/V(\mu_i)\). A first-order expansion of the estimating equation around the true coefficient therefore gives covariance \(A^{-1}(\phi A)A^{-1}=\phi A^{-1}\). This is the model-based covariance, or the large-sample covariance from the linearization of the score root. It requires independent responses, the stated mean and variance structure, and a nonsingular \(A\). \(\square\)

Worked Example: Precision-Weighted Gaussian Intercept

Suppose three independent measurements have values \(1,3,8\), with an intercept-only Gaussian identity-link model. Let the known dispersion be \(\phi=9\), let \(V(\mu)=1\), and use variance weights \(w=(1,2,3)\). Find the fitted intercept and its model-based standard error.

For an intercept-only identity-link model, \(D=(d\mu/d\eta)^2/V(\mu)=1\). The weighted score equation is \(\sum_iw_i(Y_i-\beta)=0\), so

$$ \hat\beta=\frac{1(1)+2(3)+3(8)}{1+2+3} =\frac{31}{6}. $$

The information is \(\sum_iw_iD_i=1+2+3=6\). Thus the estimated model-based variance is \(9/6=3/2\), and the standard error is \(\sqrt{3/2}\), approximately \(1.225\). In this model the individual response variances are \(9/1=9\), \(9/2=4.5\), and \(9/3=3\). There are three measurements, not six replicated measurements.

Same Formula, Different Sampling Story

Both derivations lead to a weighted information matrix, but the interpretation of its weight factor differs. Under frequency weighting, the factor counts independent copies of an observation. Under variance weighting, it expresses relative precision for a single observation. Equal numerical values can yield equal model-based covariance estimates when the mean model, dispersion, and covariate rows also agree; that equality alone does not make the data-generating assumptions equivalent.

Worked Example: Equal Numerical Information, Unequal Interpretations

Consider an intercept-only Poisson log-link mean model, so \(\mu=\exp(\beta)\), with \(\phi=1\). Two recorded response values are \(1\) and \(3\), and their numerical weights are \(1\) and \(3\). Compare treating these as frequency weights with treating them as variance weights.

For the Poisson log link, \(d\mu/d\eta=\mu\) and \(V(\mu)=\mu\), hence \(D=\mu\). The weighted score is \(\sum_i a_i(Y_i-\mu)=0\), where \(a_i\) denotes the weights. In either interpretation, the fitted mean is

$$ \hat\mu=\frac{1(1)+3(3)}{1+3}=\frac{10}{4}=2.5, \qquad \hat\beta=\log(2.5). $$

The weighted information is \((1+3)(2.5)=10\). The model-based coefficient variance is \(1/10=0.1\), and its standard error is \(\sqrt{0.1}\), approximately \(0.316\).

Under the frequency interpretation, the data are one copy of response \(1\) and three independent copies of response \(3\). Under the variance interpretation, there are two responses, with variance \(\mu\) for the first and \(\mu/3\) for the second under the assumed quasi-variance model. The fitted coefficient and covariance formula coincide here, but the observations and their modeled variation do not.

Reading and Reporting the Standard Error

For a coefficient \(\beta_j\), the model-based standard error is the square root of the \(j\)th diagonal element of the estimated covariance matrix. Off-diagonal elements describe estimated coefficient covariances; they should not be discarded when forming standard errors for linear combinations. For a vector \(c\), the estimated variance of \(c^{\mathsf T}\hat\beta\) is \(c^{\mathsf T}\widehat{\operatorname{Cov}}(\hat\beta)c\).

These formulas rely on the chosen model for variation. If responses are correlated, if the variance-weight model is wrong, or if the frequency weights do not truly represent independent replication, the model-based covariance may not describe actual sampling uncertainty. In such cases, an appropriate robust or cluster-based covariance analysis may be needed; changing the weight label alone cannot repair a mismatched model.

Common Mistake

Wrong reasoning: “The software multiplies each row’s information by its weight, so a weight of 5 always means five independent observations and gives the same kind of standard error.”

Correction: Multiplication by 5 can arise from five independent replicated records, or from one response assigned five times the relative precision. Those are different assumptions about the random data. The covariance calculation is justified only after identifying which model the weights represent and checking its independence, mean, and variance assumptions.

Key takeaway: The information matrix determines the model-based standard error, but the meaning of its weights comes from the sampling model. Frequency weights count independent replicates; variance weights describe relative precision for individual responses.

Check Your Understanding

Answer each question by stating the relevant sampling interpretation as well as the calculation or conclusion.

  1. A row has frequency weight 4. What observation structure must this represent for the frequency-weight covariance derivation to apply?
  2. With variance weights, what does \(w_i=2\) imply about \(\operatorname{Var}(Y_i)\) relative to an otherwise comparable response with weight 1?
  3. In an intercept-only Gaussian identity-link model with known \(\phi=4\), three variance weights are \(1,1,2\). What is the model-based variance of the fitted intercept?
  4. Why can equal numerical frequency and variance weights produce equal covariance formulas without representing the same data-generating process?
  5. Name one situation in which a model-based covariance estimate may fail to represent the sampling uncertainty of the coefficient estimate.
Clinical Biostats