For the normal linear model, the log-likelihood is
The full column rank of the design matrix makes invertible. Differentiating in gives the normal equations . With the minimized residual sum of squares substituted, differentiation in gives
These are the maximum-likelihood estimators almost surely; almost surely when and . The linear transformation of the multivariate normal distribution yields
Define the hat matrix . The fitted values are , the regression residuals are , and . The orthogonal projection has rank and annihilates . By Cochran's theorem,
Consequently , with bias . The unbiased estimator is
Its square root, the reported residual standard error, estimates ; the assertion of unbiasedness applies to the variance, not generally to its square root.
For the paper-strength analysis, let be the measured percentage and . Both normal linear models use independent errors of common variance . Their mean functions are for lm1, and for lm2, with separately fitted coefficients. The reported residual standard errors are and , respectively.
For lm1, the estimated conditional expectation at a new percentage is
The original data mean must be used for centering the new percentage; its numerical value is not supplied in the excerpt. Because , the two columns of this design matrix are orthogonal, and . Hence the coefficient standard errors in the output give
This estimates uncertainty in the mean. Predicting an individual future batch would additionally require the new-error variance, estimated by .
To compare the nested normal linear models, test against within the quadratic model. The Student t-test statistic is
Its two-sided p-value is . Equivalently is a partial F-test statistic with null distribution . Reject the linear restriction and prefer lm2 at the 5% level. Its residual spread is much smaller; the increase in the coefficient of determination from to supports the same conclusion, although the test is the relevant complexity-adjusted comparison.
For regression diagnostics, inspect regression residuals against fitted means and hardwood percentage for omitted curvature, a scale-location plot for nonconstant variance, and a quantile-quantile plot against the normal distribution for departures from the error assumption. Check unusual observations using regression leverage and Cook's distance, and examine residuals in collection or batch order if dependence is plausible. Independence and a common variance require substantive justification as well as these plots; a small p-value for a polynomial term does not itself check the error model.
Let be speed and the tool type. Each fit is a normal linear model with independent errors. The three mean specifications are
The constraints are treatment coding with type 1 as reference. The parameter counts are , respectively. Model 2 gives parallel lines; model 3 allows interaction terms and distinct slopes.
In the analysis of variance interaction row, adding three independent slope differences costs three degrees of freedom. Its extra sum of squares is the reduction in residual sum of squares, . Its mean square is , and its F-test statistic is
Thus the four missing entries are , , , and , to the precision allowed by the rounded output. This tests against the alternative that at least one slope difference is nonzero. Under and the normal linear model assumptions, the statistic has distribution . Its p-value gives no reason to reject at 5%.
The simpler common-line model is inadequate compared with the parallel-line model. Testing against at least one nonzero type effect, while retaining speed, gives the partial F-test
Its p-value is far below , so reject the common-line restriction. This reduction differs from the sequential type sum of squares in the displayed table, because that table adds type before speed. Recommend model 2: different intercepts and a common decreasing slope.
The selected coefficient estimates give
The intercept estimates the expected lifetime of type 1 at speed zero; if zero speed is outside the data range, it is only an extrapolated intercept. Its standard error is , and its Student t-test ratio is , with two-sided p-value . At any fixed speed, type 2 differs from type 1 by hours, with standard error , and p-value , giving little evidence of a difference. Types 3 and 4 exceed type 1 by and hours, with standard errors and ; their test ratios and and p-values and support positive differences. Each of these individual coefficient tests has null value zero, alternative nonzero, and null distribution .
The speed coefficient means a reduction of hours per extra revolution per minute, or hours per additional 100 rpm, for every type. Its standard error is ; the ratio has null distribution when the common slope is zero, and two-sided p-value .
The residual standard error estimates the common noise standard deviation in hours using 15 residual degrees of freedom, since . The coefficient of determination means that about of the corrected lifetime variation is explained by this fit. The overall F-test statistic tests the simultaneous restriction against at least one nonzero coefficient; its null distribution is and its p-value rejects an intercept-only mean. These conclusions remain conditional on suitable regression diagnostics for independent, homoscedastic, approximately normal errors.
The required sketch plots the four fitted lines. Its speed interval is illustrative because the observed speeds are not supplied; the ordering and vertical gaps are determined by the fitted coefficients.
Figure 1.
Parallel fitted tool-lifetime lines for the four tool types
.
In a normal linear model, attach a continuous spike-and-slab prior to each regression coefficient. With suitably scaled predictors, introduce indicators and set
The narrow component describes practically negligible effects; the wide component permits substantial ones. Fit the joint Bayesian posterior of coefficients, indicators and any unknown residual variance. Bayesian model averaging gives shrinkage toward zero for poorly supported effects, while quantifies wide-component support. A shared Beta distribution prior on can represent uncertainty about how many effects are substantial.
Select on scientifically meaningful effect size, for example a high for a prechosen threshold in meaningful predictor units. Membership in the wide component alone does not imply a large realized effect: its normal distribution still permits values near zero. Correlated predictors also require interpretation of the joint Bayesian posterior, rather than treating each coefficient as an isolated test.
Use a common intercept and laboratory-specific slopes in the normal linear model. With denoting days and the indicator variables for laboratories B and C, the design matrix has row , and
The interaction terms change slopes, without introducing laboratory-specific intercepts. Thus the estimated daily growth rates are
in millimetres per day, with fitted common intercept mm. The residual degrees of freedom are . The usual unbiased error variance estimate is the square of the residual standard error:
The small difference from arises from rounding the standard error to two decimal places; the latter uses the more precise residual sum of squares supplied later. A maximum-likelihood estimate would instead divide that residual sum of squares by .
Let , , , and . The horizontal axis of the residual-versus-fitted plot is , the fitted values, and the vertical axis is , the regression residual, in millimetres. Under the normal linear model, , where is the regression leverage.
In the quantile-quantile plot, the vertical values are the ordered standardized regression residuals
and the horizontal values are corresponding theoretical quantiles of the standard normal distribution, with plotting positions such as . The exact plotting-position convention has little practical effect here. Under Gaussian errors these points should approximately follow a straight line; they are not independent because fitting induces residual correlations.
The main visible concern is curvature in the conditional mean. The red smooth in the residual-versus-fitted plot descends from positive residuals at low fitted values, becomes negative in the middle, and rises again at high fitted values. This suggests the strictly linear time effects may be inadequate. There is no clear monotone widening of the residual scatter, so strong heteroscedasticity is not apparent. The quantile-quantile plot has modest tail deviations and a few labelled observations, but does not show a dramatic departure from normality. These plots cannot establish independence across days or laboratories; check residuals against day, laboratory, and sampling order as well. A large coefficient of determination does not remove the visible mean-model concern.
In the larger normal linear model, add laboratory intercept offsets to the mean in part (a). The nested-model F-test compares
The smaller and larger models fit four and six mean coefficients respectively. Under , independent Gaussian errors with common variance give independent quantities and . Thus the test statistic is
The p-value is the upper-tail probability . At the conventional 5% significance level, do not reject the common-intercept restriction. Prefer the simpler model tumour1 on this comparison. This does not prove the intercepts coincide, nor address the curvature identified in part (b); the exact F-test calibration assumes the underlying error and mean assumptions. The one-decimal RSS values give when subtracted, whereas the table's difference uses unrounded values.
Let be sunny days and latitude. The R linear-model formula expands to a normal linear model with both main effects and their interaction term:
The fitted conditional mean is
The residual standard error is , giving the usual variance estimate , and .
The estimated interaction term is tiny relative to its standard error: and the two-sided p-value is . A sensible initial simplification is to remove the interaction and refit an additive linear model, lm(energy ~ sunny + latitude). Both main effects are significant in the supplied fit, and should initially be retained. Do not simply copy their old coefficient estimates into the new fit: removing a design column generally changes all estimates. Centering predictors makes intercepts and main-effect interpretations more useful, but does not change the fitted surface. The Box–Cox transformation in part (d) suggests a further response-scale improvement; after changing the response scale, reassess the interaction and diagnostics.
The Box–Cox transformation searches over transformations of the positive response,
The plotted horizontal coordinate is and the vertical coordinate is its maximized profile likelihood on the log scale. The likelihood includes the transformation Jacobian determinant; omitting it would compare response scales incorrectly. For the Gaussian regression it is, up to constants,
The maximum occurs around . The horizontal 95% line is approximately , and its intersections give an approximate interval roughly to , read visually. In particular, is below the line, and is far below it.
Square the response: a convenient transformation is , equivalent up to affine rescaling to . Transform energy, not the sunny-days or latitude predictors. Refit and check the normal linear model on the transformed scale; the plot is evidence for a transformation, not proof that the transformed residual assumptions hold. Inference on transformed means cannot be inverted naively to obtain original-scale conditional means.
The restricted maximum likelihood procedure estimates covariance parameters from error contrasts that remove the unknown fixed effects. Let have rank and choose an full-rank matrix with . Then has a likelihood involving the variance parameters but not . Maximizing that likelihood is restricted maximum likelihood. An equivalent restricted likelihood from orthogonal error contrasts, up to terms independent of , is
where
After estimating , use generalized least squares for and the conditional modes from part (b). In an independent-error normal linear model, this covariance procedure reduces to estimating by instead of .
The two models being compared have different fixed-effect spaces, so their error contrasts, dimensions, and restricted likelihoods differ. Their REML values are not likelihoods of the same transformed data and must not be used directly for this fixed-effect likelihood-ratio test. Refit both with ordinary maximum likelihood, integrating out the random effects but retaining the original response vector, and maximize each model's marginal likelihood.
The null hypothesis is , leaving the random slope variance free; the alternative permits a nonzero population stirring effect. The supplied test has , one extra fixed coefficient, and approximate p-value . Retain the fixed stirring-rate effect at 5%. A mean-zero random slope cannot substitute for an estimated nonzero population slope. The asymptotic calibration assumes regular nuisance covariance parameters and should be interpreted cautiously with only three furnaces; simulation can provide a better finite-sample calibration.
The Gauss-Markov theorem states that with full-column-rank design, mean-zero errors and covariance , the ordinary least squares estimator is the best linear unbiased estimator: its covariance is no larger than any other such estimator's in the Loewner order. Normality is unnecessary for that theorem.
In the given normal linear model, maximizing the likelihood function is equivalent to minimizing . The normal equations and full rank give
For a direct variance comparison, write . Unbiasedness for every requires . Set and , so . The cross covariance terms vanish because . Therefore
This proves the requested comparison for every contrast without relying only on the theorem's name.
Write the one-column design as and . Maximizing the normal linear model likelihood first gives . Its minimized residual sum of squares is . For variance , the remaining log likelihood is plus a constant, whose maximum is at
Here almost surely because and the true variance is positive. In the exceptional data case , the likelihood is unbounded as , so there is no positive-variance maximum.
Let , the orthogonal projection matrix onto the design column. Then and . These are orthogonal linear projections of an isotropic multivariate normal distribution, hence independent. An orthonormal coordinate system adapted to makes the residual squared length a sum of independent squared standard normals. Thus the joint distribution of least-squares and variance estimators is the product law
In particular the maximum likelihood variance estimator is biased: ; the unbiased residual estimator uses denominator .
Put . The Debiased Lasso correction is
For the Nodewise Lasso, let . Its Karush-Kuhn-Tucker conditions are
so at a nonzero coefficient and at a zero coefficient. Multiplying by gives the nodewise-Lasso residual identity
We require nonzero design columns, a necessary qualification missing from the unrestricted printed formulation. Because , would force both and , and hence . Thus nonzero columns suffice for even when or the full Gram matrix is singular. A zero column instead gives and its coefficient is unidentifiable from ; the proposed normalization and confidence interval do not exist there.
For each , define by and . Set row of to . Since ,
This row construction is the nodewise normalization used by van de Geer and coauthors. The matrix need not be symmetric or be an actual inverse.
Substitute the linear model into the correction. The exact decomposition is
In the fixed-design normal linear model, or with and nodewise estimates and tuning chosen from alone, a linear transformation of a multivariate normal distribution gives . Marginal normality of without this conditional assumption would not suffice for a response-dependent random design. No independence between and is asserted. The diagonal cancellation and the Holder inequality give the debiased-Lasso remainder bound
For a coordinate variance, , whence
Writing for the corresponding standard normal quantile, an approximate confidence interval is
Equivalently its half-width is . We assume and . For asymptotic coverage, the standardized remainder must have convergence in probability to zero and the coordinate variance must be nondegenerate. Exact conditional normality of alone does not give finite-sample exact coverage for .
One sufficient random-design regime is the Gaussian identity design for debiased Lasso: take independent rows , independently of , fixed , , , and
Choose and all for sufficiently large fixed . Here is why this regime has the requested remainder bound. Uniformly over columns, their squared norms divided by tend to one, while all off-diagonal sample cross-correlations have magnitude at most a constant times with probability tending to one. Taking larger makes the zero vector satisfy all nodewise Karush-Kuhn-Tucker conditions strictly, so for every on that event, and eventually. This also gives uniformly.
In this regime, the entrywise entrywise concentration of a Gaussian Gram matrix and Lasso cone condition argument in Gaussian identity design for debiased Lasso gives a Compatibility condition for the Lasso bounded away from zero with probability tending to one. Together with the noise-score event and the Basic inequality for the Lasso, this yields, for a fixed ,
For example, the cone inequality and compatibility bound give on their joint event. Therefore, with a fixed ,
The stated sparsity condition makes this remainder vanish and supplies the preceding confidence-interval requirement. Both dimensions may grow: and satisfy these assumptions. The concentration and Gaussian-design compatibility results are sufficient standard conditions here; the question does not require their proofs. The displayed rate is a high-probability fixed-constant bound, rather than only a claim of boundedness in probability.
Choose knots independently of the eventual validation responses, and let be a natural cubic spline basis as in part (a). A regression spline writes . Define the design matrix . Under the stated normal linear model, maximum likelihood estimation for is the same as ordinary least squares:
Differentiation gives the normal equations . If the design has full column rank,
If it does not, a Moore-Penrose inverse gives the fitted values, but not every coefficient or off-sample prediction is identifiable. Merely choosing distinct knots does not guarantee full rank for an arbitrary set of observed predictor values.
More knots allow greater curvature and reduce approximation bias at the cost of larger estimation variance. Too many or poorly located knots can cause unstable fits. Equally spaced knots are simple; empirical predictor quantiles put more flexibility where observations are dense; subject knowledge can concentrate knots near likely changes. Both the number and positions can be compared using cross-validation or an appropriate penalized model-selection criterion. Adaptive knot selection must be included within validation, since treating a data-selected basis as prespecified understates its flexibility. Boundary knots should cover the region where inference is intended, and natural linear tails do not by themselves justify far-out extrapolation.
The comparison is a nested-model F-test of the three time-by-diet interaction coefficients, with null hypothesis that all are zero. The reduced linear regression model has a common time slope and four diet-specific intercepts; the full model permits four slopes. It has eight fitted coefficients and residual degrees of freedom.
The rounded sums of squares give the displayed approximation; the software reports using unrounded values. The quoted p-value gives overwhelming evidence against equal log-weight growth slopes across diets under the normal linear model assumptions. Thus reject the common-slope hypothesis. Because repeated measurements on the same chicken may be correlated, the exact reference distribution requires independent, homoscedastic Gaussian errors; the displayed ordinary regression output by itself does not establish that assumption.
Use the usual normal linear model , with fixed full-column-rank design , , and . These Gaussian distribution and constant-variance hypotheses are necessary for an exact finite-sample Student's t-test. Put and . The vector of ordinary least squares estimators satisfies
With , the test statistic is
Under the null hypothesis, has Student's t-distribution with degrees of freedom. A two-sided level- Student's t-test rejects when . If the intended test is one-sided against , it rejects when ; the statistical power conclusion below holds for either convention.
For a convex function , its subdifferential at is the set of supporting slopes
The subgradient optimality condition is
Indeed, the defining inequality with is exactly the global minimum inequality. For the subdifferential of the L1 norm, the coordinates vary independently:
Let . The Karush-Kuhn-Tucker conditions for Lasso give a vector such that . If , the unsquared residual norm is differentiable at this fit, with gradient
Using the subdifferential sum rule, choose to obtain
Convexity now proves the tuning relation between Lasso and square-root Lasso:
The positive residual assumption is needed both for this gradient and for the quotient defining the tuning parameter.
For the final score calculation, use the usual fixed-design interpretation of the normal linear model: regard and the tuning parameter in the regression of as fixed, and choose that regression's minimizer using only those inputs. Its nonzero residual then has the Square-root Lasso optimality condition
Expanding the response residual gives
Since is a fixed unit vector and , a linear image of a multivariate normal vector gives . Finally, Holder inequality and the residual score bound yield
This is the residual-score decomposition from square-root Lasso. The normality statement also holds conditionally on a design independent of the noise. If were chosen from the response noise, for example through the preceding formula, the direction would require a separate independence argument; the final calculation treats as fixed.
One suitable criterion among the three unpenalized normal linear models is the Akaike information criterion. With estimated mean coefficients and the variance also estimated, minimizing AIC is equivalent to minimizing
The values of are for model1, model2 and model3. This compares fit and complexity rather than choosing solely by individual coefficient significance. The Bayesian information criterion or a common-fold predictive comparison would also be reasonable, depending on the selection objective.
For the ridge regression tuning parameter, use K-fold cross-validation with squared prediction loss:
Use the same folds for every candidate, estimate any centering or scaling within each training fold, choose a minimizing , and refit on all observations. This estimates mean squared prediction error while avoiding data leakage. The printed summaries do not supply all residual sums of squares or validation losses, so they do not determine which model or penalty wins.
With Control as the reference group, the fitted normal linear model has mean
Thus the control-group rate is , while the treatment-group rate is . The estimates are
and
weight units per day. The control slope has and , so there is no statistically significant evidence of weight loss over time in the control group at conventional significance levels.
The plotted regression residuals for each mouse form smooth time patterns rather than an unstructured cloud: nearby observations on the same mouse have similar residuals, and the mice also show persistent individual offsets. This is strong evidence of autocorrelation and omitted mouse-level variation. The ordinary linear model treats all 400 measurements as independent after accounting for cage, so it commits pseudoreplication and will generally underestimate the coefficient standard errors. The reported -tests and -values should therefore not be trusted. A random-intercept linear mixed model with a within-mouse correlation structure would respect the repeated-measures design.