mizuraGet Mizura

Development snapshot · Reviewed 2026-11-08

Development docs
Use this page

Methods

A method comes first. Mizura can find and use written guidance that fits your question when the card, inputs, and runtime support it. The library below shows the guidance and where it stops.

The library

The library currently has 83 methodology cards in 12 families. Every card states its purpose, when to use it, required outputs, limitations, and references. Most also include decision criteria, assumptions, workflow and diagnostics, and a Python implementation. Some include reference code for R, Stata, SPSS, or SAS; that code is not run by Mizura. Only 12 cards declare prerequisite cards.

FamilyCardsCovers
Exploratory analysis10Variable types, missingness, distributions, outliers, sample adequacy, power, transformations, imputation
Regression9Linear, logistic, beta, gamma, Poisson, negative binomial, Tweedie, GEE, penalized
Psychometrics11Item data, reliability, EFA/CFA/SEM, IRT, invariance, latent classes, mediation/moderation
Time series11Inspection, stationarity, ACF/PACF, model selection, ARDL, volatility, forecasting
Visualizations9EDA, diagnostic, coefficient, and time-series plots
Econometrics8Panel data, IV, difference-in-differences, regression discontinuity, synthetic control, NLLS, WLS/GLS, interpretation
Hypothesis tests7Two- and multi-group comparisons, variance homogeneity, rank tests
Clinical & epidemiology5Trials, diagnostic accuracy, epidemiologic measures, longitudinal, observational
Survival3Kaplan–Meier, log-rank, Cox proportional hazards
Categorical data2Contingency tables, association
Composite indicators1Composite indicators, weighting, rank sensitivity
Research integrity7p-hacking, multiple testing, optional stopping, HARKing, selective reporting, data manipulation, misleading presentation

Method catalog

The summaries below come from each card's purpose and scope. A card is written guidance, not a promise that its method will run on every device or dataset. Four cards are explicitly marked not runnable; the others still depend on their inputs, diagnostics, installed packages, and the runtime. Pilot and reference labels describe the library profile, not validation of your study.

categorical data (2 cards)

Ordinal and Multiway Categorical Association

This entry covers association in categorical tables when order matters or when the table has more than two dimensions: ordinal association measures (Kendall's tau-b and tau-c, Goodman–Kruskal gamma, Somers' D), the linear-by-linear association test for ordered row and column scores, log-linear models for multiway tables, and correspondence analysis for the structure of large tables. It answers "is there a monotone association", "does the…

Runnable guidance: pilot: Pilot profile: establish the ordering and score policy before computing ordinal measures.

Contingency Tables: Independence, Exact, and Paired Tests

