r/AskStatistics • • 20h ago

Bayesian Spatial Model

4 Upvotes

I am trying to fit a spatial logistic Bayesian model using BYM2. I understand I need to assign priors to the intercept, covariates, and hyperparameters for BYM2 and I see many people use different values, but I can't figure out what is driving their choices? How do I know when to penalize something heavily versus lightly? Is there a rule of thumb? I can see what other people have done for this kind of infectious disease model, but the estimates are all over the place.


r/AskStatistics • • 1h ago

Science sells out.

1 Upvotes

Is anyone else disappointed and saddened by the excesses of our fellow STEM professionals? Everyone at Anthropic is a multi-millionaire by now. I'm just a frugal man in the East Coast but like, I don't need that much money lol. I care a lot more about working for an organization that promotes open, and accessible science with strong integrity. It used to be that way back when, in "the olden days", "scientist" was not actually a profession but rather a hobby that individuals would self-fund out of a desire to pursue their own intellectual direction, rather than the direction of some corporate entity.


r/AskStatistics • • 2h ago

Looking for the best book to learn Statistics for Data Science

Thumbnail reddit.com
1 Upvotes

r/AskStatistics • • 10h ago

Feature engineering for mixed-type time-series anomaly detection [P]

1 Upvotes

I have time-stamped results from a set of checks. Each row includes a check name, a response value, and a creation time. Responses vary in type and scale: counts, decimal values, percentages, ratios, and dates.

I’m using Isolation Forest to detect anomalies. I convert responses to numeric values with type-specific handling: percentages become proportions, large values are log-scaled, some counts are normalized by a related row count, and date responses are converted to numeric time-based values.

I’ve tested three feature-set variants: **32 features** (numeric, ratio, time, frequency-encoded, and binary features; no one-hot encoding), **38 features** (the 32 base features plus six check-family one-hot features), and **43 features** (the 38 features plus five metric-type one-hot features).

The additional features describe recent behavior (previous-result changes, rolling deviations, robust historical deviation, range breaks, and volatility), check and table context (row-normalized values and related-check behavior), timing and history (execution gaps, weekday, history length, and baseline availability), and category frequency.

False positives and false negatives remain high across the variants. I’m looking for general advice on validating whether engineered features represent useful signal, identifying redundant or noisy features, and evaluating feature sets for Isolation Forest.

What approaches would you recommend?


r/AskStatistics • • 14h ago

Checking Claude's sampling methodology

1 Upvotes

I'm validating an automated text classifier for a research write-up and want to make sure I'm reporting the uncertainty correctly.

**Setup**

- Population: 22,477 text passages (excerpts from court opinions).

- A classifier sorted every passage into three strata: "yes" (N = 7,578), "unsure" (N = 3,170), "no" (N = 11,729).

- I drew a simple random sample within each stratum (fixed seed): 20 from yes, 15 from unsure, 15 from no, and hand-labeled them blind to the stratum.

**Hand-label results (positives / sampled)**

- yes: 20 / 20

- unsure: 11 / 15

- no: 3 / 15

**What I've calculated so far**

- Per-stratum Wilson 95% intervals: yes 84–100%, unsure 48–89%, no 7–45%.

- Estimated total positives = Σ N_h · p̂_h = 7,578(1.00) + 3,170(0.733) + 11,729(0.20) ≈ 12,250.

- Naive stratified SE = sqrt(Σ N_h² p̂_h(1−p̂_h)/n_h) ≈ 1,260, so roughly 9,800–14,700.

- Recall of the "yes" stratum ≈ 7,578 / 12,250 ≈ 62%, roughly 51–78% using the endpoints above.

**Questions**

  1. Is the stratified estimator above the right approach, and is my variance formula correct (I've ignored the finite population correction since n is tiny)?
  2. The "yes" stratum came back 20/20, so its plug-in variance is zero, which seems to understate total uncertainty. What's the standard fix: Wilson/Clopper-Pearson bounds per stratum, a Bayesian beta prior, or something else?
  3. For recall I'm dividing one estimate by another. Should I use the delta method, a bootstrap within strata, or report a range from the stratum bounds like I did?
  4. The "no" stratum is the biggest and dominates the variance. If I can hand-label ~50 more passages, is it right to put most of them there (Neyman allocation), or is there a better rule?
  5. The end use is comparing rates across time periods (positives per 10,000 documents, before vs. after 2023, ratio ≈ 3.4). If the classifier's recall might differ by period, what's the cleanest way to show the ratio is robust? Right now I recompute it counting the "unsure" stratum as positive (ratio drops to 3.2) and call that a sensitivity check.

Thanks. Happy to share more detail on the sampling.


r/AskStatistics • • 2h ago

What is the most controversial data cleaning or imputation habit you see in practice?

0 Upvotes

We spend so much time debating model selection, priors, and p-values, yet half the variance in real-world projects seems to come from how someone handled missingness or outliers in the first 20 minutes.

​For those working with messy production or research data: what is a common preprocessing shortcut (like blind mean imputation,,,arbitrary IQR outlier dropping, or treating ordinal scales as continuous) that drives you crazy or one that people over-complicate when simple methods work fine?