From Assumptions to an Analysis
A quasi-likelihood analysis is useful when the mean relationship is the primary scientific target but a full probability distribution for the response is not justified. The analysis still requires explicit assumptions: a model for each conditional mean, a variance function describing how variability changes with that mean, and a method for estimating uncertainty. The variance function guides the estimating equation; it does not, by itself, specify a likelihood.
This tutorial builds those pieces into one regression workflow. We use independent positive responses with a log-linear mean and a quadratic variance function. The example is deliberately a quasi-likelihood analysis: no particular response distribution is asserted.
For the worked analysis, take \(g(\mu)=\log(\mu)\) and \(V(\mu)=\mu^2\). Thus the conditional mean is positive, and the assumed variance is proportional to the square of that mean. This choice is a convenient general variance structure for illustrating the calculations; it should not be mistaken for a claim that the responses follow a particular named distribution.
Deriving the Estimating Equation
Let \(D_i=\partial\mu_i/\partial\beta\), written as a column vector. A quasi-score contribution, with the common dispersion factor omitted, is \(\psi_i(\beta)=D_i\{Y_i-\mu_i\}/V(\mu_i)\). Omitting \(\phi\) does not change the solution of the estimating equation when \(\phi\) is a common positive scalar. This form follows directly by differentiating the quasi-likelihood integrand.
To verify the score formula, consider the quasi-likelihood contribution defined, up to a constant independent of \(\mu\), by integrating \((y_i-t)/V(t)\) with respect to \(t\). Its derivative with respect to \(\mu_i\) is \((y_i-\mu_i)/V(\mu_i)\). By the chain rule, its derivative with respect to \(\beta\) is \(D_i(y_i-\mu_i)/V(\mu_i)\). Summing these derivatives gives \(U(\beta)\). At the true parameter, \(D_i\) and \(V(\mu_i)\) are fixed given the covariates, so
For the stated log link, write \(\eta_i=z_i^T\beta\), so \(\mu_i=\exp(\eta_i)\) and \(D_i=\mu_i z_i\). Substituting \(D_i\) and \(V(\mu_i)=\mu_i^2\) gives
Consequently the estimating equation is
This is an estimating equation, not a likelihood score derived from a specified response distribution. Its validity as a mean-zero equation comes from the stated mean assumption. Consistency and asymptotic inference also require appropriate regularity conditions, including an identifiable mean model and sufficiently well-behaved independent observations.
Worked Example: Specifying a Regression Analysis
Suppose a study records a positive biomarker \(Y_i\) and a binary exposure \(x_i\), coded 0 or 1. The scientific target is the relationship between exposure and the conditional mean biomarker level. Specify the model and its assumptions.
Use \(z_i=(1,x_i)^T\) and \(\beta=(\beta_0,\beta_1)^T\), with \(\log(\mu_i)=\beta_0+\beta_1x_i\). Equivalently, \(\mu_i=\exp(\beta_0+\beta_1x_i)\), so the fitted mean is positive for every covariate value.
Specify \(\operatorname{Var}(Y_i)=\phi\mu_i^2\), with one common \(\phi>0\), and assume the responses are independent conditional on the covariates. These statements specify the first two moments and the mean structure, but do not choose a probability distribution. In particular, \(\beta_1\) describes the log ratio of the two conditional means: \(\mu(x=1)/\mu(x=0)=\exp(\beta_1)\).
Solving the Equation in a Small Data Set
With a binary covariate, the estimating equation separates into one equation for each exposure group. The intercept-only part and exposure part together imply that the sum of \(Y_i/\mu_i-1\) is zero in each group. Therefore the fitted mean in each group is its arithmetic sample mean. The following example shows the calculations rather than relying on that shortcut.
Worked Example: Estimating the Mean Parameters
Consider six independent positive responses. For \(x=0\), the observed values are \(2,3,6\); for \(x=1\), they are \(3,6,6\). Use the log-link mean and \(V(\mu)=\mu^2\).
For the \(x=0\) observations, \(z_i=(1,0)^T\). Their score contributions sum to zero when \(\sum(Y_i/\mu_0-1)=0\), or \((2+3+6)/\mu_0-3=0\). Hence \(\hat\mu_0=11/3\).
For \(x=1\), \(z_i=(1,1)^T\). Together with the intercept equation, the exposure equation makes the score sum within this group zero as well. Thus \((3+6+6)/\mu_1-3=0\), giving \(\hat\mu_1=5\).
The fitted model satisfies \(\exp(\hat\beta_0)=\hat\mu_0=11/3\) and \(\exp(\hat\beta_0+\hat\beta_1)=\hat\mu_1=5\). Therefore \[ \hat\beta_0=\log(11/3)\approx1.2993,\qquad \hat\beta_1=\log(5)-\log(11/3)=\log(15/11)\approx0.3102. \] The fitted mean ratio for \(x=1\) versus \(x=0\) is \(\exp(\hat\beta_1)=15/11\approx1.364\).
As a check, the group score sums are zero: for \(x=0\), \(\sum(Y_i/\hat\mu_0-1)=11/(11/3)-3=0\); for \(x=1\), the sum is \(15/5-3=0\). Thus both components of the full two-parameter estimating equation vanish.
Estimating Dispersion
The mean estimates do not determine the scale of the variability. A standard moment-based estimate uses Pearson residuals, which divide each observed residual by the square root of its variance function. With \(p\) fitted regression parameters, the usual estimate is
The divisor \(n-p\) accounts approximately for the degrees of freedom used in fitting the mean. This is not generally an exact unbiasedness identity with fitted means. To see the moment calculation behind it, suppose first that the true means are known and the variance function is correct. Then
Estimating the regression parameters uses information from the same observations, so the residual sum is typically smaller; dividing by \(n-p\) is a conventional adjustment, not a universal exact correction. The estimate also depends on the chosen variance function and may be unstable in small samples.
Worked Example: Calculating Pearson Dispersion
Continue with the six responses and fitted means \(\hat\mu_0=11/3\) and \(\hat\mu_1=5\). There are \(n=6\) observations and \(p=2\) regression parameters. For \(V(\mu)=\mu^2\), each squared Pearson residual is \((Y_i-\hat\mu_i)^2/\hat\mu_i^2\).
In the \(x=0\) group, the standardized residuals are \(2/(11/3)-1=-5/11\), \(3/(11/3)-1=-2/11\), and \(6/(11/3)-1=7/11\). Their squares sum to \((25+4+49)/121=78/121\).
In the \(x=1\) group, the standardized residuals are \(3/5-1=-2/5\), \(6/5-1=1/5\), and \(6/5-1=1/5\). Their squares sum to \((4+1+1)/25=6/25\). Thus the Pearson sum is \(78/121+6/25=2676/3025\approx0.88496\), and \[ \hat\phi=\frac{0.88496}{6-2}\approx0.22124. \] This is a small-sample estimate from only six observations, not precise evidence that dispersion is below one. Its value describes residual variability relative to this particular variance function.
Sandwich-Based Inference
A model-based covariance calculation relies on the stated variance function being correct. Sandwich covariance instead estimates variability of the empirical estimating-equation contributions. Define \(\hat\psi_i=\psi_i(\hat\beta)\), \(\hat A=-\partial U(\beta)/\partial\beta^T\) evaluated at \(\hat\beta\), and \(\hat B=\sum_i\hat\psi_i\hat\psi_i^T\). When the observations are independent and the estimating equation has a well-behaved, nonsingular derivative, the sandwich estimate is
This form follows from linearizing the estimating equation around the true parameter: the estimation error is approximated by the inverse derivative times the sum of the individual mean-zero contributions. The variance of that sum is estimated by adding their outer products, which yields the displayed sandwich. The approximation requires regularity conditions for the estimator and the empirical covariance; it is not a small-sample exact result. If the equation is written with every contribution divided by \(\phi\), both derivative and meat scale accordingly and the common factors cancel in the sandwich.
Worked Example: Robust Standard Errors
For the six-observation analysis, the derivative matrix is \(\hat A=\sum_i(Y_i/\hat\mu_i)z_iz_i^T\). Within each group, \(\sum_iY_i/\hat\mu_i=3\), so \[ \hat A= \begin{pmatrix}6&3\\3&3\end{pmatrix}, \qquad \hat A^{-1}= \begin{pmatrix}1/3&-1/3\\-1/3&2/3\end{pmatrix}. \]
The scalar residual score factors \(Y_i/\hat\mu_i-1\) in the first group are \(-5/11,-2/11,7/11\). Their squared sum is \(78/121\). In the second group they are \(-2/5,1/5,1/5\), with squared sum \(6/25\); the covariate vector there is \((1,1)^T\). Therefore \[ \hat B= \begin{pmatrix} 78/121+6/25&6/25\\ 6/25&6/25 \end{pmatrix} \approx \begin{pmatrix}0.88496&0.24\\0.24&0.24\end{pmatrix}. \]
Multiplying the matrices gives \[ \widehat{\operatorname{Cov}}(\hat\beta) \approx \begin{pmatrix} 0.07166&-0.07166\\ -0.07166&0.09833 \end{pmatrix}. \] The robust standard error for \(\hat\beta_1\) is \(\sqrt{0.09833}\approx0.314\); for \(\hat\beta_0\) it is \(\sqrt{0.07166}\approx0.268\). These are sandwich-based asymptotic standard errors. They should not be interpreted as exact uncertainty statements for this tiny sample.
Reading the Analysis Responsibly
The example separates three tasks that should remain distinct in an applied report: specifying the mean model, specifying a variance function for the estimating equation, and estimating uncertainty. The coefficient estimate describes the fitted conditional mean relationship under the mean model. The Pearson estimate summarizes residual scale relative to the chosen variance function. The sandwich estimates coefficient uncertainty from observed variation in the estimating contributions.
Robust covariance does not make the entire analysis robust to every modeling error. In particular, it does not correct a misspecified mean relationship, dependence between observations when independence was assumed, or influential observations. The variance function still affects the estimating equation and hence can affect the coefficient estimate. Sandwich inference protects against some variance misspecification under suitable conditions; it does not replace careful modeling or diagnostics.
Choose covariates and a link that encode the scientific relationship, and verify that the fitted means are in the response's admissible range.
Write \(\operatorname{Var}(Y_i)=\phi V(\mu_i)\) and make clear that this is not a complete distributional specification.
Solve the quasi-score equation, examine residual behavior, and calculate a dispersion estimate with its limitations in view.
State whether standard errors are model-based or sandwich-based, and describe the assumptions needed for their interpretation.
Check Your Understanding
Use the definitions and calculations above to test whether you can assemble and interpret a quasi-likelihood analysis.
- For a log link and \(V(\mu)=\mu^2\), derive the individual quasi-score contribution from \(D_i=\partial\mu_i/\partial\beta\).
- Why does a mean and variance specification not determine a likelihood?
- In the numerical example, verify the fitted mean for each exposure group directly from the corresponding score equation.
- Explain why the Pearson estimate with fitted means is not generally exactly unbiased after division by \(n-p\).
- What kind of misspecification can sandwich covariance help accommodate, and what important kinds can it not repair?