This entry covers inference for categorical count tables: the chi-square test of independence for an r × c table (Pearson and likelihood-ratio forms), the 2 × 2 routes (continuity-corrected chi-square, Fisher's exact test, odds ratio), McNemar's test for paired binary measurements, and Cochran's Q for three or more matched binary conditions. The tests answer whether the row and column classifications are associated, whether a paired treatment…

Runnable guidance: stable

clinical epidemiology (5 cards)

Clinical-Trial Analysis and Estimands

Clinical-trial analysis begins with a protocol-defined treatment effect, target population, endpoint, and handling of events that occur after randomization. An estimator cannot repair a mismatch between that question and the analysis set. This entry routes common parallel-arm endpoints to standard Python library calls and states which trial methods are not implemented.

Not runnable: blocked: Blocked for runtime execution: trial estimand, analysis set, and intercurrent-event handling require protocol review first.

Diagnostic Accuracy and Clinical Prediction

Diagnostic accuracy asks how a test classifies a target condition against a reference standard in a defined clinical setting. Prediction asks how well a model estimates outcomes in people who were not used to fit it. These questions share binary outcomes but require different designs and summaries. The project can produce contingency tables and logistic-model discrimination diagnostics; it does not currently provide a complete…

Runnable guidance: pilot: Pilot profile: predictive values depend on prevalence; report them only for a representative sample.

Prevalence, Risk, and Incidence Rates

This entry distinguishes the main frequency measures used in clinical and population health studies and maps them to binary contrasts, person-time GLMs, and explicitly external single-sample interval calculations. They share a numerator of cases or events but use different denominators and answer different questions. Choosing the wrong denominator changes the estimand; a correctly computed number can still be misleading if the design does not…

Not runnable: reference: Reference card: distinguish prevalence, cumulative risk, and incidence rate before estimating anything.

Longitudinal and Clustered Outcomes

Repeated measurements from the same person and observations grouped within clinics, families, or sites are correlated. Treating them as independent usually understates uncertainty and can distort the target effect. This entry routes simple paired or rank-based comparisons and continuous Gaussian mixed-effects models, while identifying the generalized and design-based methods this entry's template does not cover.

Runnable guidance: pilot: Pilot profile: state the assignment and observational units and match inference to them.

Observational Epidemiology: Association and Causal Inference

Observational epidemiology estimates disease frequency and exposure–outcome associations when exposure is not randomly assigned. The analysis must match the sampling design and target contrast. Regression can adjust for measured covariates under assumptions; it cannot by itself establish causal identification or repair selection, measurement, or unmeasured-confounding bias. This entry maps common questions to general regression and 2×2…

Runnable guidance: pilot: Pilot profile: adjustment does not establish causation; state the confounders and the design.

composite (1 cards)

Composite Indicators

A composite indicator compresses several sub-indicators into one number per unit (country, region, firm, hospital) so units can be compared or ranked. The OECD/JRC Handbook on Constructing Composite Indicators (2008) is the standard reference, and the JRC Competence Centre on Composite Indicators and Scoreboards (COIN) still follows its ten steps. Every step contains a choice (indicator set, imputation, normalisation, weights, aggregation)…

Runnable guidance: pilot: Rankings depend on the indicator framework and on value-laden weights; report rank intervals, not bare ranks.

econometrics (8 cards)

Difference-in-Differences and Event Studies

Difference-in-differences (DiD) compares outcome changes between treated and comparison groups to identify a treatment effect under a counterfactual parallel-trends assumption and related design conditions. In a two-group, two-period setting the contrast is (mean Y_treated,post − mean Y_treated,pre) − (mean Y_control,post − mean Y_control,pre). The target is typically an average treatment effect on the treated (ATT), not the effect for all…

Runnable guidance: pilot: Pilot profile: parallel trends is partly untestable; a non-rejected pre-trend test does not establish it, and staggered adoption needs a cohort-time estimator, not plain TWFE.

Economic Interpretation, Identification, and Inference

Translate an economic question into a conditional mean, an estimand, and an uncertainty calculation. A coefficient's units depend on the model's scale; its causal meaning depends on assignment and exogeneity. Heteroskedasticity robust or clustered standard errors change uncertainty, not the identifying assumptions or the omitted-variable bias in the point estimate. For log(Q) = alpha + betalog(P) + gammalog(I) + deltapromotion + u, beta is a…

Not runnable: reference: Reference card: causal interpretation requires a design justification, not only a fitted model.

Instrumental Variables, 2SLS, and Weak Identification

Instrumental variables use variation in an endogenous regressor induced by instruments under relevance, exclusion, and exogeneity assumptions. In the linear model Y = Wgamma + Xbeta + u, W denotes included exogenous controls, X the endogenous regressor(s), and Z excluded instruments. Two-stage least squares projects X onto the span of W and Z and estimates the structural coefficient using that variation, with an IV covariance calculation. A…

Runnable guidance: pilot: Pilot profile: diagnostics cannot verify instrument exclusion or exogeneity; report weak-identification-robust inference alongside 2SLS.

Nonlinear Least Squares (NLLS)

Estimate a conditional mean EY|X = f(X, theta) that is nonlinear in its unknown parameters by minimizing sum((Y-f(X,theta))2). Economic applications include saturation, adjustment curves, nonlinear production functions, and structural response equations. NLLS describes an estimator, not a causal design. A quadratic a+bx+cx2 is linear in its parameters and can use OLS. A saturation curve a(1-exp(-bx)) is nonlinear in b and needs nonlinear…

Runnable guidance: pilot: Pilot profile: agreement across starts is evidence, not proof of a global minimum; the sandwich covariance assumes a correctly specified mean.

Panel Data: Fixed, Random, and Correlated Random Effects

Panel methods model repeated economic observations on the same units. In Y_it = alpha_i + lambda_t + betaX_it + u_it, unit effects absorb stable unit characteristics and period effects absorb common time shocks. A fixed-effects coefficient uses variation remaining within units after the specified effects are removed; it is not automatically the causal effect of X. This entry covers static linear panels, pooled OLS, unit/time fixed effects…

Runnable guidance: pilot: Pilot profile: report the clustering level and finite-sample adjustment with every panel estimate.

Regression Discontinuity: Sharp and Fuzzy Designs

Regression discontinuity (RD) uses an assignment rule that changes at a known running-variable cutoff to identify a local effect under continuity or a justified local-randomization framework. A sharp design deterministically changes treatment at the cutoff. A fuzzy design changes treatment probability; its local Wald estimand divides the outcome jump by the treatment-probability jump under the required IV-type assumptions. This entry uses…

Runnable guidance: pilot: Pilot profile: report the cutoff, h/b, effective N and the robust bias-corrected interval with every RD estimate; a fuzzy design also needs the first-stage jump.

Synthetic Control and Comparative Policy Evaluation

Synthetic control constructs a counterfactual for a treated aggregate unit as a weighted combination of untreated donor units. In the classic convex case, weights are nonnegative and sum to one; the post-policy gap compares the observed treated outcome with that weighted donor path. Identification comes from a justified donor/counterfactual design and pre-policy information, not from optimization success alone. This entry implements a classic…

Runnable guidance: pilot: Pilot profile: the placebo rank fraction is descriptive, not a p-value or confidence interval, and a good pre-fit does not rule out coincident shocks.

Weighted, Generalized, and Feasible Generalized Least Squares

Estimate the linear conditional mean Y=Xbeta+u when errors have unequal variances or a structured covariance. GLS minimizes u' Omega^(-1) u; WLS is the diagonal special case, minimizing sum(w_iu_i2) with weights proportional to inverse error variance. FGLS estimates the covariance structure from data. These methods occur throughout econometrics and statistical modeling. For nonsingular X and positive-definite Omega, the GLS estimate solves…

Runnable guidance: pilot: Pilot profile: estimated weights add nuisance uncertainty, so report HC or bootstrap intervals from the full fit and check weighted residuals.

eda (10 cards)

Class-Imbalance Screening

This check counts outcome classes and reports their imbalance before logistic regression or classification validation. Define the imbalance ratio as the majority-class count divided by the minority-class count, so larger values mean stronger imbalance. Imbalance can leave few events for estimating slopes, increase coefficient instability and make separation more likely when predictors also partition classes. Logistic regression does not…

Runnable guidance: pilot: Pilot profile: imbalance alone is not a reason to resample; report metrics that suit the target.

Distribution Profiling

Distribution profiling summarizes each analysis variable numerically and checks its observed support before family or transformation decisions. For continuous variables report n, mean, median, standard deviation, range, selected percentiles, skewness and kurtosis. For categorical variables report valid n, category counts and rare levels. These summaries describe marginal shape; model choice depends on the conditional outcome distribution and…

Runnable guidance: pilot: Diagnostic profile only: skew flags are screens, not instructions to transform.

Missing Data Assessment

This check describes missingness by variable and observation, looks for associations between missingness indicators and observed variables, and frames the assumptions required by downstream analysis. Missingness can change the population represented by complete cases, reduce effective sample size, and make estimates biased when selection is related to the outcome or predictors. MCAR means missingness is independent of both observed and…

Runnable guidance: pilot: Diagnostic profile only: MCAR tests cannot distinguish MAR from MNAR.

Multicollinearity Screening

This check looks for linear dependencies among predictors before fitting a regression. Pairwise correlations reveal two-variable associations; they do not reveal all system-level dependencies. A predictor can be nearly explained by a combination of several other predictors even when no pairwise correlation is extreme. Multicollinearity can inflate coefficient uncertainty, destabilize signs and make individual effects difficult to separate,…

Runnable guidance: pilot: Pilot profile: build the same terms and rows as the intended model.

Multiple Imputation by Chained Equations (MICE) and Rubin's Rules

Multiple imputation by chained equations (MICE) fills missing values repeatedly using conditional models for incomplete variables. The analysis model is fitted to each completed dataset, and Rubin's rules combine its estimates and model-based variances. The pooled uncertainty reflects both sampling uncertainty within imputations and variation between imputations. This entry implements numeric-column MICE with predictive mean matching (PMM),…

Runnable guidance: pilot: Pilot profile: state the missingness assumption (MAR), report the number of imputations, FMI and the complete-case comparison, and do not interpret a single imputed dataset.

Outlier Detection

Outlier screening identifies observations unusual in one variable, a pair of variables or the joint predictor space. The purpose is to verify data quality, understand population structure and anticipate sensitivity of model estimates. An outlier is an extreme value relative to a reference distribution. An influential observation materially changes a fitted model when removed. An observation can be an outlier without being influential, or…

Runnable guidance: pilot: Diagnostic profile only: never delete a row because a screen flagged it.

Power Analysis and Alpha Justification

Power analysis answers planning questions about a design: how many observations are needed to detect a prespecified effect (a priori), what is the smallest effect a given sample could detect (sensitivity), and what error rates balance the two kinds of mistakes when the sample size is fixed (compromise analysis, the "Justify your alpha" approach of Lakens et al., 2018). This card covers the common designs: two-group t test, one-way ANOVA, the…

Runnable guidance: pilot: Pilot profile: the effect size must be the smallest effect of interest, not an observed estimate.

Sample-Size Adequacy

This check asks whether the number and distribution of observations support the proposed model's parameters and scientific target. It separates estimation precision (how uncertain and stable coefficients are) from statistical power (probability of detecting a specified effect under a specified design). A dataset can have adequate power for a large effect but poor precision for subgroup estimates; a large sample can estimate a tiny effect…

Runnable guidance: pilot: Pilot profile: ratio screens are not a power or precision calculation.

Transformations

A transformation re-expresses a variable (log, power, rank-based) to stabilise variance, reduce skew or make a relationship closer to linear. It changes the scale on which every later estimate lives, so it is a modelling decision with an interpretive cost, not a cosmetic clean-up. This entry covers when a transformation is justified, which one fits the data, how to apply it as a dataset change, and how to read results on the transformed…

Runnable guidance: pilot: Pilot profile: the comparison is a screen; confirm on the fitted model's residuals.

Variable-Type Validation

This check verifies that a variable's observed values, measurement scale, storage dtype and intended model role agree. A numeric storage type does not make values quantitative: ordinal ranks and category codes have ordering but not necessarily equal intervals. Conversely, numbers imported as strings can hide continuous, count or binary data. Incorrect scale assumptions change contrasts, model support, interpretation and the expanded design…

Runnable guidance: pilot: Diagnostic profile only: declared roles must come from the data dictionary.

hypothesis tests (7 cards)

Group Mean Comparisons: t-Tests and One-Way ANOVA

This entry covers designed comparisons of a continuous outcome's mean level across groups: the independent two-sample t-test (Student or Welch), the paired t-test, and the one-way analysis of variance (ANOVA) with Tukey post-hoc comparisons. The independent t-test estimates a difference in group means with a confidence interval and a standardized effect size (Cohen's d); the paired test estimates the mean within-person difference and its…

