Skip to contents

Execute a prespecified procedure through method_spec() and run_inference(). Each procedure retains its existing finite-sample, numerical, missingness and backend policies.

Details

Wilcoxon intervals retain the native-reported confidence level. Older R versions can record a nominal or rounded level whose exact attainment differs; newer versions can return a fully unbounded conservative interval. The common interval-method label and metadata identify this convention. No level, endpoint, or captured native diagnostic is replaced.

Arguments listed below are supplied by name to run_inference(); method controls may instead be declared in the named options list in method_spec(). Alternative and confidence level belong in the specification. An optional result_id argument to run_inference() supplies an explicit external result key for joins. Default IDs are stable only within one object, so supply distinct IDs when joining separate results. For classifier-template views, native payloads omit the original specification and attached source result; finalized aggregate fields remain, with the raw-data-free classifier conversion payload stored separately. The legacy teaching wrappers continue to use public classifier APIs for their original specification shape. The method never selects an alternative or a test from observed diagnostic p-values. result_data() returns explicit effect, coefficient, omnibus or descriptive rows. result_metadata() records method identity, settings, population and source status. result$payload$native retains the complete finalized native output, including quantities that do not fit a scalar row. Numeric p-value bounds and Monte Carlo intervals are separate from sampling intervals.

For paired and repeated inputs, use the documented wide data with a confirmed unique subject identifier. Missing values are rejected unless that procedure's explicit complete-case, MAR, MCAR or pairwise policy is selected. Setting missing = "omit" alone never selects a missingness assumption. Unknown sample sizes remain unknown. Group, event, contrast and sign conventions follow the named procedure and its explicit inputs.

The base/standard-R procedures require no contributed calculation package. Gower/PAM uses cluster; Gaussian mixed models use nlme; NB2 and ordinal models use MASS; multinomial models use nnet; logistic random-intercept models use lme4; exchangeable GEE uses geepack. Missing backends produce an explicit error and never a statistical substitute. Legacy classifier objects may use the separately documented canonical JSON/fingerprint dependencies.

The binary logistic procedure retains profile-likelihood slope intervals and separate Wald columns. Generic fitted-glm conversion instead explicitly offers Wald intervals. Factorial ANOVA retains raw and Holm-adjusted term p-values for the declared whole family. ANCOVA intervals and contrasts are marginal and unadjusted. Rank location intervals are not general median-difference intervals. Prediction-development bootstraps refit preprocessing and preserve failed replicates; no external-validation claim follows. Structure/clustering outputs are exploratory and carry no fabricated hypothesis test.

