statistics:regression
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| statistics:regression [2026/08/19 18:14] – Consistency pass: 33→42 in the limitations bullet, two crawl papers cluster not one (fold vs probe reconciled), zero-inflation and site-random-effect open questions aligned with the corrected findings. Authored by Claude karel.kubicek.claude | statistics:regression [2026/08/21 14:50] (current) – Boxes: <wrap> renders a span, use uppercase <WRAP>; one box per list, not per bullet karel.kubicek.claude | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Regression ====== | ====== Regression ====== | ||
| - | A hypothesis test asks whether two groups of sites differ. A regression asks **by how much, holding other things constant** — and that is almost always the question a web measurement actually has. Do sites with a consent banner set fewer third-party cookies //once you account for site rank, category and country//? Does the number of trackers go up after a policy deadline //once you account for the fact that popular sites had more to begin with//? Every one of those is a regression, and this page is about the four things that make one hard here rather than in a textbook: your outcome is a **count** or a **binary flag per site**, not a nice continuous number; your rows are **not independent** because the same site appears twice or shares a tag manager with two hundred others; your coefficient is **not causal** unless you did something specific to make it so; and half the time the model in the paper is not doing inference at all, it is a **classifier**. | + | A hypothesis test asks whether two groups of sites differ. A regression asks **by how much, holding other things constant** — and that is almost always the question a web measurement actually has. Do sites with a consent banner set fewer third-party cookies //once you account for site rank, category and country//? Does the number of trackers go up after a policy deadline //once you account for the fact that popular sites had more to begin with//? Every one of those is a regression, and this page is about the four things that make one hard here rather than in a textbook: your outcome is a **count** or a **binary flag per site**, not a nice continuous number; your rows are **not independent** because the same site appears twice or shares a tag manager with two hundred others; your coefficient is **not causal** unless you did something specific to make it so; and often enough to matter |
| This page assumes you know what a regression coefficient and a standard error are. It does not explain the linear model. What it does is date the practice: which model families this literature actually fits, what it does about repeated crawls of the same site (essentially nothing), and what changed in 2025–2026. | This page assumes you know what a regression coefficient and a standard error are. It does not explain the linear model. What it does is date the practice: which model families this literature actually fits, what it does about repeated crawls of the same site (essentially nothing), and what changed in 2025–2026. | ||
| Line 18: | Line 18: | ||
| Two gaps are worth naming on their own. | Two gaps are worth naming on their own. | ||
| - | * **Random-effects models are a user-study technique that has not crossed over.** Across all 5,859 papers, **76 fit a random-effects or multilevel model. 58 of the 76 (76.3%) recruited human participants. Four ran a crawl, and not one of the four fits //the site// as the random effect.** Participants get modelled as random effects routinely and correctly — Yuan et al. {[yuan2024_adversarial]} write //"We treat each participant as a random effect because the same user has viewed 15 webpages (i.e., repeated measures)"// | + | * **Random-effects models are a user-study technique that has not crossed over.** Across all 5,859 papers, **76 fit a random-effects or multilevel model. 58 of the 76 (76.3%) recruited human participants. Four ran a crawl, and not one of the four fits //the site// as the random effect.** Participants get modelled as random effects routinely and correctly — Yuan et al. {[yuan2024_adversarial]} write //"We treat each participant as a random effect because the same user has viewed 15 webpages (i.e., repeated measures)"// |
| * **Overdispersed counts are usually not fitted with a count model.** A full-text probe across 5,869 stored papers finds **6 that use the word " | * **Overdispersed counts are usually not fitted with a count model.** A full-text probe across 5,869 stored papers finds **6 that use the word " | ||
| - | And the one thing that surprises people: **whether ignoring the repeated crawls makes your //p//-value too small or too large depends on where your predictor varies.** For a site-level predictor it is too small (7.8% false positives at two waves, **32.4% at twelve**). For a before/ | + | And the one thing that surprises people: **whether ignoring the repeated crawls makes your //p//-value too small or too large depends on where your predictor varies.** For a site-level predictor it is too small (8.6% false positives at two waves, **32.4% at twelve**). For a before/ |
| </ | </ | ||
| Line 27: | Line 27: | ||
| * **Gelman, Hill & Vehtari, // | * **Gelman, Hill & Vehtari, // | ||
| - | * **Shmueli, "To Explain or to Predict?" | + | * **Shmueli, "To Explain or to Predict?" |
| * **Cameron & Miller** {[cameron2015_practitioners]} and **MacKinnon, | * **Cameron & Miller** {[cameron2015_practitioners]} and **MacKinnon, | ||
| - | * **Ver Hoef & Boveng** {[verhoef2007_quasipoisson]} — quasi-Poisson against negative binomial for overdispersed counts, in four pages and one figure. If your outcome is " | + | * **Ver Hoef & Boveng** {[verhoef2007_quasipoisson]} — quasi-Poisson against negative binomial for overdispersed counts, in seven pages. If your outcome is " |
| * **Mood** {[mood2010_logistic]} (European Sociological Review 2010) — " | * **Mood** {[mood2010_logistic]} (European Sociological Review 2010) — " | ||
| * **Barr et al.** {[barr2013_maximal]} — "Keep it maximal": | * **Barr et al.** {[barr2013_maximal]} — "Keep it maximal": | ||
| Line 45: | Line 45: | ||
| The corpus separates them, and the split is stark. **155 papers name a regression model in '' | The corpus separates them, and the split is stark. **155 papers name a regression model in '' | ||
| - | <wrap todo> | + | <WRAP todo> |
| **Say which one you are doing, in the sentence that introduces the model.** "We fit a logistic regression of //banner present// on //rank, category and country// to estimate the association between …" and "we train a logistic-regression classifier as a baseline against our detector" | **Say which one you are doing, in the sentence that introduces the model.** "We fit a logistic regression of //banner present// on //rank, category and country// to estimate the association between …" and "we train a logistic-regression classifier as a baseline against our detector" | ||
| - | </wrap> | + | </WRAP> |
| The rest of this page is about the first activity. Classifier evaluation belongs with [[Design: | The rest of this page is about the first activity. Classifier evaluation belongs with [[Design: | ||
| Line 60: | Line 60: | ||
| The specific failure is **overdispersion**. A Poisson regression assumes variance equals mean. Real tracker counts have variance many times their mean, and when that assumption breaks the model does not merely fit badly — it reports standard errors that are far too small, and rejects true nulls at a rate nothing like its nominal α. | The specific failure is **overdispersion**. A Poisson regression assumes variance equals mean. Real tracker counts have variance many times their mean, and when that assumption breaks the model does not merely fit badly — it reports standard errors that are far too small, and rejects true nulls at a rate nothing like its nominal α. | ||
| + | |||
| + | **Compute your own variance-to-mean ratio before you choose the model, and put it in the paper.** It is one line ('' | ||
| Part A of the script below measures it. Both groups of sites are drawn from the **same** distribution, | Part A of the script below measures it. Both groups of sites are drawn from the **same** distribution, | ||
| Line 292: | Line 294: | ||
| * Vu et al. {[vu2025_assessing]} (USENIX Sec 2025) combine the count model with a design: //"we modelled the weekly attack counts … using negative binomial regression - a well-established statistical technique for interrupted time series analysis"// | * Vu et al. {[vu2025_assessing]} (USENIX Sec 2025) combine the count model with a design: //"we modelled the weekly attack counts … using negative binomial regression - a well-established statistical technique for interrupted time series analysis"// | ||
| - | <wrap todo> | + | <WRAP todo> |
| **If your count is "how many //X// out of an opportunity that varies", | **If your count is "how many //X// out of an opportunity that varies", | ||
| - | </wrap> | + | </WRAP> |
| ==== Binary per-site outcomes ==== | ==== Binary per-site outcomes ==== | ||
| Line 308: | Line 310: | ||
| **Your sample size is the number of //events//, not the number of sites.** A crawl of 100,000 sites where 400 show the behaviour you are modelling gives a logistic regression 400 events, and the usual guidance is on the order of ten events per predictor — relaxable, but knowingly {[vittinghoff2007_relaxing]}. This is the failure mode of the rare-phenomenon paper: an enormous //n// and an unstable model. | **Your sample size is the number of //events//, not the number of sites.** A crawl of 100,000 sites where 400 show the behaviour you are modelling gives a logistic regression 400 events, and the usual guidance is on the order of ten events per predictor — relaxable, but knowingly {[vittinghoff2007_relaxing]}. This is the failure mode of the rare-phenomenon paper: an enormous //n// and an unstable model. | ||
| - | <wrap todo> | + | <WRAP todo> |
| - | **A pseudo-R² of 0.07 is not a broken model, and saying so is not a weakness.** Kieserman et al. {[kieserman2025_tracker]} fit logistic regressions on 40,150 websites to explain which ones configure Google and Meta trackers to harvest form data, and write: //"It is important to acknowledge that our models are a relatively weak fit; the former has a pseudo R-squared of 0.0721"// | + | **A pseudo-R² of 0.07 is not a broken model, and saying so is not a weakness.** Kieserman et al. {[kieserman2025_tracker]} fit logistic regressions on 40,150 websites to explain which ones configure Google and Meta trackers to harvest form data, and write: //"It is important to acknowledge that our models are a relatively weak fit; the former has a pseudo R-squared of 0.0721"// |
| - | </wrap> | + | </WRAP> |
| ==== Proportions, | ==== Proportions, | ||
| * **A proportion bounded in (0,1)** — share of a site's requests going to trackers, share of a page's cookies that are third-party — is not Gaussian and its variance shrinks at both ends. **Beta regression** {[ferrari2004_beta]} is the model for it; **3 papers in 5,859 use one**, all of them on social-media outcomes rather than crawl outcomes. If the proportion is a count over a known denominator, | * **A proportion bounded in (0,1)** — share of a site's requests going to trackers, share of a page's cookies that are third-party — is not Gaussian and its variance shrinks at both ends. **Beta regression** {[ferrari2004_beta]} is the model for it; **3 papers in 5,859 use one**, all of them on social-media outcomes rather than crawl outcomes. If the proportion is a count over a known denominator, | ||
| - | * **An ordinal outcome** — a Likert response, | + | * **An ordinal outcome** — a severity band, a consent-banner " |
| * **Time-to-event** — how long until a domain is taken down, until a vulnerability is patched, until a tracker reappears — is a Cox model, used by **7 papers (1.8%)**. If your longitudinal crawl ends before some sites have had the event, that is right-censoring, | * **Time-to-event** — how long until a domain is taken down, until a vulnerability is patched, until a tracker reappears — is a Cox model, used by **7 papers (1.8%)**. If your longitudinal crawl ends before some sites have had the event, that is right-censoring, | ||
| Line 403: | Line 405: | ||
| **This is a different failure from a multiplicity problem and from a wrong test.** No correction on [[Statistics: | **This is a different failure from a multiplicity problem and from a wrong test.** No correction on [[Statistics: | ||
| </ | </ | ||
| + | |||
| + | ==== What to cluster on when there is only one crawl ==== | ||
| + | |||
| + | The panel case has an obvious clustering unit: the site. A **single-wave** crawl does not, and it is the commonest design in this corpus — which makes "what do I cluster on?" the question this page is most likely to be asked and the one the literature gives least help with. **No paper in the corpus answers it.** The two crawl papers that cluster at all cluster on the product {[becerrilarreola2023_method]} and on the website across snapshots {[nenadic2026_swiss]} — and the second is a panel, so its unit is the repeated observation rather than a structural group. Nobody has clustered a single-wave crawl on anything. | ||
| + | |||
| + | What you have to choose between, in rough order of how much dependence each induces and how easily you can observe it: | ||
| + | |||
| + | ^ Candidate cluster ^ Why sites in it move together ^ How you get it ^ | ||
| + | | **the operator / owning entity** | one company' | ||
| + | | **the consent platform** | a CMP's default template decides banner text, categories and pre-ticked boxes for every customer | detectable from the crawl itself; see [[Privacy: | ||
| + | | **the tag manager container** | one GTM container ships the same third parties to everything it is installed on | detectable from the request graph; see [[Privacy: | ||
| + | | **the CMS or site builder** | a Wix/ | ||
| + | | **hosting / CDN / IP block** | one provider' | ||
| + | | **the country or language of the site** | a whole legal regime, and often one national CMP vendor | see [[Design: | ||
| + | |||
| + | Three practical points, none of which the corpus can settle for you: | ||
| + | |||
| + | * **Cluster on the coarsest level you think the dependence lives at**, not on the one that is easiest to compute. Clustering too finely leaves the dependence in; clustering too coarsely costs precision but is not wrong. | ||
| + | * **You cannot cluster on two crossed dimensions with '' | ||
| + | * **Say which one you chose and why, even if the choice is arguable.** A stated clustering unit a reviewer disagrees with is a conversation; | ||
| ==== Four remedies, and which to pick ==== | ==== Four remedies, and which to pick ==== | ||
| ^ Remedy ^ What it estimates ^ When it is the right one ^ Cost ^ | ^ Remedy ^ What it estimates ^ When it is the right one ^ Cost ^ | ||
| - | | **Cluster-robust standard errors**, clustered on the site | the same coefficients; | + | | **Cluster-robust standard errors**, clustered on the site | the same coefficients; |
| | **Random intercept for the site** (mixed model / GLMM) | a **site-specific** effect: how the outcome changes for a given site | you want to describe between-site variance itself, or you have few observations per site and want to borrow strength | for a logistic model the coefficient is no longer the population-average one, and is not comparable with a cluster-robust fit {[mood2010_logistic]} | | | **Random intercept for the site** (mixed model / GLMM) | a **site-specific** effect: how the outcome changes for a given site | you want to describe between-site variance itself, or you have few observations per site and want to borrow strength | for a logistic model the coefficient is no longer the population-average one, and is not comparable with a cluster-robust fit {[mood2010_logistic]} | | ||
| | **Fixed effects for the site** (a dummy per site) | a purely **within-site** effect | before/ | | **Fixed effects for the site** (a dummy per site) | a purely **within-site** effect | before/ | ||
| - | | **GEE with an exchangeable working correlation** | a population-average effect, like cluster-robust | you want the marginal effect and are willing to model the correlation structure | 2 papers in this corpus use one; reviewers in this field will not recognise | + | | **GEE with an exchangeable working correlation** | a population-average effect, like cluster-robust | you want the marginal effect and are willing to model the correlation structure | 2 papers in this corpus use one, so expect to have to explain |
| - | For a crawl the honest default is **cluster-robust standard errors clustered on the site**, because it is one argument, it does not change the estimand, and thousands of clusters is exactly the regime where it works. Say //which// correction you used: '' | + | For a crawl the honest default is **cluster-robust standard errors clustered on the site**, because it is one argument, it does not change the estimand, and thousands of clusters is exactly the regime where it works. Say //which// correction you used: '' |
| ==== What a good one looks like ==== | ==== What a good one looks like ==== | ||
| Line 419: | Line 441: | ||
| That is five decisions a crawl paper has to make, made explicitly. It is also, as far as this corpus goes, the **only** one that makes all five. | That is five decisions a crawl paper has to make, made explicitly. It is also, as far as this corpus goes, the **only** one that makes all five. | ||
| + | |||
| + | Note the word **balanced**. Nenadić et al. analyse the 11,800 sites present in both snapshots, which is the clean case and not the usual one: a re-crawl six months later loses sites to expiry, blocking, redirection and rewritten pages. Dropping the lost sites silently turns your panel into a survivorship sample of the sites that stayed reachable, which is precisely the ones least likely to have changed. Report the attrition — how many sites entered, how many survived, and whether the survivors differ on the covariates you care about — before reporting the model. [[Statistics: | ||
| Two 2026 near-neighbours are worth reading alongside it, both on platform data rather than crawls: Chuai et al. {[chuai2026_consensus]} fit a //" | Two 2026 near-neighbours are worth reading alongside it, both on platform data rather than crawls: Chuai et al. {[chuai2026_consensus]} fit a //" | ||
| Line 491: | Line 515: | ||
| ==== Dependence and identification ==== | ==== Dependence and identification ==== | ||
| - | ^ Dependence handling ^ Papers ^ Share of 391 ^ | + | The dependence table is [[# |
| - | | none stated in the method name | 311 | 79.5% | | + | |
| - | | random effects (mixed-effects / multilevel) | 75 | 19.2% | | + | |
| - | | robust (heteroskedasticity-consistent) SEs only | 3 | 0.8% | | + | |
| - | | fixed effects for the unit | 3 | 0.8% | | + | |
| - | | GEE (population-averaged) | 2 | 0.5% | | + | |
| - | | "repeated-measures" | + | |
| - | | cluster-robust standard errors | 1 | 0.3% | | + | |
| '' | '' | ||
| The fold reads the **method string**, so this row is a floor: Chuai et al. {[chuai2026_consensus]} appear here under " | The fold reads the **method string**, so this row is a floor: Chuai et al. {[chuai2026_consensus]} appear here under " | ||
| + | |||
| + | Rows in both tables below overlap and neither sums to 391: **19 of the 391 have no tuple the fold could place as a model at all**, so they get no dependence or identification value, and a paper fitting two models can appear in two rows. The 372 papers that do have a placeable model produce 396 axis-2 and 377 axis-3 row memberships. | ||
| ^ Identification strategy ^ Papers ^ Share of 391 ^ | ^ Identification strategy ^ Papers ^ Share of 391 ^ | ||
| Line 534: | Line 553: | ||
| | cluster-robust standard errors | 1 | 1.6% | | | cluster-robust standard errors | 1 | 1.6% | | ||
| | fixed effects | 1 | 1.6% | | | fixed effects | 1 | 1.6% | | ||
| + | |||
| + | The dependence rows sum to 61, not 62: two of the 62 have no placeable model and one of those has no dependence value either. | ||
| Crawl papers are **more** likely to fit a count model than the regression population as a whole (11.3% against 4.3%), which is what you would expect given what they measure, and **less** likely to do anything about dependence (87.1% silent against 79.5%), which is the opposite of what the data structure warrants. **Two crawl papers in 1,120 cluster their standard errors** — Becerril-Arreola {[becerrilarreola2023_method]}, | Crawl papers are **more** likely to fit a count model than the regression population as a whole (11.3% against 4.3%), which is what you would expect given what they measure, and **less** likely to do anything about dependence (87.1% silent against 79.5%), which is the opposite of what the data structure warrants. **Two crawl papers in 1,120 cluster their standard errors** — Becerril-Arreola {[becerrilarreola2023_method]}, | ||
| Line 597: | Line 618: | ||
| ===== Open Questions ===== | ===== Open Questions ===== | ||
| + | <WRAP todo> | ||
| * **Nobody has estimated the intra-class correlation of a web-measurement outcome.** The simulation on this page shows the entire size of the error depends on it, and no paper in this corpus reports one. "What is the ICC of //sets a third-party cookie before consent// by consent platform, by CMS, by hosting provider, and by the same site across monthly crawls?" | * **Nobody has estimated the intra-class correlation of a web-measurement outcome.** The simulation on this page shows the entire size of the error depends on it, and no paper in this corpus reports one. "What is the ICC of //sets a third-party cookie before consent// by consent platform, by CMS, by hosting provider, and by the same site across monthly crawls?" | ||
| * **No crawl paper models the site as a random effect.** One non-crawl field study does {[zeng2022_factors]}, | * **No crawl paper models the site as a random effect.** One non-crawl field study does {[zeng2022_factors]}, | ||
| Line 603: | Line 625: | ||
| * **The 2022-onward arrival of causal designs is ten papers.** Whether it is a durable turn or a handful of authors with economics training is not decidable yet, and the 2025–2026 evidence for it sits in the provisional years. | * **The 2022-onward arrival of causal designs is ten papers.** Whether it is a durable turn or a handful of authors with economics training is not decidable yet, and the 2025–2026 evidence for it sits in the provisional years. | ||
| * **None of the seven venues asks for any of this.** As on [[Statistics: | * **None of the seven venues asks for any of this.** As on [[Statistics: | ||
| + | </ | ||
| ===== Related Pages ===== | ===== Related Pages ===== | ||
statistics/regression.1787163267.txt.gz · Last modified: by karel.kubicek.claude