Runnable guidance: stable

Multiple-Group Nonparametric Comparisons

Kruskal–Wallis and Friedman are rank-based omnibus tests. Their nulls depend on the group structure and neither one identifies which groups differ. A significant omnibus result must be followed by an appropriate multiplicity- adjusted post-hoc analysis; this is required before making pair-specific claims. Kruskal–Wallis H compares k ≥ 2 independent groups. Its general null is that the group populations have the same distribution. Rejection…

Runnable guidance: pilot: Pilot profile: the omnibus test does not say which groups differ; follow with the post-hoc card.

One-Sample Location and Wald–Wolfowitz Runs Tests

This entry covers one location test and two tests of randomness. They answer different questions. One-sample sign test. Given a prespecified value m₀, the null is that m₀ is a population median, equivalently (for a continuous distribution at m₀) P(X > m₀)=P(X < m₀)=0.5. Observations equal to m₀ are ties and are excluded from the binomial sign count. Rejection is evidence that the population median differs from m₀; it does not establish a mean…

Runnable guidance: pilot: Pilot profile: state the tail convention and the hypothesized median before the test.

Nonparametric Post-Hoc Comparisons

Post-hoc procedures identify which group pairs differ after a significant omnibus rank test. They do not replace the omnibus test, correct a poor design, or show causation. Predefine the family of comparisons and the error rate to control. A pairwise rejection is evidence against that pair's null after the declared adjustment; report its effect estimate and interval as well as the adjusted p-value. | Procedure | Follows | Pairwise null and…