variance_chisq_one_sample is an advisor-only identity and gives an unsupported condition. The following 68 implemented identities retain these native input signatures (alternative and conf.level, when shown, are supplied through the specification):

  • ancova_baseline_adjusted: data, covariates, group_levels, common_slopes, conf.level, missing, alternative.

  • anova_factorial: data, factor_columns, independent_units, equal_variance_justified, alternative, conf.level, complete_cases.

  • anova_one_way_welch: x, group, alternative, conf.level.

  • anova_one_way: x, group, alternative, conf.level.

  • anova_repeated_one_way_gg: data, occasion_columns, independent_subjects, alternative, conf.level, complete_cases.

  • binomial_exact_one_sample: events, n, p0, alternative, conf.level.

  • boschloo_one_sided: table, alternative, conf.level.

  • boschloo_two_sided_central: table, alternative, conf.level.

  • boschloo_two_sided_minlike: table, alternative, conf.level.

  • bowker_symmetry: counts, alternative, conf.level, n_excluded.

  • brunner_munzel: x, y, alternative, conf.level.

  • chisq_goodness_of_fit_mc: observed, probabilities, seed, B, conf.level, mc.level.

  • chisq_goodness_of_fit: counts, p, alternative, conf.level.

  • chisq_independence_rxc: counts, alternative, conf.level.

  • classifier_binormal_theory: auc, sigma, cutoff, prevalence, n_total.

  • classifier_cutoff_exploration: data, direction, comparator.

  • classifier_heldout_validation: tuning, evaluation, direction, comparator, independent_splits, conf.level.

  • classifier_predeclared_rule: data, cutoff, direction, comparator, predeclared, conf.level.

  • cluster_gower_pam: data, variables, types, weights, k, independent_units, alternative, conf.level, missing, B, seed.

  • cluster_hierarchical_ward: data, variables, k, standardize, independent_units, alternative, conf.level, complete_cases, B, seed.

  • cluster_kmeans: data, variables, k, standardize, independent_units, alternative, conf.level, complete_cases, B, seed.

  • cochran_armitage_trend: events, totals, scores, scores_prespecified, alternative, conf.level.

  • cochran_q: data, alternative, conf.level, missing.

  • correlation_kendall: data, alternative, conf.level.

  • correlation_pearson: data, alternative, conf.level.

  • correlation_spearman: data, alternative, conf.level.

  • descriptive_summary: x, measurement, conf.level, event.

  • diagnostic_2x2_fixed_cutoff: tp, fn, fp, tn, sampling, cutoff_origin, evaluation_split, conf.level, prevalence, prevalence_source.

  • efa_common_factor_ml: data, variables, factors, independent_units, continuous_measurements, alternative, conf.level, complete_cases.

  • fisher_exact_2x2: table, alternative, conf.level.

  • fisher_exact_rxc: counts, alternative, conf.level.

  • friedman: data, alternative, conf.level, missing.

  • gee_logistic_exchangeable: data, independent_clusters, model_assumptions_justified, alternative, conf.level, missing_outcomes.

  • glmm_logistic_random_intercept: data, independent_clusters, model_assumptions_justified, alternative, conf.level, missing_outcomes.

  • jonckheere_terpstra: data, group_order, order_prespecified, independent_units, seed, alternative, B, conf.level, mc.level, complete_cases.

  • kruskal_wallis: x, group, alternative, conf.level.

  • lmm_cluster_random_intercept: data, independent_clusters, random_intercept_justified, alternative, conf.level, missing_outcomes.

  • lmm_repeated_measures: data, independent_clusters, random_intercept_justified, alternative, conf.level, missing_outcomes.

  • mcnemar_asymptotic_cc: counts, alternative, conf.level.

  • mcnemar_asymptotic_uncorrected: counts, alternative, conf.level.

  • mcnemar_exact_conditional: counts, alternative, conf.level.

  • mcnemar_midp: counts, alternative, conf.level.

  • pca_components: data, variables, components, standardise, missing.

  • prediction_model_linear: data, predictors, independent_units, alternative, conf.level, B, seed, complete_cases, resamples.

  • prediction_model_logistic: data, predictors, independent_units, alternative, conf.level, B, seed, complete_cases, resamples.

  • prop_one_sample_score: events, n, p0, alternative, conf.level.

  • prop_two_independent_pearson_chisq: counts, alternative, conf.level.

  • rank_sum_mann_whitney: x, y, alternative, conf.level, exact, location_shift.

  • regression_linear_multiple: data, predictors, tested_predictors, alternative, conf.level, missing.

  • regression_linear_simple: data, predictor, alternative, conf.level, missing.

  • regression_logistic_binary: data, predictors, independent_units, alternative, conf.level, complete_cases.

  • regression_multinomial: data, predictors, independent_units, reference_category, alternative, conf.level, complete_cases.

  • regression_negative_binomial: data, predictors, independent_units, alternative, conf.level, complete_cases.

  • regression_ordinal_proportional_odds: data, predictors, independent_units, proportional_odds_justified, alternative, conf.level, complete_cases.

  • regression_poisson: data, predictors, independent_units, alternative, conf.level, complete_cases.

  • sign_test_one_sample: x, mu0, alternative, conf.level.

  • sign_test_paired: data, alternative, conf.level.

  • signed_rank_wilcoxon_one_sample: x, mu, alternative, conf.level, exact.

  • signed_rank_wilcoxon: data, alternative, conf.level, exact.

  • stuart_maxwell_marginal_homogeneity: counts, alternative, conf.level, n_excluded.

  • t_mean_one_sample: x, mu0, alternative, conf.level.

  • t_means_paired: data, alternative, conf.level.

  • t_means_two_independent_student: x, y, alternative, conf.level.

  • t_means_two_independent_welch: x, y, alternative, conf.level.

  • unconditional_exact_z_pooled: table, alternative, conf.level, independent_binomial_groups, tolerance, max_subdivisions.

  • variance_brown_forsythe: x, group, alternative, conf.level.

  • variance_f_test_two: x, y, ratio0, alternative, conf.level.

  • variance_fligner_killeen: x, group, alternative, conf.level.

Exact native argument defaults and scope constraints are also recorded in methods/implemented.csv and the package source. Source templates are never evaluated at runtime.

Thirteen methods have two engines. engine = "base" (the default) uses infercalcR's own implementation, written from the method's publication; engine = "reference" calls the validated original: the function DescrTab2 uses for the test, Exact for Boschloo's test, or the established package for tests DescrTab2 does not offer. method_catalogue() lists each method's engines and original. The engines are benchmarked against each other on the originals' help-page examples (methods/engine-benchmarks.rds, approved exceptions in methods/engine-deviations.csv). methods/provenance.csv records for every method its validated source, its original, the publication its base implementation follows and the outcome of the check that no base implementation was adapted from the code of a GPL-licensed original.

