\begin{algorithm}
\caption{Anytime Valid Linear Model Summary in R}
\begin{verbatim}
mod <- summary(lm(outcome ~ . + trt*., data=df))
stderrs <- mod$coefficients[, 'Std. Error']
t2 <- mod$coefficients[, 't value']^2
ols <- mod$coefficients[, 'Estimate']
nu <- nrow(df) - length(ols)
z2 <- (mod$sigma / stderrs)^2
r <- phi / (phi + z2)
spvals <- min(1, sqrt(r) * 
    ((1 + r * (t2 / nu))^(-(nu + 1)/2)) /
    ((1 + (t2 / nu))^(-(nu + 1)/2)))
alpha <- 0.05
radii <- stderrs * sqrt(nu * ((1 - (r * alpha^2)^(1 / (nu + 1))) / 
    max(0, ((r * alpha^2)^(1 / (nu + 1))) - r)))
lower_cis <- ols - radii
upper_cis <- ols + radii
\end{verbatim}
\end{algorithm}

\begin{algorithm}
\caption{Anytime Valid Linear Model Summary in R}
\begin{verbatim}
mod <- summary(lm(outcome ~ . + trt*., data=df))
stderrs <- mod$coefficients[, 'Std. Error']
t2 <- mod$coefficients[, 't value']^2
ols <- mod$coefficients[, 'Estimate']
nu <- nrow(df) - length(ols)
z2 <- (mod$sigma / stderrs)^2
r <- phi / (phi + z2)
spvals <- min(1, sqrt(r) *
((1 + r * (t2 / nu))^(-(nu + 1)/2)) /
((1 + (t2 / nu))^(-(nu + 1)/2)))
alpha <- 0.05
radii <- stderrs * sqrt(nu * ((1 - (r * alpha^2)^(1 / (nu + 1))) /
max(0, ((r * alpha^2)^(1 / (nu + 1))) - r)))
lower_cis <- ols - radii
upper_cis <- ols + radii
\end{verbatim}
\end{algorithm}
{
    "title": "anytime-valid linear models and regression adjusted causal inference in   randomized experiments",
    "id": "2210.08589",
    "abstract": "linear regression adjustment is commonly used to analyse randomised controlled experiments due to its efficiency and robustness against model misspecification. current testing and interval estimation procedures leverage the asymptotic distribution of such estimators to provide type-i error and coverage guarantees that hold only at a single sample size. here, we develop the theory for the anytime-valid analogues of such procedures, enabling linear regression adjustment in the sequential analysis of randomised experiments. we first provide sequential $f$-tests and confidence sequences for the parametric linear model, which provide time-uniform type-i error and coverage guarantees that hold for all sample sizes. we then relax all linear model parametric assumptions in randomised designs and provide nonparametric model-free sequential tests and confidence sequences for treatment effects. this formally allows experiments to be continuously monitored for significance, stopped early, and safeguards against statistical malpractices in data collection. a particular feature of our results is their simplicity. our test statistics and confidence sequences all emit closed-form expressions, which are functions of statistics directly available from a standard linear regression table. we illustrate our methodology with the sequential analysis of software a/b experiments at netflix, performing regression adjustment with pre-treatment outcomes.",
    "categories": "stat.me math.st stat.th",
    "doi": "",
    "created": "2022-10-16",
    "updated": "2024-02-07",
    "authors": [
        "michael lindon",
        "dae woong ham",
        "martin tingley",
        "iavor bojinov"
    ],
    "affiliation": [],
    "url": "https://arxiv.org/abs/2210.08589"
}
{
    "ToxicityFilter": {
        "text_to_toxicity_attributes": {
            "thebibliography.bib": {
                "toxicity_score": 0.011120965,
                "severe_toxicity_score": 0.0012302399,
                "identity_attack_score": 0.003348306,
                "insult_score": 0.007664877,
                "profanity_score": 0.015932998,
                "threat_score": 0.007365964,
                "sexually_explicit_score": 0.014685315,
                "flirtation_score": 0.41820723
            },
            "main.bbl": {
                "toxicity_score": 0.014827953,
                "severe_toxicity_score": 0.0015258789,
                "identity_attack_score": 0.0039402717,
                "insult_score": 0.008348881,
                "profanity_score": 0.018255826,
                "threat_score": 0.007637825,
                "sexually_explicit_score": 0.0150981555,
                "flirtation_score": 0.2647355
            },
            "main.bib": {
                "toxicity_score": 0.011120965,
                "severe_toxicity_score": 0.0012302399,
                "identity_attack_score": 0.003348306,
                "insult_score": 0.007664877,
                "profanity_score": 0.015932998,
                "threat_score": 0.007365964,
                "sexually_explicit_score": 0.014685315,
                "flirtation_score": 0.41820723
            },
            "main.tex": {
                "toxicity_score": 0.012126249,
                "severe_toxicity_score": 0.0011730194,
                "identity_attack_score": 0.0038292783,
                "insult_score": 0.0076838774,
                "profanity_score": 0.015488927,
                "threat_score": 0.007598988,
                "sexually_explicit_score": 0.01250316,
                "flirtation_score": 0.21894184
            },
            "agsm.bst": {
                "toxicity_score": 0.02308189,
                "severe_toxicity_score": 0.0014400482,
                "identity_attack_score": 0.0073625734,
                "insult_score": 0.011160898,
                "profanity_score": 0.016889455,
                "threat_score": 0.007754337,
                "sexually_explicit_score": 0.014154521,
                "flirtation_score": 0.35954246
            }
        },
        "reason": null
    }
}
{
    "num_done": {
        "figure": 0,
        "algorithm": 1
    }
}
{
    "NonTrivialRenderingFilter": {
        "white_pixels_ratio": 91.58542804832857,
        "hash": "03070f1f0f0f1f5f",
        "most_frequent_color_ratio": 91.58542804832857
    }
}