Runnable guidance: pilot: Pilot profile: run only after the parent Kruskal-Wallis or Friedman test rejects.

Rank Association: Spearman and Kendall Tau-b

Spearman's ρ is the Pearson correlation of the ranks of paired observations. It summarizes the strength and direction of a monotonic association: values that increase together have positive association, and values moving in opposite directions have negative association. Its usual significance test has null ρ = 0 (no population rank correlation) and uses an exact or approximate reference distribution depending on sample size and ties. A zero…

Runnable guidance: pilot: Pilot profile: rank correlation is not evidence of a linear or causal relation.

Two-Group Nonparametric Comparisons

These methods compare two independent groups or two paired measurements. They do not all test the same null: select the test from the sampling design and the estimand, not from a generic preference for ranks. A small p-value is evidence against the stated null under the method's assumptions; it does not by itself identify a causal effect, a practical difference, or a difference in means. | Method | Design and null hypothesis | What rejection…

Runnable guidance: pilot: Pilot profile: select the test from the estimand and document the resampling unit.

Conover Squared-Ranks Test for Variance Homogeneity

The Conover squared-ranks procedure tests whether independent groups have the same spread using squared ranks of absolute deviations from group medians. Its reference test is an approximate one-way F comparison of those scores. It does not test equality of raw variances directly, establish equal distributional shapes, or show that a downstream model requires homogeneous variance.

Runnable guidance: pilot: Pilot profile: a non-significant test does not establish equal variances.

psychometrics (11 cards)

Confirmatory Factor Analysis and Structural Equation Models

CFA tests a prespecified measurement model; SEM combines measurement and structural paths. Specify factors, indicators, scaling/identification, and structural paths from theory before fitting. Good global fit does not establish construct validity, uniqueness of the model, or causal direction.

Runnable guidance: pilot: Pilot profile: report the exact syntax, estimator, analyzed N and chi-square with CFI, RMSEA (with interval) and SRMR; ordinal indicators need a WLSMV/DWLS confirmation outside this template.

Common-Method Bias Screening

Common-method bias is measurement error or systematic covariance attributable to the data-collection method rather than the constructs. The template implements only Harman's single-factor screen (the variance carried by one common factor, with the first principal component for comparison). It does not fit the common latent factor model and does not estimate a method effect.

Runnable guidance: pilot: Pilot profile: Harman single-factor is a weak screen; report it as a limited diagnostic next to procedural controls, not as evidence that method bias is absent.

Exploratory Factor Analysis

EFA explores a latent-factor structure that may account for item covariation. Use it when the factor structure is not yet fixed, not as confirmation of a structure chosen after inspecting the same results. EFA models common variance; principal components analysis is a different data-reduction target.

Runnable guidance: pilot: Pilot profile: EFA is exploratory; nominate a separate validation sample before confirming structure.

Measurement Invariance and Differential Item Functioning

Measurement invariance asks whether a measurement model operates comparably across groups. DIF asks whether a particular item response differs by group after matching respondents on the measured trait or score. A group difference in observed scores can reflect construct differences, measurement differences, or both; these tools do not by themselves distinguish causes.

Runnable guidance: pilot: Pilot profile: report which invariance levels were tested and the criterion used; DIF needs a validated matching score, and flagged items should be reviewed for content before removal.

Item Networks

The template estimates a regularized partial-correlation network among survey items with EBIC-glasso. An edge represents a conditional association under the estimated Gaussian graphical model, given the other included items. It is not a causal edge or evidence of a directional process.

Runnable guidance: pilot: Pilot profile: report the correlation type, EBIC gamma and analyzed N; edges are regularized conditional associations, and centrality estimates are unstable without a bootstrap.

Item Response Theory

IRT models item responses as a function of a latent trait, allowing item parameters and measurement precision to vary across the trait range. Use Rasch for a dichotomous, constrained-discrimination model; 2PL for dichotomous items with item-specific discrimination; and the graded response model (GRM) for ordered polytomous items. auto selects 2PL for dichotomous and GRM for polytomous items.

Runnable guidance: pilot: Pilot profile: state the model, analyzed N and category handling; report conditional test information and standard errors, not only a scalar reliability, and check dimensionality and local dependence separately.

Latent Class and Latent Profile Analysis

Latent class analysis (LCA) identifies unobserved groups from categorical indicators. Latent profile analysis (LPA) uses continuous indicators and a Gaussian mixture model. These models describe probabilistic response profiles; they do not prove that natural, fixed kinds of people exist.

Runnable guidance: pilot: Pilot profile: report the full enumeration with BIC and relative entropy, confirm the solution is replicated across starts, and do not treat modal class labels as error-free.

Mediation and Moderation

