accepted_answer dict | code_blocks list | other_answers list | product string | question string | record_id string | selected_answer dict | selection_rule string | split string | thread dict |
|---|---|---|---|---|---|---|---|---|---|
{
"answer_html": "<p>Concurvity is only really an issue if it causes the estimated effects of other terms to change qualitatively when you remove one of the concurved terms.</p>\n<p>In this instance, I don't see why you need to decompose the 2d function <span class=\"math-container\">$f(\\text{time}, \\text{z})$</spa... | [
{
"block_index": 0,
"code_text": "\nm <- gam(y ~ s(time) + s(subject, bs = \"re\") + s(z) + ti(time, z), data = dat)\n",
"language": "unspecified",
"language_note": "Syntax-screened scientific code; language not asserted; not executed",
"post_id": 676821,
"sha256": "26b22c75d5bb179af3f2834ca... | [] | code_qa | I have repeated-measures data — multiple observations per subject over time — and a covariate that is constant within subject (e.g., a baseline characteristic measured once). My model includes a subject-level random intercept and I want to test whether this covariate's association with the outcome changes over time.
... | Scientific-Code-and-Analysis-QA:stats:676821 | {
"answer_html": "<p>Concurvity is only really an issue if it causes the estimated effects of other terms to change qualitatively when you remove one of the concurved terms.</p>\n<p>In this instance, I don't see why you need to decompose the 2d function <span class=\"math-container\">$f(\\text{time}, \\text{z})$</spa... | accepted; otherwise maximum score >= 1, tie lowest ID; no correctness label | train | {
"accepted_answer_id": 676825,
"answers": [
{
"answer_html": "<p>Concurvity is only really an issue if it causes the estimated effects of other terms to change qualitatively when you remove one of the concurved terms.</p>\n<p>In this instance, I don't see why you need to decompose the 2d function <span c... |
null | [
{
"block_index": 0,
"code_text": "#\n# log(f(k; nu))\n#\nlf <- function(k, nu) {\n n <- length(k)\n i <- seq_len(n)\n sum(lbeta((rev(k) + 1)/2, (nu - cumsum(rev(k)) + rev(i) - 1) / 2))\n}\n#\n# Absolute multivariate moments.\n# (They can be fractional--but not negative.)\n#\nmu <- function(k, nu, sigma =... | [] | code_qa | The following is a multivariate Student's t distribution
$$ p_{\sigma^2}(\mathrm{x})= {\displaystyle {N_{\nu,\sigma^2}}\left[1+\frac{1}{\nu\sigma^2}\sum_{i=1}^nx_i^2\right]^{-(\nu +n)/2}}, \;\mathrm{x}=[x_1,\cdots,x_n]^{\top}\in \mathbb{R}^n,\;\nu>2,$$ where $N_{\nu,\sigma^2}=\frac {\Gamma \left[(\nu +n)/2\right]}{\Gam... | Scientific-Code-and-Analysis-QA:stats:676824 | {
"answer_html": "<p><strong>I offer an elementary solution.</strong> It requires one substitution in an ordinary integral which, when repeated for each variable, yields a product of Beta function values.</p>\n<p>There are other solutions that might provide simpler formulas but are less elementary (<em>e.g.</em>, us... | accepted; otherwise maximum score >= 1, tie lowest ID; no correctness label | train | {
"accepted_answer_id": null,
"answers": [
{
"answer_html": "<p><strong>I offer an elementary solution.</strong> It requires one substitution in an ordinary integral which, when repeated for each variable, yields a product of Beta function values.</p>\n<p>There are other solutions that might provide simp... |
{
"answer_html": "<p>It is still true that the asymptotic null distribution of the LRT is the null distribution of a local Gaussian shift alternative. In your <span class=\"math-container\">$N(\\mu,\\sigma^2)$</span> example that means the asymptotic null distribution is the same as testing <span class=\"math-contai... | [
{
"block_index": 0,
"code_text": "# R code for simulation\n\nnsim=1000 # number of simulation\nnsample= 20000 # number of sample\n\nN= nsample\nT= rep(0, nsim)\n\nfor(i in 1: nsim){\n x= rnorm(mean=0, sd=1, n=N)\n muhat= mean(x)\n sigmahat= sqrt(mean((x- muhat)^2))\n ll_mu_in_H0 = sum(dnorm(x, m... | [] | code_qa | In fact I doubt if such kind of hypothesis test will be used in real work, but just out of curiosity I have a question on the property of such test.
Question. Consider an $n$-dimensional parameter $\theta= (\theta_1, \cdots, \theta_n)\in \Theta$ where $\Theta$ is an open subset in $\mathbb R^n$, and the hypothesis
... | Scientific-Code-and-Analysis-QA:stats:676842 | {
"answer_html": "<p>It is still true that the asymptotic null distribution of the LRT is the null distribution of a local Gaussian shift alternative. In your <span class=\"math-container\">$N(\\mu,\\sigma^2)$</span> example that means the asymptotic null distribution is the same as testing <span class=\"math-contai... | accepted; otherwise maximum score >= 1, tie lowest ID; no correctness label | train | {
"accepted_answer_id": 676849,
"answers": [
{
"answer_html": "<p>It is still true that the asymptotic null distribution of the LRT is the null distribution of a local Gaussian shift alternative. In your <span class=\"math-container\">$N(\\mu,\\sigma^2)$</span> example that means the asymptotic null dist... |
null | [
{
"block_index": 0,
"code_text": "library(vegan)\n\ndbrda(Y ~ pH + NO3 + MAT + Condition(Site))\n",
"language": "unspecified",
"language_note": "Syntax-screened scientific code; language not asserted; not executed",
"post_id": 676858,
"sha256": "e3b1e32f3f32fe01d572135a32ea1e26fbbec71586b485... | [] | code_qa | I am trying to evaluate which environmental variables drive variation in microbial communities. I have 5 samples collected at 15 sites, and for each sample, I have a microbial community, soil pH, soil NO3, and MAT.
I wanted to account for site when testing the effect of my environmental variables, so I tried:
l... | Scientific-Code-and-Analysis-QA:stats:676858 | {
"answer_html": "<p>There are two options for testing ordination models in <em>vegan</em>:</p>\n<ol>\n<li>model-based permutations, and</li>\n<li>design-based</li>\n</ol>\n<p>In 1. you model the site effects (like you have) and you assume the residuals are no conditionally independent, so you can just randomise the ... | accepted; otherwise maximum score >= 1, tie lowest ID; no correctness label | train | {
"accepted_answer_id": null,
"answers": [
{
"answer_html": "<p>There are two options for testing ordination models in <em>vegan</em>:</p>\n<ol>\n<li>model-based permutations, and</li>\n<li>design-based</li>\n</ol>\n<p>In 1. you model the site effects (like you have) and you assume the residuals are no co... |
{
"answer_html": "<p>Your approach is perfectly reasonable. It is true that using a caliper changes the target estimand, but it does so only when the remaining matched sample has a different covariate distribution from the overall sample. With a caliper like the one you imposed, I would guess that the matched sample ... | [
{
"block_index": 0,
"code_text": "library(MatchIt); library(cobalt)\n\ndata(\"lalonde\", package = \"MatchIt\")\n\n# Full matching\nM1 <- matchit(treat ~ age + educ + race + married + nodegree + re74 + re75,\n data = lalonde, method = \"full\", estimand = \"ATE\", tol = 1e-7,\n lin... | [] | code_qa | I was using full matching (using MatchIt, method = "full") to estimate the ATE. Now I want to extend this to examine a moderation effect by a categorical variable. I am fitting separate propensity score models within each moderator subgroup, and setting the estimand to ATE as well.
I am getting quite high weights in se... | Scientific-Code-and-Analysis-QA:stats:676867 | {
"answer_html": "<p>Your approach is perfectly reasonable. It is true that using a caliper changes the target estimand, but it does so only when the remaining matched sample has a different covariate distribution from the overall sample. With a caliper like the one you imposed, I would guess that the matched sample ... | accepted; otherwise maximum score >= 1, tie lowest ID; no correctness label | train | {
"accepted_answer_id": 676905,
"answers": [
{
"answer_html": "<p>Your approach is perfectly reasonable. It is true that using a caliper changes the target estimand, but it does so only when the remaining matched sample has a different covariate distribution from the overall sample. With a caliper like th... |
null | [{"block_index":0,"code_text":"# R code\ndof_correction<-0.5; set.seed(0)\nnum_sims<-10^4; h<-20; n<(...TRUNCATED) | [] | code_qa | "I observe 3 variables, $y_0$, $y_1$, and $y_2$, but am missing some of the observations for $y_1$, (...TRUNCATED) | Scientific-Code-and-Analysis-QA:stats:676935 | {"answer_html":"<blockquote>\n<p>is trying to use all the data a flawed concept to begin with?</p>\n(...TRUNCATED) | accepted; otherwise maximum score >= 1, tie lowest ID; no correctness label | train | {"accepted_answer_id":null,"answers":[{"answer_html":"<blockquote>\n<p>is trying to use all the data(...TRUNCATED) |
null | [{"block_index":0,"code_text":"Model <- lme( Height_BC ~ Treatments * Years * H_2007_BC_c,\n (...TRUNCATED) | [] | code_qa | "Hi could anyone please help me with this I would be really grateful. I am performing an mixed mode(...TRUNCATED) | Scientific-Code-and-Analysis-QA:stats:676937 | {"answer_html":"<p>If the treatment × time × baseline covariate interaction is significant, then t(...TRUNCATED) | accepted; otherwise maximum score >= 1, tie lowest ID; no correctness label | train | {"accepted_answer_id":null,"answers":[{"answer_html":"<p>If the treatment × time × baseline covari(...TRUNCATED) |
null | [{"block_index":0,"code_text":"data(mtcars)\n\n# Fit the same model with and without scaling the res(...TRUNCATED) | [] | code_qa | "For homework assignment regarding stepwise regression (along with forward and backwards) the profes(...TRUNCATED) | Scientific-Code-and-Analysis-QA:stats:676958 | {"answer_html":"<p>In stepwise regression, scaling the response variable changes coefficient magnitu(...TRUNCATED) | accepted; otherwise maximum score >= 1, tie lowest ID; no correctness label | train | {"accepted_answer_id":null,"answers":[{"answer_html":"<p>In stepwise regression, scaling the respons(...TRUNCATED) |
null | [{"block_index":0,"code_text":"data(summer_cat)\nputu <- summer_cat$NUS003\nGUESS <- ctmm.guess(putu(...TRUNCATED) | [] | code_qa | "I am doing a study on my university cats' home ranges. The tracker we are using is Damien Farine's (...TRUNCATED) | Scientific-Code-and-Analysis-QA:stats:676997 | {"answer_html":"<p>Welcome to CV.<br />\nThis will not be an answer to your direct questions, nor wi(...TRUNCATED) | accepted; otherwise maximum score >= 1, tie lowest ID; no correctness label | train | {"accepted_answer_id":null,"answers":[{"answer_html":"<p>Welcome to CV.<br />\nThis will not be an a(...TRUNCATED) |
{"answer_html":"<p><strong>Because it can be difficult or impossible to analyze numerical solutions (...TRUNCATED) | [{"block_index":0,"code_text":"#\n# Negative log likelihood of the Beta distribution.\n# `lgm` is th(...TRUNCATED) | [] | code_qa | "Suppose $X_1, \\dots, X_n \\overset{\\text{iid}}{\\sim} \\text{Beta}(\\alpha, \\beta)$, and I want (...TRUNCATED) | Scientific-Code-and-Analysis-QA:stats:677021 | {"answer_html":"<p><strong>Because it can be difficult or impossible to analyze numerical solutions (...TRUNCATED) | accepted; otherwise maximum score >= 1, tie lowest ID; no correctness label | train | {"accepted_answer_id":677036,"answers":[{"answer_html":"<p><strong>Because it can be difficult or im(...TRUNCATED) |
RegalFire Scientific code and analysis QA
RegalFire — AI Data Foundry
Scientific forum QA containing mechanically extracted preformatted code. Code is retained exactly after HTML entity decoding; no execution is claimed.
Verified scope
Records: 72; distinct source threads: 72; unique answers represented: 99. Domain thread counts: {"statistics": 34, "computational_science": 37, "biology": 1}. Actual record splits: {"train": 48, "holdout": 12, "test": 6, "validation": 6}.
Each record includes a canonical thread, all source answers, author attribution, original HTML, mechanically converted text, revisions and raw hash/API provenance. record_id is the primary key; thread_id is site-qualified, while original numeric question/answer IDs are retained. Citation record counts count edges; answer/thread totals are deduplicated within the product.
Sources and licensing
Official Stack Exchange API 2.3 source snapshots from Cross Validated (stats), Computational Science (scicomp) and Biology (biology), as applicable to the recorded domain distribution. Native new capture windows used the 100 most recently created answered questions for Stats and Scicomp. Biology reuses a deterministic 100-thread sample from the previously validated local capture; the original public Biology repo is unchanged. After source and additional cross-post sensitivity exclusions, the family source corpus contains 288 threads.
All retained current question and answer contributions explicitly returned CC BY-SA 4.0. This is verified per post, not assumed for historical posts. Bionic raw contained 2.5/3.0 contributions but lacked sufficient independently captured provenance/revisions; those inputs are excluded. Historical revision license fields, when supplied, are retained. See SOURCE_LICENSE_AUDIT.json and official source licensing.
Keep question titles, Biology/Computational Science/Cross Validated source identity, contributor names and available profile links, original post URLs, license links and transformation notices when redistributing. Each thread includes revision contributors and their source identifiers. Null profiles mean unavailable/deleted information; no profile is invented. Share adaptations under the applicable same or compatible license and impose no additional restrictions. Packaging does not replace source ownership or licensing. Third-party quotations and referenced images/papers may have separate rights; external assets are not downloaded or repackaged.
Deterministic product rules
QA chooses an accepted answer when present, otherwise maximum community score >=1 with lowest answer ID as tie breaker. accepted_answer remains null for a score-based fallback. Ranking requires at least two answers. RAG signals describe counts, acceptance, scores, references and time spans: they are not semantic disagreement annotations, verified difficulty or correct-answer labels. Code selection uses preformatted blocks of at least 20 characters with a documented code-syntax screen. Language is explicitly unspecified; snippets may be incomplete/pseudocode and are not executed. Citation extraction uses literal external URLs/DOI-like strings; context is a literal ±100-character text window or null when only HTML contains the reference. No DOI resolution, paper download or citation correctness claim.
Transformations and privacy
No LLM rewriting. Original API HTML remains intact. Text mechanically decodes HTML entities, preserves source text, code whitespace and TeX strings, adds literal link destinations and image-reference markers, and flattens superscript/subscript formatting. Code blocks retain exact decoded preformatted contents with SHA-256. Treat HTML/links/code as untrusted; sanitize rendered HTML and never execute snippets without a sandbox.
Patient-specific/personal medical histories, direct treatment requests and email-like identifiers are screened across both questions and answers and excluded by an English heuristic. General scientific medical discussions can remain with sensitivity flags. This is not comprehensive PII detection or clinical review. No medical advice. Rejections contain IDs/URLs/reasons without the excluded bodies. SENSITIVITY_REPORT.json describes the family screen.
Splits and overlap
One shared source-thread grouping is used by all five family products: normalized title/body/exact answer hashes and exhaustive question word-trigram Jaccard >=0.80 unite obvious duplicates. SHA-256 buckets assign 70/10/10/10 train/validation/test/holdout; observed proportions vary. Every occurrence of a thread has the same split across products. Products overlap intentionally; do not add their volumes as unique source content or concatenate one product’s held-out records into another’s training. These are publicly available forum posts: holdout is not a contamination-resistant private benchmark and lexical checks do not guarantee absence of semantic paraphrases.
Validation and reproducibility
Independent source verifiers check schema, UTF-8, author/revision attribution, actual license fields, HTTP/raw hashes, HTML/text preservation, unique IDs, complete answers and accepted consistency. A separate product engine checks eligibility, code/citation extraction, source equality, duplicates, exact split files and leakage. Five product-specific validator entry points use this engine; no builder is imported. The family passed 15 controlled corruption tests and byte-identical regeneration. validation_report.json records this product’s results; ROBUSTNESS_REPORT.json records family tests.
Run python validate_dataset.py --source-root <scientific_product_factory> with the local capture archive and source pipelines. Full raw/source validation requires that archive. Public release files omit raw bodies containing excluded data; SOURCE_MANIFEST.json records their hashes, API URLs and collection times. Fresh API collection can differ from the original snapshot. MANIFEST.json hashes every release file except itself.
Intended use and limitations
Scientific-computing assistant teams and documentation/retrieval engineers. No expert scientific correctness labels, model accuracy claims, validated code execution, clinical review or resolved-citation guarantees. Community votes are not scientific truth. This is a bounded starter evaluation corpus; expansion depends on source completeness, licensing and available API quota. Statistical QA/code subsets are small and recent; do not treat them as representative of a whole research discipline.
Custom / Private Dataset Work
RegalFire builds custom AI datasets, evaluation sets and reproducible data pipelines for research and production systems.
Language-specific filters for Python/R/MATLAB/Mathematica/shell, proprietary documentation integration, sandboxed client-approved code evaluation and private code QA.
Contact: ootiris@gmail.com Hugging Face: RegalFire
- Downloads last month
- 53