Value

run_inference() returns a common inference_result, or a descriptive_result or classification_result where appropriate. No reporting package is required.

References

Armitage P (1955). Tests for linear trends in proportions and frequencies. Biometrics 11(3):375–386. doi:10.2307/3001775

Boschloo RD (1970). Raised conditional level of significance for the 2 x 2-table when testing the equality of two probabilities. Statistica Neerlandica 24(1):1–9. doi:10.1111/j.1467-9574.1970.tb00104.x

Box GEP (1954). Some theorems on quadratic forms applied in the study of analysis of variance problems, I. Annals of Mathematical Statistics 25(2):290–302. doi:10.1214/aoms/1177728786

Brown MB, Forsythe AB (1974). Robust tests for the equality of variances. Journal of the American Statistical Association 69(346):364–367. doi:10.1080/01621459.1974.10482955

Brunner E, Munzel U (2000). The nonparametric Behrens-Fisher problem: asymptotic theory and a small-sample approximation. Biometrical Journal 42(1):17–25. doi:10.1002/(SICI)1521-4036(200001)42:1<17::AID-BIMJ17>3.0.CO;2-U

Clopper CJ, Pearson ES (1934). The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika 26(4):404–413. doi:10.1093/biomet/26.4.404

Cochran WG (1950). The comparison of percentages in matched samples. Biometrika 37(3-4):256–266. doi:10.1093/biomet/37.3-4.256

Cochran WG (1954). Some methods for strengthening the common chi-squared tests. Biometrics 10(4):417–451. doi:10.2307/3001616

Fagerland MW, Lydersen S, Laake P (2013). The McNemar test for binary matched-pairs data: mid-p and asymptotic are better than exact conditional. BMC Medical Research Methodology 13:91. doi:10.1186/1471-2288-13-91

Greenhouse SW, Geisser S (1959). On methods in the analysis of profile data. Psychometrika 24(2):95–112. doi:10.1007/BF02289823

Jonckheere AR (1954). A distribution-free k-sample test against ordered alternatives. Biometrika 41(1-2):133–145. doi:10.1093/biomet/41.1-2.133

Lancaster HO (1961). Significance tests in discrete distributions. Journal of the American Statistical Association 56(294):223–234. doi:10.1080/01621459.1961.10482105

Maxwell AE (1970). Comparing the classification of subjects by two independent judges. British Journal of Psychiatry 116(535):651–655. doi:10.1192/bjp.116.535.651

McNemar Q (1947). Note on the sampling error of the difference between correlated proportions or percentages. Psychometrika 12(2):153–157. doi:10.1007/BF02295996

Phipson B, Smyth GK (2010). Permutation p-values should never be zero: calculating exact p-values when permutations are randomly drawn. Statistical Applications in Genetics and Molecular Biology 9(1):39. doi:10.2202/1544-6115.1585

Stuart A (1955). A test for homogeneity of the marginal distributions in a two-way classification. Biometrika 42(3-4):412–416. doi:10.1093/biomet/42.3-4.412

Suissa S, Shuster JJ (1985). Exact unconditional sample sizes for the 2 x 2 binomial trial. Journal of the Royal Statistical Society, Series A 148(4):317–327. doi:10.2307/2981892

Terpstra TJ (1952). The asymptotic normality and consistency of Kendall's test against trend, when ties are present in one ranking. Indagationes Mathematicae (Proceedings) 55:327–333. doi:10.1016/S1385-7258(52)50043-X

Examples

x <- c(2, 4, 5, 7, 9)
y <- c(1, 3, 4, 6, 8, 10)
spec <- method_spec("t_means_two_independent_welch")
result_data(run_inference(spec, x = x, y = y))
#>                            row_id component
#> 1 t_means_two_independent_welch:1  contrast
#>                                   estimand contrast   estimate statistic
#> 1 mean difference (x minus reference or y)     <NA> 0.06666667 0.0366741
#>         df conf.low conf.high conf.level interval.method interval.scale
#> 1 8.999751 -4.04553  4.178863       0.95         Welch t       identity
#>   interval.scope   p.value null.value alternative  n n.excluded status reason
#> 1      pointwise 0.9715454          0   two.sided 11          0     ok   <NA>
#>   df.denominator variable_id p.adjusted p.reported p.method family_id
#> 1             NA        <NA>         NA  0.9715454     <NA>      <NA>
#>   family_size
#> 1          NA