Mediation describes a proposed pathway from predictor X through mediator M to outcome Y; moderation asks whether the X–Y association varies with a moderator. These are different questions. Statistical decomposition alone does not prove a causal mechanism or establish temporal ordering.

Runnable guidance: pilot: Pilot profile: state the design that justifies a causal reading, report effects with intervals and the analyzed N, and note that observed-score paths ignore measurement error.

Ordinal and Multinomial Regression

Use ordinal regression when a multi-category outcome has a defensible order, and multinomial logistic regression when outcome categories are nominal. These tools fit independent respondent-level models with complete-case rows. They do not support repeated or clustered outcomes, survey weights, or causal identification.

Runnable guidance: pilot: Pilot profile: state the outcome order (ordinal) or reference category (multinomial), the complete-case N, and check proportional odds before interpreting cumulative odds ratios.

Reliability, Item Analysis, and Scale Scoring

Use these tools to examine internal consistency and classical item statistics, then compute a score only when the item set and scoring rule are supported by the instrument or a defensible measurement model. Reliability is score consistency under specified assumptions, not evidence of unidimensionality, validity, or interchangeability of items.

Runnable guidance: pilot: Pilot profile: state the item set, response-scale bounds and reverse-keyed items, report alpha with its interval and the complete-case N, and check dimensionality before treating the items as one scale.

Survey Data Foundations

This entry covers item classification, item-level summaries, and survey missing- data screening. These are preparation and description tools. They do not establish the intended construct, validate an instrument, impute values, or determine a correct scale score.

Runnable guidance: pilot: Pilot profile: verify coding, reverse-keying and response order against the codebook before trusting these summaries; the descriptives and missingness diagnostics do not replace that check.

regression (9 cards)

Beta Regression

Beta regression models a continuous response on the open unit interval, 0 < Y < 1. In the mean–precision parameterization, Y | X ~ Beta(μ φ, (1 − μ) φ) and logit(μ) = Xβ. The conditional mean is μ = EY | X; its variance is μ(1 − μ) / (1 + φ). The precision φ controls concentration around the mean. The logit link keeps fitted means inside (0, 1). Exponentiated mean coefficients multiply the odds μ / (1 − μ) of the conditional mean; they are…

Runnable guidance: stable

Gamma Regression

Gamma regression models a strictly positive continuous outcome. This entry uses the Gamma mean–variance relationship EY | X = μ, Var(Y | X) = φ μ², and log(μ) = Xβ + offset. The dispersion φ controls relative variability: under a constant-dispersion Gamma model, the conditional coefficient of variation is sqrt(φ). With the log link, exp(β) is a multiplicative change in the conditional mean for a one-unit predictor increase, holding other…

Runnable guidance: pilot: Pilot profile: confirm positive support and the mean-variance relationship before interpreting mean ratios.

Generalized Estimating Equations

Generalized estimating equations (GEE) model a population-averaged, or marginal, mean for clustered or repeated outcomes: g(EY_ij | X_ij) = X_ij β + offset_ij. Clusters are independent of one another, while observations within a cluster may be correlated. Coefficients describe marginal associations conditional on the modeled covariates, averaged over the population rather than conditional on a subject-specific random effect. With a logit…

Runnable guidance: pilot: Pilot profile: report the number of clusters, the working correlation and its estimate, and use bias-reduced covariance with fewer than 40 clusters.

Ordinary Least Squares / Linear Regression

OLS estimates a conditional mean EY | X = Xβ by minimizing the sum of squared residuals. The design matrix may include indicator variables, interactions and prespecified transformations; linearity means linear in β. With full column rank, β̂ = (XᵀX)⁻¹Xᵀy. Under Eε | X = 0 it is unbiased conditional on X. Constant error variance and uncorrelated errors make it the best linear unbiased estimator. Independent Gaussian errors additionally justify…

Runnable guidance: stable

Binary Logistic Regression

Binary logistic regression models the conditional event probability as logit(P(Y=1 | X)) = Xβ. Coefficients are changes in log odds; exp(β) gives odds ratios. Odds ratios are not risk ratios or probability differences. The model estimates associations unless a defensible identification design supports a causal interpretation. This entry covers independent, row-level binary outcomes with complete-case estimation. The response must have exactly…

Runnable guidance: stable

Negative Binomial Regression

Negative binomial regression models a nonnegative count outcome when its conditional variance exceeds its conditional mean. This entry uses the NB2 parameterization Y | X ~ NB2(μ, α) and Var(Y | X) = μ + α μ², with log(μ) = Xβ + offset. The current estimator jointly estimates regression coefficients and the dispersion parameter α by maximum likelihood. It uses the log link and reports incidence-rate ratios (IRRs), where exp(β) is the…

Runnable guidance: stable

Penalized Gaussian Regression (Ridge, Lasso, Elastic Net)

This entry covers Ridge, Lasso, and Elastic Net for prediction with a continuous outcome and a linear mean function. It selects penalty strength by cross-validation and reports regularized coefficients; it does not provide ordinary coefficient inference or select a causal adjustment set.

Runnable guidance: pilot: Pilot profile: penalized coefficients are shrunken and have no standard errors; do not report p-values.

Poisson Regression

Poisson regression models nonnegative counts with a log-linked conditional mean, log(μ) = Xβ + offset, and the Poisson variance restriction Var(Y | X) = μ. Exponentiated coefficients are rate ratios (RRs, often called incidence-rate ratios): exp(β) is the multiplicative change in expected count per one-unit predictor increase, holding other terms fixed. With an exposure offset, coefficients describe rates per exposure unit. An RR is not an…

