Lawfare Academy · Complete Regression Analysis for Business edition 3
Reproducible analysis from raw rows to a feasible recommendation
The original analytical-report companion and full cumulative clinic remain required on-site teaching. Preserve their campaign 600/contribution 80/capacity 7 upper bound, capacity 10 alternative and extra 200 capacitycost; preserve the original 30-point rubric with five categories of six. This studio supplies complete original software/manual preparation and a further decision exercise, rather than making an external software chapter the explanation.
Create a reproducible analysis specification
Begin with the decision, target population, observation unit, outcome, predictor units, sampling or assignment process and information date. Identify whether the output describes a historical association, predicts an outcome from available information or estimates a defined intervention effect. Name the comparator, action and consequences. A coefficient table cannot supply an unstated causal design or operating authority.
Keep an immutable copy of the permitted synthetic inputs, a transformation log, variable definitions and the exact model expression. State reference categories, interactions, missing-value handling, weights and exclusions. A blank cell is not automatically zero. A transformed variable must respect its domain. A separate identifier can help reconcile rows without becoming a predictor; this exercise requires no access to learner records or actual confidential customer data.
Construct the actual design columns and verify sample size and rank before interpreting output. Preserve intercept choices and missingness consistently across comparisons. Use stable numerical algorithms such as an appropriate QR or SVD implementation for real floating-point fitting; a tiny exact normal-equation inverse is a transparent teaching method rather than a general production solver. A software convention that drops a column or returns one generalized solution does not establish unique economic effects for redundant regressors.
Spreadsheet workflow with complete expected results
Use the separate Willow rows from studio two. Put x values 0,1,2,3 in A2:A5 and y values 1,2,2,5 in B2:B5, with headers in row 1. Enter the exact supplied values rather than a rounded chart trendline. The English-locale formula below requests an intercept and additional statistics. Array entry/display behavior can depend on the installed spreadsheet version and locale; a user may instead reproduce every value manually from the on-site Sxx/Sxycalculations.
=LINEST(B2:B5,A2:A5,TRUE,TRUE)For this full-rank simple fit the two-column output is: first row slope 1.2 and intercept 0.7; second row coefficient SEsqrt(0.18)and intercept SEsqrt(0.63); third row R²0.8 and residual standard sqrt(0.9); fourth row F 8 and residual df 2; fifth row regression sum of squares 7.2 and residual sum of squares 1.8. These classical SEs and tests inherit their model assumptions, not a guarantee from the function. The complete independent calculation and assumptions appear in studios two and four.
The LINESTparameter order and returned-statistics layout were checked in Microsoft's function reference. For multiple xcolumns the returned slope order is reversed relative to the predictor-column order, followed by the intercept. Label columns explicitly. In the original eight-row x,D case, x then Dcolumns would therefore give coefficients 5,2,10 across the first output row, representing D,x,intercept. Removing the intercept or changing rows changes the fit. No current Excel installation or device execution is claimed by these manual expected results.
For a manual audit, calculate each fitted value as 0.7+1.2 x, subtract it from the observed y, square residuals and sum them. Check fitted values 0.7,1.9,3.1,4.3 and residual sum of squares 1.8. Plot observed and fitted values and a residual-versus-xplot; do not let a favorable R²replace the diagnostic record. For the original interaction model, construct xD explicitly and retain the reference/centering distinctions from its complete companion.
Optional R workflow, with the same on-site reasoning
R's statsdocumentation for lm and predict.lm was consulted for formula fitting, extractor use and the distinction between mean-confidence and individual-prediction intervals. The following original commands operate only on supplied synthetic values. They are optional executable instructions; all expected coefficient and fitted-value results are already supplied on site. No R execution is claimed unless separately recorded.
willow <- data.frame(x = c(0, 1, 2, 3), y = c(1, 2, 2, 5))
fit <- lm(y ~ x, data = willow)
coef(fit)
fitted(fit)
residuals(fit)
summary(fit)
predict(fit, newdata = data.frame(x = 1.5))
predict(fit, newdata = data.frame(x = 1.5), interval = "confidence")
predict(fit, newdata = data.frame(x = 1.5), interval = "prediction")The coefficients are intercept 0.7 and slope 1.2, with mean prediction 2.5 at x 1.5. Under the stated classical model the mean-prediction variance is 0.225 and individual-prediction variance 1.125. Interval endpoints additionally require the matching critical value and assumptions. A program can compute a nominal interval even when selection, dependence or future conditions invalidate the interpretation. Inspect warnings, omitted rows, factor levels and the actual design rather than copying only the printed significance marks.
For multiple regression, a formula such as y~x+Dmeans an additive model, while y~x*Dincludes the lower-order terms and interaction. Inspect the resulting columns and reference levels. A category coded numerically can be treated as a quantitative slope unless represented as intended; a factor's reference choice affects coefficient meaning. Automated omission or rank handling is not permission to hide a changed sample or redundant predictor. Preserve results and diagnostics with the code and version information actually used.
Translate predictions through the feasible action
The statistical model is one input to a decision. Define completed and collected work, qualification, timing, contribution, action cost, displacement and available capacity. An estimate of demand is not automatically completed output. If an observational model does not identify intervention response, label response-to-action calculations as conditional scenarios and explain what evidence would change that status.
Use a new independent Willow proposal costing 480, with contribution 60 per completed incremental job and capacity 10. Response scenarios 4,8,12 produce completed 4,8,10 and net contributions−240,0,120. Eight whole jobs break even; nine produce a positive net if capacity and other assumptions hold. A high-demand 12 scenario cannot earn 12×60−480=240 because only 10 jobs can be completed. The original 600/80/capacity 7 case remains a distinct problem.
Now suppose an additional facility permits capacity 12 but costs 180 for this decision. At response 12 the net is 720−480−180=60, below the existing-capacity 120. More capacity need not improve the net after its cost. For uncertain response, specify a distribution and compute expected completed quantities under the action. In general E[min(D,K)]differs from min(E[D],K). A mean response alone cannot determine expected capped contribution.
Write the report as an inspectable argument
The executive page should identify the question, evidence type, most material numerical result, feasible recommendation and assumption that could reverse it. The technical appendix should preserve data definitions, design matrix, coefficients, covariance choice, diagnostics, validation origins/horizons, benchmarks and loss. Separate exploration from confirmatory claims and distinguish numerical reproduction from substantive validity.
Choose a next action proportionate to the evidence. A bounded experiment can be useful if it identifies a decision-relevant quantity and its value justifies its costs; it is not an automatic answer to uncertainty. If the best feasible outcome cannot recover the action cost, refining demand alone cannot reverse the conclusion under those fixed assumptions. State who can reconsider the scope, capacity or objective without inventing approval or a real commitment. Florida remains the default for state-law applications; no statistical result supplies legal or professional authority.
Optional complete models
Model 1 — Software output is treated as evidence of a supported model
The Willow coefficient calculation can be reproduced by a spreadsheet, R or the on-site arithmetic. Matching 1.2 and 0.7 verifies the fit, not causal identification or coverage. Changed fact: a required outcome is absent and software silently omits its row. Record the changed sample and recompute the actual estimand and comparability. Do not report the original sample size or assume the omitted observation equals zero.
Model 2 — Forecast demand is treated as completed contribution
At response 12, capacity 10 caps Willow's net at 10×60−480=120. Changed fact: capacity 12 requires 180 extra. The 12 response now yields 720−480−180=60, less than the earlier 120. Include all incremental resources and compare the same response scenario. This is a conditional scenario, not an observed or identified response.
Model 3 — A mean demand is inserted into a nonlinear action rule
Suppose Willow demand is 4 or 12 with equal probability and capacity 10. Mean demand 8 does not imply expected completed 8: completed quantities 4 and 10 average 7. Expected net is 7×60−480=−60, while incorrectly capping the mean gives zero. Changed fact: capacity is 12 with no extra cost in this separate hypothetical. The cap no longer binds for either state and expected completed output becomes 8, giving zero. State the full distribution, action and cost boundary rather than a favorable mean alone.
Optional rubric 20 points: reproducible design and data trail 4; correct software/manual output interpretation 4; matching diagnostics and validation 4; feasible contribution/action calculation 4; complete changed-fact report 4. Optional execution and assessments do not change learner records. Independent human subject review and observed learner testing remain separately pending.