Did the observations change, or did the context?

A before-and-after difference in one person's diary is easy to compute. This workbench asks whether it survives calendar drift, travel and the way one day follows another.

It works through three questions in order: which rows actually support the comparison, whether the phase can be told apart from calendar time, and what happens to the uncertainty once dependence between days is kept. Phase labels describe observations that already exist, and the page gives no health advice.

A twelve-week diary, time running upward: each day hangs from the fitted level of its phase by its residual, and a break in the stalk is a day missing. The pigment line is the step between the phases; the roots below are that step in 400 resamplings.

The observation workbench

The diary in the example is made up. Whatever you paste stays on this page and is never sent.

Both diaries hold the same measurements. Only the phase column differs.

Closing the page discards edits. The export contains the full input, so do not paste anything that identifies a person.

CSV schema, limits and missing values

Required headers: date,phase,sleep_hours,energy,travel. Optional: sequence,block. Column order may vary. Dates must be valid YYYY-MM-DD, 1900 to 2100, unique across the file. Rows are sorted by date; original line numbers are retained.

Phase: A or B. Sleep: 0 to 24 hours. Energy: a self-defined 0 to 100 score with consistent meaning across rows. Travel: 0 or 1. Empty or NA numeric cells are missing and stay missing. A gap in the outcome you did not select leaves the row in.

Sequence and block labels accept 1 to 24 letters, digits, underscores or hyphens. Blank labels mean series-1 and all. Up to 6 sequences add fixed intercepts; blocks only restrict resampling. Consecutive calendar dates and matching labels define a run. A missing date is a gap.

Maximum 366 rows and 100,000 characters. Adjustment requires at least 12 complete cases and 3 per phase. Quoted single-line CSV cells are accepted; a line break inside a cell is refused. The bounds check that a value is plausible data.

Every run also compares lengths 1, 3, 7 and 14, with and without travel. The primary length is the one you chose before the run.

Waiting for the local engine.

Check a downloaded analysis against a fresh run

Paste a file downloaded from this page. The CSV and options inside it are analyzed again here, and every value is compared: numbers within 1e-9, everything else exactly.

Nothing compared yet.

Method and limits

Estimate an association

The model is outcome = intercept + phase B + centered calendar weeks + travel + optional sequence intercepts. Constant travel is omitted and disclosed. The time coefficient is per seven calendar days; the intercept refers to mean sample time, phase A, travel 0 when included, and the first sorted sequence label.

Both contrasts use the same complete cases: selected outcome and travel must be present. Missing values stay missing, the other outcome is ignored, and phase labels describe what happened rather than assign it. With a single switch, phase and anything else that changed on that date are the same column; alternating the phases, as in the second example, is what separates them from calendar time.

Inspect numerical support

Column-scaled, column-pivoted Householder QR avoids normal-equation inversion. A relative 1e-10 rank threshold rejects aliased columns; a rank failure leaves only the descriptive comparison. Diagnostics include the scaled triangular condition number, leverage, residual error, phase predictability from nuisance columns and adjacent-day residual correlation.

Residual correlation at lag h pairs residuals h calendar days apart inside one complete run with matching sequence and block labels; lag 1 is the adjacent-day figure in the diagnostics. Gaps end a run, so long lags rest on fewer pairs. The plus or minus 2 over root-pairs marks are a reading aid. VIF is 1 / (1 - R-squared) for phase regressed on the nuisance columns. Rows with leverage above 2p/n, twice the average, are ringed on the trajectory.

Resample dependent errors

A fixed-design residual moving-block bootstrap samples overlapping blocks with replacement inside sequence/block pools. Missing or excluded rows, label changes and date gaps split runs. A full source window is required; only the last sampled block at a target-run boundary is truncated. Residuals are centered and multiplied by sqrt(n / residual degrees of freedom).

Intervals use the 2.5th and 97.5th percentiles, linearly interpolated at (replicates - 1) times the quantile. They condition on linear mean structure and stationary, exchangeable residual blocks within each pool. Short runs truncate dependence; few source windows can make intervals misleadingly narrow. These are pointwise intervals for an association.

What the export holds

JSON contains the exact CSV, normalized source rows, missingness, original line numbers, all exclusions, options, derived seeds, coefficients, IID standard errors, fitted values, residuals, leverage, bootstrap phase draws, intervals, pool sizes and method references. The engine version and the inputs fix the computation, so the same file always gives the same numbers.

Computation is capped at 366 rows, 6 sequences and 1,000 replicates per cell. Small scheduled batches allow cancellation. An input change invalidates old results and disables export. The check panel reruns the CSV and options inside a pasted export and walks both results key by key; it reports the first differences by JSON pointer.

Primary methodology references
  1. Householder, A. S. (1958). Unitary Triangularization of a Nonsymmetric Matrix. Orthogonal transformations behind the least-squares solver.
  2. Kunsch, H. R. (1989). The Jackknife and the Bootstrap for General Stationary Observations. Dependence-preserving block resampling; this workbench applies it to fitted residuals at fixed design.
  3. NIST/SEMATECH e-Handbook: Process Modeling, Model Validation. Residual analysis as a check on model adequacy.

The references name where each method comes from, and the page only links to them. Missing-not-at-random data, nonlinear drift, carryover and unmeasured confounding remain outside the model.