Runnable guidance: pilot: Pilot profile: adapt the card example and report overdispersion before interpreting rate ratios.

Tweedie Regression

A Tweedie generalized linear model specifies a conditional mean and a power variance function: EY | X = μ, Var(Y | X) = φ μ^p, and log(μ) = Xβ + offset. This entry covers 1 < p < 2, the compound Poisson-Gamma form. It permits exact zeros and positive continuous values. The zero probability and the positive-value severity are both implied by the same distributional model; this is not a separate structural-zero process. Coefficients are on the…

Runnable guidance: pilot: Pilot profile: the variance power is fixed, not estimated; check sensitivity to it.

research integrity (7 cards)

Data Manipulation, Falsification and Fabrication

This card separates three things that are often run together. - Legitimate data preparation: corrections, exclusions and transformations made for a reason unrelated to the result, documented, and reversible from the original data. - Result-driven manipulation: the same operations chosen because of their effect on the result, such as removing observations that weaken an effect or picking a cut point that gives significance. This inflates false…

Runnable guidance: pilot: Fabrication and falsification are refused. A screen flag needs an explanation and is not evidence of misconduct; a clean screen does not show data are genuine.

HARKing and Exploratory Versus Confirmatory Analysis

HARKing is hypothesising after the results are known: finding a pattern in the data and then presenting it as the hypothesis the study set out to test (Kerr, 1998). The data that suggested a hypothesis cannot also test it, because the pattern was selected for looking strong. The test is then guaranteed a favourable start, and the reported p-value does not mean what it appears to. Exploration itself is valuable and is how hypotheses are found.…

Runnable guidance: pilot: Pilot profile: no check of the data can show whether a hypothesis came before the results; a random split is wrong for clustered or temporal data.

Misleading Presentation of Statistical Results

A correct number can still leave a false impression. This card covers the common ways that happens, and the honest version of each: relative risk with no baseline, a bar chart with a truncated axis, significance presented as size, "trending toward significance", a non-significant result read as "no effect", and claims that two groups differ because one result is significant and the other is not (Gelman and Stern, 2006). Most of these are…

Runnable guidance: pilot: Pilot profile: the lie factor applies to marks whose length encodes the value, such as bars, and not to points or lines.

Multiple Testing and Multiplicity Correction

Each test at alpha .05 has a 5% false positive rate when its null is true, so a set of tests has a much higher chance of at least one. Twenty independent tests of true nulls give about a 64% chance of a false positive. Multiplicity correction controls an error rate across a declared family of tests. This card covers choosing the family, choosing the error rate, and applying Bonferroni, Holm, Benjamini-Hochberg (BH) and Benjamini-Yekutieli…

Runnable guidance: pilot: Pilot profile: a correction is valid only for a complete family declared before results are seen.

Optional Stopping and Sequential Analysis

Optional stopping is checking the result while data accumulate and stopping when it is significant. Under a true null a test statistic wanders, so given enough looks it will eventually cross any fixed threshold. Testing at .05 at each of five equally spaced looks gives an overall false positive rate of about 14%, not 5% (Armitage et al., 1969). The same inflation applies to continuing to collect only because a result is "nearly significant",…

Runnable guidance: pilot: Pilot profile: boundaries applied after the fact show what a plan would have required; they do not make unplanned monitoring valid.

P-Hacking and Specification Searching

P-hacking is choosing how to analyse data according to the p-value each choice produces: trying covariate sets, outcomes, subgroups, transformations, exclusion rules or tests until one crosses a threshold, then presenting that one as if it had been the plan. Each choice can be defensible alone. The harm comes from selecting among them on the result, because the nominal p-value assumes a single test fixed in advance (Simmons et al., 2011). The…

Runnable guidance: pilot: Pilot profile: permutation p-values assume an exchangeable treatment and are descriptive for observational data.

Selective Reporting, Outcome Switching and Publication Bias

Selective reporting means the results a reader sees depend on what the results were. Within a study, this takes the form of reporting only the significant outcomes, subgroups or time points, or of quietly replacing a planned primary outcome with one that worked (Chan et al., 2004). Across a literature, it is the file drawer: null results stay unpublished (Franco et al., 2014). In both cases each number can be correct while the set of numbers…

Runnable guidance: pilot: Pilot profile: these screens show small-study effects and patterns, not intent, and have little power below 10 studies.

survival (3 cards)

Cox Proportional Hazards Regression

The Cox model relates covariates to the instantaneous event hazard while leaving the baseline hazard unspecified: \h(t\mid x)=h_0(t)\exp(x^T\beta).\ Exponentiated coefficients are hazard ratios conditional on the other model terms. This entry covers the template’s right-censored, independent-row, complete-case implementation, including optional stratification and proportional-hazards (PH) diagnostics. An association is not a causal effect…

Runnable guidance: stable

Kaplan–Meier Survival Estimation

The Kaplan–Meier product-limit estimator describes the probability of remaining event-free beyond time t while accounting for right-censored observations. It estimates an unadjusted survival function, not a causal treatment effect. The template below (lifelines) reports pointwise Greenwood log-log survival intervals, median survival with its interval from lifelines' band inversion (an unbounded limit stays unbounded and is returned as null),…

Runnable guidance: stable

Log-Rank and Weighted Survival-Curve Tests

Log-rank tests compare unadjusted time-to-event distributions between groups while accounting for right censoring. The template (lifelines) reports a chi-square omnibus test for two or more groups and supports the standard log-rank, Wilcoxon/Breslow, and Tarone–Ware weightings. It does not estimate an adjusted effect or identify which pairs differ after a significant multi-group result.

Runnable guidance: stable

time series (11 cards)

ARDL and Nonlinear ARDL

ARDL models a dependent series using its own lags and distributed lags of regressors. Its bounds procedure tests for a level relationship in the associated unrestricted error-correction model when regressors are I(0), I(1), or mixed, but none is I(2). In the bounds F-test, the null sets the lagged level coefficients jointly to zero (no level relationship); the t-test examines the lagged dependent-level coefficient. NARDL extends this…

Runnable guidance: pilot: Pilot profile: bounds inference needs a reviewed lagged-level model.

Automatic ARIMA Order Search

The automatic ARIMA search in the example below fits candidate (p,d,q) orders at the supplied fixed d, ranks fitted candidates by AIC, BIC, or HQIC, and refits the selected candidate. It does not select d, test stationarity, search seasonal orders, choose an exogenous-regressor set, or validate the chosen model. A selected order is a candidate fit under the search bounds, not evidence that the model is correctly specified.

Runnable guidance: pilot: Pilot profile: d comes from the unit-root decision; the grid searches p and q only.

Fourier-ARIMA for Long Cycles

Fourier-ARIMA represents a stable deterministic cycle with K sine/cosine pairs at the prespecified period S, while an ARIMA error process models remaining serial dependence: y_t = Σk=1..K{a_k sin(2πkt/S) + b_k cos(2πkt/S)} + η_t, η_t ~ ARIMA(p,d,q). The Fourier coefficients jointly describe cycle shape. For an individual harmonic, amplitude is sqrt(a_k²+b_k²) and phase depends on both coefficients; a coefficient by itself is not the…

Runnable guidance: pilot: Pilot profile: the period must be known from the sampling process.

Multivariate Time-Series Models: VAR, Cointegration, and VECM

This entry routes multivariate time-series analysis by the established integration orders. It covers VARs for stationary systems, cointegration testing and VECMs for cointegrated I(1) systems, and differenced VARs when I(1) series are not cointegrated. It does not establish structural causation from predictive tests or impulse responses without additional identification.

Runnable guidance: pilot: Pilot profile: integration orders must be established per series first.

Stationarity Screening

Stationarity screening checks whether a time series' stochastic behavior is stable over the observed interval before choosing a time-series model. Weak stationarity requires a time-invariant mean and variance and autocovariance that depends on lag rather than calendar time. A time plot plus rolling mean and variance can reveal trend, level shifts, changing volatility or seasonal structure that unit-root tests do not fully describe. The…

Runnable guidance: pilot: Pilot profile: a screen on a gap-free, regularly spaced series.

ACF/PACF Model Identification

The autocorrelation function (ACF) at lag k is the correlation between y_t and y_(t-k). The partial autocorrelation (PACF) at lag k is their correlation after linear effects of lags 1 through k-1 are removed. They are descriptive identification aids; they do not prove a specific process, seasonality, or model adequacy. For a stationary, correctly specified pure process, the textbook patterns are: | Candidate process | ACF | PACF |…

Runnable guidance: pilot: Pilot profile: candidate orders need visual review; bands are approximate.

Time-Series Forecasting and Evaluation

A point forecast is the model's conditional expectation at a future horizon. A prediction interval represents uncertainty for future outcomes under the fitted model; a confidence interval for the conditional mean is narrower and answers a different question. Forecast intervals usually widen with horizon as uncertainty compounds; inspect the actual bounds and never draw constant- width bands by assumption. A fan chart displays this widening…

Runnable guidance: pilot: Pilot profile: rolling-origin accuracy against a naive benchmark.

Time-Series Inspection

Inspection describes temporal structure; it does not test a formal null or prove stationarity, randomness, a seasonal period, or a forecasting model's adequacy. The plot should preserve the actual time order and, when known, use the time variable on the horizontal axis. Look for sustained level/trend changes, recurring cycles, isolated shocks, abrupt breaks, changing spread, and stretches of unusually high or low variability. A trend or level…

Runnable guidance: pilot: Pilot profile: inspection only; it fits no model.

Stationarity and Integration Order

This entry uses Augmented Dickey–Fuller (ADF), KPSS, and DFGLS tests as complementary evidence about a series' stochastic trend under explicitly chosen deterministic terms. None proves stationarity or a unit root, detects every structural break, or establishes seasonal stationarity or cointegration. - ADF null: the series has a unit root, conditional on the included deterministic terms and augmenting lags. Rejection is evidence against a unit…

Runnable guidance: pilot: Pilot profile: choose the difference order from the level analysis, not by searching p-values.

Univariate AR, MA, ARMA, ARIMA, and SARIMA Selection

An AR(p) model regresses the current series value on its own previous values and deterministic terms. An MA(q) model expresses the current value as a function of current and previous innovations (errors), not a regression on lagged observed outcomes. ARMA combines both. ARIMA(p,d,q) applies d ordinary differences before the ARMA dynamics. SARIMA adds seasonal AR/difference/MA orders (P,D,Q) at period s: (p,d,q)(P,D,Q)s. It is a model of…

Runnable guidance: pilot: Pilot profile: information criteria rank candidates; they do not validate the model.

ARCH Screening and GARCH Volatility Models

An ARCH effect means conditional variance depends on past shocks. Engle's canonical ARCH-LM test regresses squared residuals on their lags; its null is no ARCH dependence through the selected lag order. Rejection is evidence of conditional variance dynamics, not their order or distribution. Engle’s ARCH-LM test is based on a regression of squared residuals on their lags. Ljung–Box on squared residuals is a related portmanteau screen but has a…

Runnable guidance: pilot: Pilot profile: stops when there is no ARCH evidence.

visualizations (9 cards)

Bivariate Scatter Plot

A bivariate scatter plot places a continuous predictor on X and a continuous outcome on Y. Partially transparent points show individual observations; a LOWESS smoother reveals local departures from linearity and a linear smoother provides a straight-line reference. Pearson's r and Spearman's ρ summarize linear and rank association, respectively, but neither replaces inspection of the point cloud.

Runnable guidance: pilot: Pilot profile: the smoother is descriptive; it is not a model.

Coefficient Plot

A coefficient plot places predictor names on the Y axis and estimates with confidence intervals on the X axis. The zero-reference line marks no additive effect on the coefficient scale. It summarizes association magnitude and uncertainty across terms and is preferred to a coefficient table when a model has more than four predictors. Keep a theoretically meaningful order when one exists; otherwise sort by absolute effect size so the largest…

Runnable guidance: pilot: Pilot profile: the template fits OLS; plot a GLM's own estimates when the model is not linear.

Cook's Distance Plot

This plot displays each observation's Cook's distance against its analysis-row index. Cook's distance combines residual size and leverage to estimate how much the fitted coefficient vector would change if a case were omitted. A horizontal reference marks a screening threshold. Use a stem plot for modest sample sizes where individual observations can be inspected; use a bar chart for larger samples where a stem display becomes dense.

Runnable guidance: pilot: Pilot profile: 4/n is a screen, not a deletion rule.

Single-Variable Distribution Plot

This plot summarizes the marginal distribution of one analysis variable with a histogram, a density overlay and (for small samples) a rug showing observed values. It is an exploratory view of location, spread, skew, tails, gaps and possible modes before modeling. The caption records sample size, mean, median, skewness and excess kurtosis so the visual can be read with basic summaries.

Runnable guidance: pilot: Pilot profile: bin choice changes the picture; check against the rug and density.

Predicted vs Actual Plot

This plot places predicted outcomes on the X axis and observed outcomes on the Y axis, with a 45-degree equality reference and a LOWESS smoother. It screens overall in-sample calibration and reveals regions where predictions systematically differ from observed outcomes. For GLMs, calculate predictions on the response scale by applying the inverse link; a linear predictor on the link scale cannot be compared directly with observed response values.

Runnable guidance: pilot: Pilot profile: in-sample agreement says nothing about out-of-sample accuracy.

Residual Normal Q–Q Plot

A normal Q–Q plot compares theoretical standard-normal quantiles with ordered standardized residuals. The 45-degree line is the reference when residuals are centered and scaled to unit spread. Pointwise confidence bands show the expected sampling variation of normal order statistics; they are a visual reference, not a simultaneous hypothesis test. This diagnostic is appropriate for OLS when assessing the normal-error assumption used for exact…

Runnable guidance: pilot: Pilot profile: normality of residuals matters for small-sample inference only.

Residuals vs Fitted Plot

This diagnostic plots response residuals against fitted values, with a zero-reference line and a locally weighted smoother. It screens the fitted conditional mean for systematic lack of fit and shows whether residual spread changes over the range of fitted outcomes. Curvature and a fan-shaped spread can occur together, so assess the center and the width of the point cloud separately.

Runnable guidance: pilot: Pilot profile: a flat smoother does not rule out misspecification.

Scale–Location Plot

The scale–location plot places fitted values on the X axis and the square root of the absolute standardized residual on the Y axis. A LOWESS curve summarizes how residual magnitude changes across the fitted range. A roughly flat curve is consistent with a stable residual spread; a slope or curve indicates that spread changes with fitted values. For GLMs, the conditional variance is determined in part by the family and mean. This plot is a…

Runnable guidance: pilot: Pilot profile: a trend suggests heteroskedasticity; test it before correcting.

Time-Series Analysis Visualizations

This entry defines time-series plot construction and interpretation for univariate residual checks, information-criterion comparisons, multivariate responses/decompositions, and conditional volatility. It visualizes supplied series or model results; it does not fit or validate those models by itself.

Not runnable: reference: Reference card: plot helpers only; run the matching time_series card for the analysis.

How the agent uses a card

  1. Search. The agent searches the library for cards matching your question. The library is written in English. Ask in Arabic and the agent works from the meaning of your question, then searches in English.
  2. Read. The agent reads the full card, including its assumptions, decision criteria, required outputs, and implementations where present. A search summary is not a full read; declared prerequisite cards can be read as well.
  3. Follow. The agent adapts the template to your data and may run the implementation when inputs and runtime support it. Run provenance records the card entries associated with that run; a card profile does not guarantee successful execution or validation.

No card fits? Mizura proceeds without one, and the record says so. Want a particular method followed? Name it in your question, or ask for a plan that states it.

What a card does not guarantee

A card constrains how an analysis is done. It does not make the study design valid. It does not make the interpretation correct. And it cannot put a diagnostic into the output if the run did not produce one.

So read the diagnostics in the run itself. The headline number in the answer is not enough.

Warning. The wrong method, done with great discipline, is still the wrong method. Most statistical failures are not computational. They are p-hacking, selective reporting, and presentation that misleads. That is why the research-integrity family exists.

A method missing from the library? Just ask. Mizura can attempt work without a card, and the record shows when no card was followed. That does not make an unlisted method available or validated.