Package {effectcheck}


Type: Package
Title: Statistical Consistency Checker for Published Research Results
Version: 0.7.17
Description: A conservative, assumption-aware statistical consistency checker for already-extracted research-results text. Parses test statistics, effect sizes, and confidence intervals across multiple citation styles including American Psychological Association (APA), Harvard, Frontiers, PLOS ONE, Scientific Reports, Nature Human Behaviour, PeerJ, eLife, PNAS, and others. Recomputes effect sizes using all plausible variants when design is ambiguous, and validates internal consistency. Supports t-tests, F-tests/ANOVA, correlations, chi-square, z-tests, regression, and nonparametric tests. Explicitly tracks all assumptions and uncertainty in output. Detects decision errors (significance reversals) similar to 'statcheck'. From v0.4.0 file extraction is no longer part of the package — pair with an external extractor (e.g., 'docpluck' at https://docpluck.app) and pass the resulting text to check_text(). Note: this package is under active development and results should be independently verified. Use is at the sole responsibility of the user. Contributions and verification reports are welcome.
License: MIT + file LICENSE
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.3.3
URL: https://github.com/giladfeldman/escicheck
BugReports: https://github.com/giladfeldman/escicheck/issues
Imports: stringr, stringi, dplyr, purrr, tibble, glue, logger, graphics, stats, utils
Suggests: shiny, shinythemes, DT, knitr, rmarkdown, testthat (≥ 3.0.0), MBESS, effectsize, jsonlite, statcheck, xml2, rvest
Depends: R (≥ 4.1.0)
Config/testthat/edition: 3
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2026-10-08 12:38:51 UTC; filin
Author: Gilad Feldman ORCID iD [aut, cre]
Maintainer: Gilad Feldman <giladfel@gmail.com>
Repository: CRAN
Date/Publication: 2026-10-08 14:40:02 UTC

effectcheck: Statistical Consistency Checker for Published Research Results

Description

A conservative, assumption-aware statistical consistency checker for already-extracted research-results text. Parses test statistics, effect sizes, and confidence intervals across multiple citation styles including American Psychological Association (APA), Harvard, Frontiers, PLOS ONE, Scientific Reports, Nature Human Behaviour, PeerJ, eLife, PNAS, and others. Recomputes effect sizes using all plausible variants when design is ambiguous, and validates internal consistency. Supports t-tests, F-tests/ANOVA, correlations, chi-square, z-tests, regression, and nonparametric tests. Explicitly tracks all assumptions and uncertainty in output. Detects decision errors (significance reversals) similar to 'statcheck'. From v0.4.0 file extraction is no longer part of the package — pair with an external extractor (e.g., docpluck at https://docpluck.app) and pass the resulting text to check_text(). Note: this package is under active development and results should be independently verified. Use is at the sole responsibility of the user. Contributions and verification reports are welcome.

Author(s)

Maintainer: Gilad Feldman giladfel@gmail.com (ORCID)

See Also

Useful links:


Drop docpluck table rows that duplicate a text-parsed (prose) row

Description

v0.6.4: a table cell often restates a result already reported inline in the body (e.g. a 90203 Table 9 F that also appears in the H5 paragraph, or a PROSECCO Table 2 risk difference also stated in the abstract). Keeping both double-counts and lets the table-derived NOTE drag the summary. This collapses a from_table row when a prose row shares the same reported numeric signature.

Usage

.dedup_table_vs_prose(parsed)

Arguments

parsed

A parsed-row tibble after table rows have been bound in.

Details

The signature is the sorted, rounded set of the row's reported numbers (stat_value, effect_reported, ciL_reported, ciU_reported) – robust to the same value landing in different columns across representations (a prose rdpct puts the estimate in stat_value; a table estimate puts it in effect_reported). A CI bound must be present for a row to participate, so a bare statistic never collapses on a coincidental value match.

Value

parsed with duplicate table rows removed (prose row kept).


EffectCheck S3 Class Definition and Methods

Description

This file defines the effectcheck S3 class and its associated methods for printing, summarizing, and plotting results.

Usage

.effectcheck_version()

Build an extraction-only NOTE output row (no recomputation)

Description

v0.6.4: used for docpluck table rows that carry only a point estimate plus a CI (and maybe p) with no test statistic (test_type = "table_estimate"). Such a row cannot be independently recomputed, so it is surfaced as an honest NOTE that reports the estimate / CI / p exactly as extracted. Column set mirrors the df_arity_mismatch short-circuit row so it binds uniformly with the main compute_and_compare_one() output.

Usage

.note_only_row(row, message)

Arguments

row

A single parsed row (from flattened_rows_to_parsed()).

message

Uncertainty message explaining why the row is not verified.

Value

A one-row tibble with status "NOTE", check_scope "extraction_only".


Constants for EffectCheck

Description

Default values and tolerances used across the package.

Usage

DEFAULT_TOL_EFFECT

Format

An object of class list of length 28.


Effect Size Type Definitions

Description

Maps reported effect size names to their family and variants. Based on Guide to Effect Sizes and Confidence Intervals (Jane et al., 2024) https://matthewbjane.quarto.pub/

Usage

EFFECT_SIZE_FAMILIES

Format

An object of class list of length 27.


Variant Metadata

Description

Provides assumptions and usage information for each effect size variant.

Usage

VARIANT_METADATA

Format

An object of class list of length 26.


Calculate Cramer's V from Chi-square

Description

Calculate Cramer's V from Chi-square

Usage

V_from_chisq(chisq, N, m)

Arguments

chisq

Chi-square statistic

N

Total sample size

m

Smaller dimension - 1 (min(r-1, c-1))

Value

Cramer's V


Subset method for effectcheck objects

Description

Preserves effectcheck class when subsetting.

Usage

## S3 method for class 'effectcheck'
x[...]

Arguments

x

An effectcheck object

...

Subsetting arguments

Value

An effectcheck object

Examples

res <- check_text("t(28) = 2.21, p = .035. F(1, 50) = 4.03, p = .049")
res[1, ]

Compute adjusted R-squared

Description

Compute adjusted R-squared

Usage

adjusted_R2(R2, n, p)

Arguments

R2

R-squared value

n

Sample size

p

Number of predictors

Value

Adjusted R-squared


Check Word documents in a directory (DEFUNCT)

Description

Removed in effectcheck 0.4.0.

Usage

checkDOCXdir(dir, subdir = TRUE, messages = TRUE, ...)

Arguments

dir

Defunct argument.

subdir

Defunct argument.

messages

Defunct argument.

...

Defunct argument.

Value

Errors with a migration message.


Check HTML files for statistical consistency (DEFUNCT)

Description

Removed in effectcheck 0.4.0. HTML can be passed directly to check_text() via check_text(rvest::html_text2(xml2::read_html(path))).

Usage

checkHTML(files, messages = TRUE, ...)

Arguments

files

Defunct argument.

messages

Defunct argument.

...

Defunct argument.

Value

Errors with a migration message.


Check a directory of HTML files (DEFUNCT)

Description

Removed in effectcheck 0.4.0.

Usage

checkHTMLdir(dir, subdir = TRUE, messages = TRUE, ...)

Arguments

dir

Defunct argument.

subdir

Defunct argument.

messages

Defunct argument.

...

Defunct argument.

Value

Errors with a migration message.


Check PDF files for statistical consistency (DEFUNCT)

Description

Removed in effectcheck 0.4.0. Extract PDFs via docpluck.

Usage

checkPDF(files, try_tables = TRUE, try_ocr = FALSE, messages = TRUE, ...)

Arguments

files

Defunct argument.

try_tables

Defunct argument.

try_ocr

Defunct argument.

messages

Defunct argument.

...

Defunct argument.

Value

Errors with a migration message.


Check a directory of PDF files (DEFUNCT)

Description

Removed in effectcheck 0.4.0.

Usage

checkPDFdir(
  dir,
  subdir = TRUE,
  try_tables = TRUE,
  try_ocr = FALSE,
  messages = TRUE,
  ...
)

Arguments

dir

Defunct argument.

subdir

Defunct argument.

try_tables

Defunct argument.

try_ocr

Defunct argument.

messages

Defunct argument.

...

Defunct argument.

Value

Errors with a migration message.


Check a directory for statistical consistency (DEFUNCT)

Description

Removed in effectcheck 0.4.0. Extract via docpluck and call check_text() per file.

Usage

check_dir(
  dir,
  subdir = TRUE,
  pattern = "\\.(pdf|html?|docx|txt)$",
  try_tables = TRUE,
  try_ocr = FALSE,
  messages = TRUE,
  allowed_base_dirs = NULL,
  ...
)

Arguments

dir

Defunct argument.

subdir

Defunct argument.

pattern

Defunct argument.

try_tables

Defunct argument.

try_ocr

Defunct argument.

messages

Defunct argument.

allowed_base_dirs

Defunct argument.

...

Defunct argument.

Value

Errors with a migration message.


Check a single file for statistical consistency (DEFUNCT)

Description

Removed in effectcheck 0.4.0. Use check_text() on docpluck-extracted text.

Usage

check_file(path, try_tables = TRUE, try_ocr = FALSE, ...)

Arguments

path

Defunct argument.

try_tables

Defunct argument.

try_ocr

Defunct argument.

...

Defunct argument.

Value

Errors with a migration message.


Check files for statistical consistency (DEFUNCT in v0.4.0)

Description

Removed in effectcheck 0.4.0. ESCImate delegates extraction to docpluck; pass already-extracted text to check_text().

Usage

check_files(paths, try_tables = TRUE, try_ocr = FALSE, messages = TRUE, ...)

Arguments

paths

Defunct argument.

try_tables

Defunct argument.

try_ocr

Defunct argument.

messages

Defunct argument.

...

Defunct argument.

Value

Errors with a migration message.


Check raw text for statistical consistency

Description

Parses APA-style statistical results from text and checks for consistency between reported and computed values. Uses type-matched comparison to ensure reported effect sizes are compared against the same type of computed values.

Usage

check_text(
  text,
  stats = c("t", "F", "r", "chisq", "z", "U", "W", "H", "regression", "spearman",
    "kendall", "kendall_w", "dscf", "cochran_q", "RR", "rdpct", "md_hl", "binomial",
    "interaction_p", "mediation_indirect", "mcnemar_or", "bayes_factor", "hazard_ratio",
    "d_reported_only", "wts", "ats", "brunner_munzel", "yuen", "mean_diff_ci"),
  ci_level = 0.95,
  alpha = 0.05,
  one_tailed = FALSE,
  paired_r_grid = c(seq(0.1, 0.9, by = 0.1), 0.95),
  assume_equal_ns_when_missing = TRUE,
  ci_method_phi = "bonett_price",
  ci_method_V = "bonett_price",
  tol_effect = list(d = 0.02, r = 0.005, phi = 0.02, V = 0.02),
  tol_ci = 0.02,
  tol_p = 0.001,
  messages = FALSE,
  max_text_length = 10^7,
  max_stats_per_text = 10000,
  cross_type_action = "NOTE",
  ci_affects_status = TRUE,
  plausibility_filter = TRUE,
  sign_sensitive = FALSE,
  method_context_action = "NOTE",
  design_ambiguous_action = "WARN",
  unknown_groups_action = "WARN",
  min_confidence = 0L,
  table_rows = NULL,
  extraction_provenance = NULL
)

Arguments

text

Character vector of text to check

stats

Character vector of test types to check (default: all supported types)

ci_level

Default confidence interval level (default 0.95)

alpha

Significance threshold for decision error detection (default 0.05)

one_tailed

Logical, assume one-tailed tests (default FALSE)

paired_r_grid

Numeric vector of correlation values for paired t-test grid search

assume_equal_ns_when_missing

Logical, assume equal group sizes when missing (default TRUE)

ci_method_phi

CI method for phi coefficient (default "bonett_price") – accepted and recorded in the result's settings, but currently has NO effect on any computed value or status

ci_method_V

CI method for Cramer's V (default "bonett_price") – accepted and recorded in the result's settings, but currently has NO effect on any computed value or status

tol_effect

List of tolerances for effect sizes by type

tol_ci

Tolerance for CI bounds (default 0.02)

tol_p

Tolerance for p-values (default 0.001) – accepted and recorded in the result's settings, but currently has NO effect on any computed value or status

messages

Logical, show progress messages (default FALSE)

max_text_length

Maximum total text length in characters (default 10^7)

max_stats_per_text

Maximum number of stats to process per text (default 10000)

cross_type_action

Action when cross-type match found ("NOTE", "WARN", or "ERROR"; default "NOTE")

ci_affects_status

Whether CI mismatches affect status (default TRUE)

plausibility_filter

Whether to apply plausibility bounds filter (default TRUE)

sign_sensitive

Intended to make sign differences affect status (default FALSE) – accepted and recorded in the result's settings, but currently has NO effect on any computed value or status

method_context_action

Action when method context detected in chunk ("NOTE", "WARN", or "SKIP"; default "NOTE")

design_ambiguous_action

Action when a design-ambiguous t-test (or F(1,df), or z with d/g) effect-size ERROR occurs ("WARN", "NOTE", or "ERROR"; default "WARN").

It has one exception, and it is deliberate. The downgrade is applied only where design ambiguity is a candidate EXPLANATION for the discrepancy – that is, where the reported effect lies within the range of the computed independent and paired variants plus a 50\ reported effect matching NEITHER design is not explained by not knowing which design was used, so it keeps its ERROR and this parameter is inert on that row. Same principle as the v0.6.18 omnibus-df rule: an effect matching neither candidate keeps its flag. The row states the reason ("Extreme discrepancy ... likely reflects data extraction error").

Documented in v0.7.9 after a downstream consumer probed the parameter and found 2 rows in 148,984 where a caller asking for "WARN" got "ERROR". The behaviour was correct and the SILENCE was the defect: a policy knob whose exception is not documented reads, from outside, exactly like a policy knob that does not work. Pinned by test-v079-design-ambiguous-action-scope.R, both directions.

unknown_groups_action

Action when d/g ERROR occurs with unknown group sizes n1/n2 ("WARN", "NOTE", or "ERROR"; default "WARN")

min_confidence

Minimum confidence score (0-10) for results to be included in output (default 0)

table_rows

Optional list of docpluck structured table rows (?structured=true flattened_rows[], docpluck v2.4.95+). Each element is a list with label, row_label, row_idx, and a fields list of typed statistics. Rows whose fields carry a recognised statistic are mapped via flattened_rows_to_parsed() and run through the same verification pipeline as text-parsed rows, tagged result_context = "table" and deduplicated against any identical prose row. Default NULL (text-only; output is byte-identical to prior versions).

extraction_provenance

Optional list: the extractor's own normalization report, passed through verbatim (docpluck's normalization block). Read, never reinterpreted. It records whether the extractor REWROTE VALUES in this document rather than merely canonicalising notation – docpluck's sign-recovery rules can turn a printed SE = 0.199 into -0.199, and before v0.7.6 that rewrite was invisible downstream. Surfaced as the document-level columns upstream_sign_rewrites (integer; NA when no report was supplied, 0 when one was supplied and reported none) and upstream_normalization_version. A zero does not mean no rewrite happened – corrected 2026-08-22, and stronger than the "lower bound" this said before. The earlier stated reason (docpluck assigned rather than accumulated the metric, so only the last of three rules survived) was fixed upstream in normalization 1.9.59. The remaining cause is different and worse: docpluck derives the metric from a character-length delta and skips it entirely when that delta is zero, so a length-neutral rewrite – a 2-for-minus or U+2212 glyph substitution, which is precisely the sign-corruption class this column exists to expose – increments nothing and the key can be absent. An absent key is read here as 0 (docpluck omits NA fields rather than sending them), so such a document publishes upstream_sign_rewrites = 0 while values were in fact rewritten. Non-zero still reliably means values were rewritten, and the magnitude is not an occurrence count in any case. Deliberately does NOT set extraction_suspect: the report is document-level, that flag is per-row and gates effect-size rewriting and two ERROR-path downgrades. Default NULL.

Value

An effectcheck S3 object whose results tibble carries the parsed and recomputed statistics. Notable output columns:

design_ambiguous

Logical. TRUE when the row's matching is design-uncertain. INTENTIONALLY BROAD – see ambiguity_reason for the specific category (one of two: structural-design for a t / F(1,df) / z that reports d or g and produced BOTH paired and independent variant families; cross-family for a reported ES type that has no same-type variants in the computed-variants set, e.g. a Cohen's d reported on an F(2,df) omnibus). Equal to ambiguity_level != "clear"; the flag never under-reports the row's uncertainty.

ambiguity_level

Character. "clear", "ambiguous", or "highly_ambiguous". The category-A cases tend to land on "ambiguous"; the category-B cases land on "highly_ambiguous".

ambiguity_reason

Character. Human-readable explanation of the ambiguity. Since v0.5.11, a stable bracket-tagged category suffix is appended when applicable: "[category: structural-design]" or "[category: cross-family]"; since v0.7.11 also "[category: not-computed]" when an effect size was reported but no variant could be computed at all (e.g. an F without df), so nothing was matched. Consumers can grep for the tag to programmatically split the semantics without parsing English.

matched_variant

The computed variant matched against the reported ES. A cross-family fallback row will name a variant from a different family than the reported ES type (e.g. matched_variant="eta" when effect_reported_name="d").

sign_ci_violation

Logical (since v0.6.3, R-0007). TRUE when a sign-bearing reported estimate (d, g, dz, dav, drm, r, beta, partial_r) lies OUTSIDE its reported CI but its sign-flip lies inside – the signature of a dropped-minus extraction error (e.g. r = .74 reported with 95% CI [-0.92, -0.30]). FLAG ONLY: the parsed value is never mutated; the violation is also surfaced in uncertainty_reasons. NA on error/short-circuit rows, FALSE otherwise.

estimate_outside_ci

Logical (since v0.7.9). TRUE when the same estimate-in-CI invariant is violated with NO sign explanation: the reported estimate lies outside its reported CI and so does its sign-flip, so a dropped minus cannot account for it and at least one of the three published numbers is wrong. Mutually exclusive with sign_ci_violation, which keeps its own, more specific diagnosis. Added because the invariant was evaluated but only ever REPORTED the dropped-minus shape, so a row whose estimate lay outside its own interval was indistinguishable from one where it lay inside – while the row's message said the invariant had been checked. Real instance: Chan & Feldman (2025), Cognition and Emotion 39(6), p. 1238, Table 9 row 2a prints r = .70, 95% CI [0.73, 0.76]. FLAG ONLY: the parsed value is never mutated. NA on error/short-circuit rows, FALSE otherwise.

Plus all other columns: location, raw_text, test identification (test_type, chisq_subtype, df1, df2, stat_value, N), p-values (p_reported, p_computed, decision_error), effect-size family columns (d_ind, dz, g_ind, eta2, partial_eta2, omega2, ...), CI metadata (ci_reported, ci_expected, ci_width_ratio, ci_level_source, ...), and status (status, check_type, check_scope, extraction_suspect, design_inferred, uncertainty_level, uncertainty_reasons, ...).

Examples

result <- check_text("t(28) = 2.21, p = .035, d = 0.80")
print(result)
summary(result)

Compute CIs for odds ratio via all available methods (v0.3.5)

Description

Implements Wald CI on log(OR) (the standard psychology-paper method) and optionally an exact Fisher CI when 2x2 cell counts are supplied.

Usage

ci_OR_all(OR, SE_logOR = NULL, level = 0.95, cells = NULL, p_value = NULL)

Arguments

OR

Odds ratio (point estimate)

SE_logOR

Standard error of log(OR), if known

level

Confidence level (default 0.95)

cells

Numeric length-4 vector c(a, b, c, d) for 2x2 table (optional)

p_value

Reported p-value (optional, used to back-derive SE)

Details

Wald-on-log uses SE_logOR if supplied, otherwise back-derives it from the reported CI bounds when both are available, otherwise estimates it from the reported p-value (when p > 0). If none of those are available it returns an empty list — there is no information to construct a CI from the point estimate alone.

Value

Named list of ci_result objects


Compute CIs for R-squared via partial-eta-squared NCP F-inversion (v0.3.5)

Description

R^2 in a single-omnibus regression (or a one-predictor model) is mathematically identical to partial eta-squared. We route through ci_etap2_all() and tag the method names so the matcher distinguishes R^2-routed CIs from native eta_p^2 CIs. Caller supplies the F statistic (when available) or back-computes from R^2 + df1 + df2.

Usage

ci_R2_all(R2, df1, df2, F_val = NA_real_, level = 0.95)

Arguments

R2

R-squared (point estimate, in [0, 1))

df1

Numerator df (number of predictors)

df2

Denominator df (residual df, N - df1 - 1)

F_val

Optional F statistic; computed from R2/df1/df2 if NA

level

Confidence level

Value

Named list of ci_result objects with R2-tagged methods


CI for adjusted R-squared (monotone transform of the R^2 CI)

Description

CI for adjusted R-squared (monotone transform of the R^2 CI)

Usage

ci_adjusted_R2(R2, N, k, df1, df2, level = 0.95)

Calculate CI for Cohen's f

Description

Derived from Partial Eta-Squared CI.

Usage

ci_cohens_f(F_val, df1, df2, level = 0.95)

Arguments

F_val

F statistic

df1

df1

df2

df2

level

CI level

Value

ci_result list


CI for Cohen's w (noncentral-chi-square inversion; lambda = N * w^2)

Description

CI for Cohen's w (noncentral-chi-square inversion; lambda = N * w^2)

Usage

ci_cohens_w(chisq, df, N, level = 0.95)

Comprehensive CI computation for independent d

Description

Tries multiple methods in order of priority: effectsize -> noncentral t -> approximation.

Usage

ci_d_ind(d, n1, n2, level = 0.95, prefer_noncentral = TRUE)

Arguments

d

Cohen's d

n1

Sample size 1

n2

Sample size 2

level

Confidence level (default 0.95)

prefer_noncentral

Logical, prefer noncentral t method

Value

ci_result list


Compute CIs for independent d via all available methods

Description

Compute CIs for independent d via all available methods

Usage

ci_d_ind_all(d, n1, n2, level = 0.95)

Arguments

d

Cohen's d

n1

Sample size 1

n2

Sample size 2

level

Confidence level

Value

Named list of ci_result objects (one per successful method)


Approximate CI for independent d

Description

Uses Hedges/CMC large-sample approximation.

Usage

ci_d_ind_approx(d, n1, n2, level = 0.95)

Arguments

d

Cohen's d

n1

Sample size 1

n2

Sample size 2

level

Confidence level (default 0.95)

Value

Vector of bounds (lower, upper)


Noncentral t CI for independent d

Description

Uses noncentral t-distribution (via MBESS if available).

Usage

ci_d_ind_noncentral_t(d, n1, n2, level = 0.95)

Arguments

d

Cohen's d

n1

Sample size 1

n2

Sample size 2

level

Confidence level (default 0.95)

Value

Vector of bounds (lower, upper)


Calculate CI for Cohen's dz (paired design)

Description

Uses the noncentral t approach or large-sample approximation. SE(dz) = sqrt(1/n + dz^2 / (2*n)) for the normal approximation.

Usage

ci_dz(dz, n, level = 0.95)

Arguments

dz

Cohen's dz

n

Sample size (number of pairs)

level

Confidence level (default 0.95)

Value

ci_result list


Compute CIs for paired dz via all available methods

Description

Compute CIs for paired dz via all available methods

Usage

ci_dz_all(dz, n, level = 0.95)

Arguments

dz

Cohen's dz

n

Sample size (number of pairs)

level

Confidence level

Value

Named list of ci_result objects


CI for epsilon-squared (ANOVA)

Description

CI for epsilon-squared (ANOVA)

Usage

ci_epsilon2(F_val, df1, df2, level = 0.95)

Alias for ci_etap2 (used for eta2 when design implies equivalence or as approximation)

Description

Alias for ci_etap2 (used for eta2 when design implies equivalence or as approximation)

Usage

ci_eta2(F_val, df1, df2, level = 0.95)

Arguments

F_val

F statistic

df1

df1

df2

df2

level

CI level


Calculate CI for Partial Eta-Squared

Description

Calculate CI for Partial Eta-Squared

Usage

ci_etap2(F_val, df1, df2, level = 0.95)

Arguments

F_val

F statistic

df1

df1

df2

df2

level

CI level

Value

ci_result list


Compute CIs for partial eta-squared at multiple confidence levels

Description

Compute CIs for partial eta-squared at multiple confidence levels

Usage

ci_etap2_all(F_val, df1, df2, level = 0.95)

Arguments

F_val

F statistic

df1

df1

df2

df2

level

Primary confidence level (default 0.95)

Value

Named list of ci_result objects (95% + 90% per Steiger 2004)


CI for Cohen's f-squared

Description

CI for Cohen's f-squared

Usage

ci_f2(F_val, df1, df2, level = 0.95)

Confidence interval for Cohen's h

Description

The arcsine transform phi = 2*asin(sqrt(p)) is variance-stabilising with variance 1/n, so the transformed difference has SE = sqrt(1/n1 + 1/n2).

Usage

ci_h(p1, p2, n1, n2, conf_level = 0.95)

Arguments

p1, p2

Proportions, each in the range 0 to 1.

n1, n2

Group sample sizes.

conf_level

Confidence level.

Value

list(ci_low, ci_high).


Confidence interval for Kendall's tau (Fisher z; Fieller et al., 1957)

Description

Fisher z-transform with SE = sqrt(0.437 / (n - 3)).

Usage

ci_kendall(tau, n, conf_level = 0.95)

Arguments

tau

Kendall correlation coefficient.

n

Sample size.

conf_level

Confidence level.

Value

list(ci_low, ci_high).


CI for omega-squared

Description

CI for omega-squared

Usage

ci_omega2(F_val, df1, df2, level = 0.95)

CI for partial omega-squared

Description

CI for partial omega-squared

Usage

ci_partial_omega2(F_val, df1, df2, level = 0.95)

Fisher-z CI for partial correlation (v0.3.5)

Description

Same Fisher-z transform used in ci_phi(); df gives N - k - 1. Treats the partial r as a correlation with effective N = df + 2 (i.e. as if there were no covariates), which is the standard simplification used in psychology software when the full residual df is supplied.

Usage

ci_partial_r_all(r, df, level = 0.95)

Arguments

r

Partial r

df

Residual df

level

Confidence level

Value

Named list of ci_result objects


Comprehensive CI computation for correlation

Description

Comprehensive CI computation for correlation

Usage

ci_r(r, n, level = 0.95)

Arguments

r

Correlation coefficient

n

Sample size

level

Confidence level

Value

ci_result list


Fisher-z CI for semi-partial correlation (v0.3.5)

Description

Same Fisher-z transform applied to the semi-partial r value (an approximation; the exact distribution of semi-partial r depends on the full covariance structure). Documented as an approximation.

Usage

ci_semi_partial_r_all(r, df, level = 0.95)

Arguments

r

Semi-partial r

df

Residual df

level

Confidence level

Value

Named list of ci_result objects


Confidence interval for Spearman's rho (Bonett & Wright, 2000)

Description

Fisher z-transform with the Spearman variance correction SE = sqrt((1 + rho^2 / 2) / (n - 3)), distinguishing it from the plain Pearson Fisher-z interval.

Usage

ci_spearman(rho, n, conf_level = 0.95)

Arguments

rho

Spearman correlation coefficient.

n

Sample size.

conf_level

Confidence level.

Value

list(ci_low, ci_high).


Wald-on-beta CI for standardized beta (v0.3.5)

Description

Normal approximation: beta +/- z * SE_beta. SE is supplied directly when the paper reports SE alongside b/beta; otherwise back-derive from t and df via SE_beta_approx = beta / t (valid when t = beta / SE_beta).

Usage

ci_standardized_beta_all(
  beta,
  SE_beta = NULL,
  t_stat = NULL,
  df = NULL,
  level = 0.95
)

Arguments

beta

Standardized regression coefficient

SE_beta

Standard error of standardized beta (optional)

t_stat

Test statistic (optional, used to back-derive SE)

df

Residual df (optional, used to bound back-derived SE)

level

Confidence level

Value

Named list of ci_result objects


Compare effectcheck and statcheck on a file (DEFUNCT in v0.4.0)

Description

Removed in effectcheck 0.4.0. The text-input variant compare_with_statcheck() is the supported entry point — extract via docpluck and pass the result.

Usage

compare_file_with_statcheck(path, ...)

Arguments

path

Defunct argument.

...

Defunct argument.

Value

Errors with a migration message.


Compare reported value to all variants

Description

Creates a comparison table showing the reported value against all computed variants.

Usage

compare_to_variants(x, row_index = 1)

Arguments

x

An effectcheck object

row_index

The row index

Value

A data frame with variant comparisons

Examples

res <- check_text("t(28) = 2.21, p = .035, d = 0.80")
compare_to_variants(res, 1)

Compare effectcheck results with statcheck

Description

Runs both effectcheck and statcheck on the same text and returns a merged comparison tibble.

Usage

compare_with_statcheck(text, ...)

Arguments

text

Character string containing APA-formatted statistics

...

Additional arguments passed to check_text()

Value

A tibble with source column ("both", "effectcheck_only", "statcheck_only")

Examples


comp <- compare_with_statcheck("t(28) = 2.21, p = .035, d = 0.80")
print(comp)


Compute effects and compare to reported values for one parsed row

Description

This function implements type-matched comparison: it compares reported effect sizes against computed variants of the SAME type. When design is ambiguous, it computes all variants and finds the closest match among same-type variants.

Usage

compute_and_compare_one(
  row,
  ci_level = 0.95,
  alpha = 0.05,
  one_tailed = FALSE,
  paired_r_grid = c(seq(0.1, 0.9, by = 0.1), 0.95),
  assume_equal_ns_when_missing = TRUE,
  tol_effect = list(d = 0.02, r = 0.005, phi = 0.02, V = 0.02),
  tol_ci = 0.02,
  tol_p = 0.001,
  cross_type_action = "NOTE",
  ci_affects_status = TRUE,
  plausibility_filter = TRUE,
  sign_sensitive = FALSE,
  method_context_action = "NOTE",
  design_ambiguous_action = "WARN",
  unknown_groups_action = "WARN"
)

Arguments

row

A single row from parsed data

ci_level

Default CI level

alpha

Significance threshold

one_tailed

Whether to use one-tailed tests

paired_r_grid

Grid of r values for paired t-test computations

assume_equal_ns_when_missing

Whether to assume equal n when missing

tol_effect

List of tolerances by effect type

tol_ci

Tolerance for CI bounds

tol_p

Tolerance for p-values

cross_type_action

Action when cross-type match found ("NOTE", "WARN", or "ERROR")

ci_affects_status

Whether CI mismatches affect status (default TRUE)

plausibility_filter

Whether to apply plausibility bounds filter (default TRUE)

sign_sensitive

Intended to make sign differences affect status (default FALSE) – accepted and recorded in the result's settings, but currently has NO effect on any computed value or status

method_context_action

Action when method context detected in chunk ("NOTE", "WARN", "SKIP")

design_ambiguous_action

Action when a design-ambiguous t-test (or F(1,df), or z with d/g) effect-size ERROR occurs ("WARN", "NOTE", or "ERROR"; default "WARN").

It has one exception, and it is deliberate. The downgrade is applied only where design ambiguity is a candidate EXPLANATION for the discrepancy – that is, where the reported effect lies within the range of the computed independent and paired variants plus a 50\ reported effect matching NEITHER design is not explained by not knowing which design was used, so it keeps its ERROR and this parameter is inert on that row. Same principle as the v0.6.18 omnibus-df rule: an effect matching neither candidate keeps its flag. The row states the reason ("Extreme discrepancy ... likely reflects data extraction error").

Documented in v0.7.9 after a downstream consumer probed the parameter and found 2 rows in 148,984 where a caller asking for "WARN" got "ERROR". The behaviour was correct and the SILENCE was the defect: a policy knob whose exception is not documented reads, from outside, exactly like a policy knob that does not work. Pinned by test-v079-design-ambiguous-action-scope.R, both directions.

unknown_groups_action

Action when d/g ERROR occurs with unknown group sizes n1/n2 ("WARN", "NOTE", or "ERROR"; default "WARN")

Value

A tibble with comparison results


Compute range of plausible dav values

Description

Calculates dav across a grid of possible correlations.

Usage

compute_dav_range(dz, r_grid = c(seq(0.1, 0.9, by = 0.1), 0.95))

Arguments

dz

Cohen's dz

r_grid

Vector of correlations to test

Value

List with min, max, median, and values


Count statistics by category

Description

Provides counts of statistics grouped by various categories.

Usage

count_by(x, by = c("status", "test_type", "uncertainty", "design", "source"))

Arguments

x

An effectcheck object

by

Character, grouping variable: "status", "test_type", "uncertainty", "design", or "source"

Value

A data frame with counts

Examples

results <- check_text("t(28) = 2.21, p = .035. F(1, 50) = 4.03, p = .049")
count_by(results, "status")
count_by(results, "test_type")

Count decimal places in the raw matched string

Description

Counts trailing digits after the decimal point in a numeric string, preserving trailing zeros (which numify() loses). Used for APA-precision tracking — "0.0400" returns 4, "0.04" returns 2, "2" returns 0.

Usage

count_decimal_places(x)

Arguments

x

Character (single value) — the raw matched string

Details

Must be called on the raw regex match group, before numify().

Value

Integer count of decimal places, or NA_integer_ if input is NA/empty


Calculate Cohen's d from t-statistic (Independent Samples)

Description

Calculate Cohen's d from t-statistic (Independent Samples)

Usage

d_ind_from_t(t, n1, n2)

Arguments

t

t-statistic

n1

Sample size 1

n2

Sample size 2

Value

Cohen's d


Convert dz to dav (Cohen's d for average variance)

Description

Convert dz to dav (Cohen's d for average variance)

Usage

dav_from_dz(dz, r)

Arguments

dz

Cohen's dz

r

Correlation between measures

Value

Cohen's dav


Convert dz to drm (Cohen's d for raw means)

Description

Convert dz to drm (Cohen's d for raw means)

Usage

drm_from_dz(dz, r = NA_real_)

Arguments

dz

Cohen's dz

r

Correlation (unused, for interface compatibility)

Value

Cohen's drm


Calculate Cohen's dz from t-statistic (Paired)

Description

Calculate Cohen's dz from t-statistic (Paired)

Usage

dz_from_t(t, n)

Arguments

t

t-statistic

n

Sample size (number of pairs)

Value

Cohen's dz


Identify and Filter EffectCheck Results

Description

Functions for filtering and identifying problematic results in effectcheck output. Identify problematic results

Usage

ec_identify(
  x,
  what = c("errors", "warnings", "decision_errors", "high_uncertainty", "insufficient",
    "all_problems"),
  ...
)

Arguments

x

An effectcheck object

what

Character vector specifying what to identify:

  • "errors": Results with ERROR status

  • "warnings": Results with WARN status

  • "decision_errors": Results with significance reversal

  • "high_uncertainty": Results with high uncertainty level

  • "insufficient": Results with insufficient data

  • "all_problems": All of the above

...

Additional arguments (ignored)

Details

Filters effectcheck results to show only problematic cases based on specified criteria.

Value

An effectcheck object containing only the identified results

Examples

results <- check_text("t(28) = 2.21, p = .035, d = 0.80")
errors <- ec_identify(results, "errors")

Configuration Management for EffectCheck

Description

Retrieves configuration values from environment variables, options, or defaults.


EffectCheck API Functions (DEFUNCT in v0.4.0)

Description

All file-input functions in this file became .Defunct() in effectcheck 0.4.0. ESCImate delegates document extraction to docpluck; pass the resulting text to check_text() for analysis.

Details

Migration:

  ## Before (errors in 0.4.0):
  results <- effectcheck::checkPDFdir("path/to/pdfs/")

  ## After:
  library(httr2)
  pdfs <- list.files("path/to/pdfs/", pattern = "\\.pdf$", full.names = TRUE)
  results <- purrr::map_dfr(pdfs, function(p) {
    resp <- request("https://docpluck.app/api/extract") |>
      req_headers(Authorization = paste("Bearer", Sys.getenv("DOCPLUCK_API_KEY"))) |>
      req_url_query(normalize = "academic", quality = "true") |>
      req_body_multipart(file = curl::form_file(p)) |>
      req_perform()
    dplyr::mutate(check_text(resp_body_json(resp)$text), source = basename(p))
  })

Logging Infrastructure for EffectCheck

Description

Provides structured logging capabilities with fallback to standard R messaging.


Export results to CSV

Description

Exports check results to CSV format with proper handling of special characters and NA values.

Usage

export_csv(res, out, na = "", row.names = FALSE)

Arguments

res

tibble returned by check_text() / check_files()

out

output file path (csv)

na

string to use for NA values (default: "")

row.names

logical, include row names (default: FALSE)

Value

Invisible path to the generated CSV file.

Examples


res <- check_text("t(28) = 2.21, p = .035, d = 0.80")
export_csv(res, out = tempfile(fileext = ".csv"))


Export results to JSON

Description

Exports check results to JSON format with structured metadata.

Usage

export_json(res, out, pretty = TRUE)

Arguments

res

tibble returned by check_text() / check_files()

out

output file path (json)

pretty

logical, pretty-print JSON (default: TRUE)

Value

Invisible path to the generated JSON file.

Examples


res <- check_text("t(28) = 2.21, p = .035, d = 0.80")
export_json(res, out = tempfile(fileext = ".json"))


Extract context window around a sentence

Description

Gets n sentences around a given sentence index for design inference.

Usage

extract_context(chunks, idx, window_size = 2, extended = FALSE)

Arguments

chunks

Character vector of sentence chunks

idx

Index of current sentence

window_size

Number of sentences before/after to include (default 2)

extended

Logical, return extended context (default FALSE)

Value

Character vector of context sentences


Filter results by effect size delta

Description

Filters effectcheck results by the magnitude of effect size discrepancy.

Usage

filter_by_delta(x, min_delta = 0, max_delta = Inf)

Arguments

x

An effectcheck object

min_delta

Minimum absolute delta to include (default 0)

max_delta

Maximum absolute delta to include (default Inf)

Value

An effectcheck object containing only results within the delta range

Examples

results <- check_text("t(28) = 2.21, p = .035, d = 0.80")
filter_by_delta(results, min_delta = 0.1)

Filter results by source file

Description

Filters effectcheck results to show only results from specific files.

Usage

filter_by_source(x, files, pattern = FALSE)

Arguments

x

An effectcheck object

files

Character vector of file names or patterns to include

pattern

Logical, if TRUE treat files as regex patterns (default FALSE)

Value

An effectcheck object containing only results from specified files

Examples

results <- check_text("t(28) = 2.21, p = .035, d = 0.80")
filter_by_source(results, "text_input")

Filter results by test type

Description

Filters effectcheck results to show only specific test types.

Usage

filter_by_test_type(x, types)

Arguments

x

An effectcheck object

types

Character vector of test types to include (e.g., "t", "F", "r", "chisq", "z")

Value

An effectcheck object containing only the specified test types

Examples

results <- check_text("t(28) = 2.21, p = .035. F(1, 50) = 4.03, p = .049")
filter_by_test_type(results, "t")

Filter results by uncertainty level

Description

Filters effectcheck results by uncertainty level.

Usage

filter_by_uncertainty(x, levels)

Arguments

x

An effectcheck object

levels

Character vector of uncertainty levels to include ("low", "medium", "high")

Value

An effectcheck object containing only the specified uncertainty levels

Examples

results <- check_text("t(28) = 2.21, p = .035, d = 0.80")
filter_by_uncertainty(results, "high")

Fisher's z-transformation CI for correlation

Description

Fisher's z-transformation CI for correlation

Usage

fisher_ci_r(r, n, level = 0.95)

Arguments

r

Correlation coefficient

n

Sample size

level

Confidence level

Value

Vector of bounds (lower, upper)


Map docpluck structured table rows to parsed-statistic rows

Description

v0.6.4: consumes docpluck's ?structured=true flattened_rows[] (typed fields, REQUEST_11 / docpluck v2.4.95) and emits rows in the same shape parse_text() returns, so the existing compute_and_compare_one() pipeline verifies / routes them with no sentence re-parsing. Only rows whose fields carry a recognised statistic are mapped; everything else is skipped (the same safe no-op as an empty fields).

Usage

flattened_rows_to_parsed(table_rows)

Arguments

table_rows

A list of docpluck flattened-row records, each a list with label, row_label, row_idx, and a fields list. NULL or empty returns NULL.

Details

Mapping (typed keys only – an effect family is never inferred from an untyped est):

Reported CI bounds map to ciL_reported / ciU_reported; p_op to p_symbol. Each row is tagged from_table = TRUE (so check.R sets result_context = "table") and carries source_table / table_group (the docpluck arm tag: ITT/PP, Separate/Joint, Target article/Replication).

Value

A tibble of parsed-statistic rows (or NULL), bindable to the parse_text() output via dplyr::bind_rows().


Format variants for display

Description

Creates a formatted string representation of variants for a row.

Usage

format_variants(x, row_index = 1, include_alternatives = TRUE)

Arguments

x

An effectcheck object

row_index

The row index

include_alternatives

Whether to include alternative suggestions

Value

A character string with formatted variant information

Examples

res <- check_text("t(28) = 2.21, p = .035, d = 0.80")
cat(format_variants(res, 1))

Calculate Hedges' g from t-statistic

Description

Calculate Hedges' g from t-statistic

Usage

g_ind_from_t(t, n1, n2)

Arguments

t

t-statistic

n1

Sample size 1

n2

Sample size 2

Value

Hedges' g


Generate a submission-ready EffectCheck report

Description

Creates a self-contained HTML report with executive summary, color-coded results table, expandable details, reproducible R code, and footer stamp.

Usage

generate_report(
  res,
  out,
  format = "html",
  title = "EffectCheck Report",
  author = NULL,
  source_name = NULL,
  include_repro_code = TRUE,
  style = "beginner"
)

Arguments

res

tibble returned by check_text() / check_files()

out

output file path (html)

format

Output format: "html" (default) or "pdf" (requires rmarkdown)

title

Report title (default: "EffectCheck Report")

author

Author name (optional)

source_name

Source file name (optional)

include_repro_code

Logical, include reproducible R code section (default TRUE)

style

Report style: "beginner" for plain English narrative (default), "expert" for the traditional technical table format

Value

Invisible path to the generated report file

Examples


res <- check_text("t(28) = 2.21, p = .035, d = 0.80")
generate_report(res, out = tempfile(fileext = ".html"))


Get alternative suggestions for a row

Description

Get alternative suggestions for a row

Usage

get_alternatives(x, row_index = 1)

Arguments

x

An effectcheck object

row_index

The row index

Value

A list of alternative effect size suggestions

Examples

res <- check_text("t(28) = 2.21, p = .035, d = 0.80")
get_alternatives(res, 1)

Get Configuration Value

Description

Prioritizes:

  1. R Options (effectcheck.key)

  2. Environment Variables (EFFECTCHECK_KEY)

  3. Default value

Usage

get_config(key, default = NULL)

Arguments

key

Configuration key (lowercase)

default

Default value if not found

Value

Configuration value


Get decision errors from effectcheck results

Description

Extracts results where the significance decision would be reversed (i.e., reported as significant when computed is not, or vice versa).

Usage

get_decision_errors(x)

Arguments

x

An effectcheck object

Value

An effectcheck object containing only decision errors

Examples

results <- check_text("t(28) = 2.21, p = .035, d = 0.80")
get_decision_errors(results)

Get effect size family information

Description

Returns information about an effect size family and its variants.

Usage

get_effect_family(effect_type)

Arguments

effect_type

The effect size type (e.g., "d", "eta2", "r")

Value

A list with family, variants, alternatives, and description

Examples

get_effect_family("d")

Get errors from effectcheck results

Description

Convenience function to extract only ERROR status results.

Usage

get_errors(x)

Arguments

x

An effectcheck object

Value

An effectcheck object containing only errors

Examples

results <- check_text("t(28) = 2.21, p = .035, d = 0.80")
get_errors(results)

Find Non-Centrality Parameter (NCP) Confidence Limits for F-distribution

Description

Uses uniroot to invert the non-central F CDF.

Usage

get_ncp_F(F_val, df1, df2, level = 0.95)

Arguments

F_val

Observed F statistic

df1

Numerator degrees of freedom

df2

Denominator degrees of freedom

level

Confidence level (default 0.95)

Value

Vector c(lambda_low, lambda_high)


Get same-type variants for a row

Description

Get same-type variants for a row

Usage

get_same_type_variants(x, row_index = 1)

Arguments

x

An effectcheck object

row_index

The row index

Value

A list of same-type variants with their values and metadata

Examples

res <- check_text("t(28) = 2.21, p = .035, d = 0.80")
get_same_type_variants(res, 1)

Get Tolerance Config

Description

Helper to get tolerances, falling back to constants.

Usage

get_tolerance(type = c("effect", "ci", "p"))

Arguments

type

Type of tolerance ("effect", "ci", "p")

Value

Named list of tolerance thresholds for the specified type.


Get variant metadata

Description

Returns metadata for a specific effect size variant type.

Usage

get_variant_metadata(variant_name)

Arguments

variant_name

The name of the variant (e.g., "d_ind", "dz", "eta2")

Value

A list with name, assumptions, when_to_use, and formula

Examples

get_variant_metadata("d_ind")

Get all variants for a specific row

Description

Extracts and parses the all_variants JSON structure for a given row.

Usage

get_variants(x, row_index = 1)

Arguments

x

An effectcheck object

row_index

The row index to extract variants from

Value

A list with same_type and alternatives sublists

Examples

res <- check_text("t(28) = 2.21, p = .035, d = 0.80")
get_variants(res, 1)

Get warnings from effectcheck results

Description

Convenience function to extract only WARN status results.

Usage

get_warnings(x)

Arguments

x

An effectcheck object

Value

An effectcheck object containing only warnings

Examples

results <- check_text("t(28) = 2.21, p = .035, d = 0.80")
get_warnings(results)

Cohen's h from two proportions

Description

⁠h = |2*asin(sqrt(p1)) - 2*asin(sqrt(p2))|⁠ (Cohen, 1988).

Usage

h_from_proportions(p1, p2)

Arguments

p1, p2

Proportions, each in the range 0 to 1.

Value

Cohen's h, or NA if either proportion is unusable.


Calculate Hedges' J correction factor

Description

Calculate Hedges' J correction factor

Usage

hedges_J(df)

Arguments

df

Degrees of freedom

Value

Correction factor


Initialize Logger

Description

Sets up the logging configuration.

Usage

init_logger(
  level = c("DEBUG", "INFO", "WARN", "ERROR"),
  file = NULL,
  console = TRUE
)

Arguments

level

Logging level (default "INFO")

file

Optional file path to log to

console

Logical, whether to log to console (default TRUE)

Value

Invisible NULL. Called for its side effect of configuring the logger.


Test if object is an effectcheck object

Description

Test if object is an effectcheck object

Usage

is.effectcheck(x)

Arguments

x

Object to test

Value

Logical

Examples

res <- check_text("t(28) = 2.21, p = .035, d = 0.80")
is.effectcheck(res)

P-value for Kendall's tau (normal approximation)

Description

Matches cor.test(method = "kendall", exact = FALSE): ⁠z = 3 * tau * sqrt(n(n-1)) / sqrt(2(2n+5))⁠.

Usage

kendall_pvalue(tau, n)

Arguments

tau

Kendall correlation coefficient.

n

Sample size.

Value

Two-sided p-value, or NA if inputs are unusable.


Log Error Message

Description

Log Error Message

Usage

log_error(msg, ...)

Arguments

msg

Message string

...

variables for interpolation

Value

Invisible NULL. Called for its side effect of logging.


Log Information Message

Description

Log Information Message

Usage

log_info(msg, ...)

Arguments

msg

Message string (supports glue-style interpolation)

...

variables for interpolation

Value

Invisible NULL. Called for its side effect of logging.


Match effectcheck and statcheck results

Description

Uses fuzzy matching on test_type and stat_value to pair results from both tools.

Usage

match_results(ec, sc)

Arguments

ec

effectcheck results tibble

sc

statcheck results data.frame (or NULL)

Value

Merged tibble with source column


Create an effectcheck object

Description

Wraps a tibble of results with the effectcheck S3 class and metadata.

Usage

new_effectcheck(x, call = NULL, settings = list())

Arguments

x

A tibble of check results

call

The original function call (for reproducibility)

settings

List of settings used for the check

Value

An effectcheck S3 object


Normalize text for parsing

Description

Comprehensive normalization pipeline handling Unicode, decimals, whitespace, and CI delimiters. Designed to handle PDF extraction artifacts and locale variations.

Usage

normalize_text(x)

Arguments

x

Character vector to normalize

Value

Normalized character vector


Convert string to numeric with warning suppression

Description

Convert string to numeric with warning suppression

Usage

numify(x)

Arguments

x

String or vector

Value

Numeric value(s)


Convert string to integer, stripping thousands-separator commas

Description

Used ONLY for sample size values (N, n1, n2) where commas are always thousands separators, never decimal commas.

Usage

numify_int(x)

Arguments

x

String or vector

Value

Integer value(s)


Parse APA-style stats and effects from text

Description

Extracts test statistics, effect sizes, confidence intervals, and sample sizes from APA-style text. Includes context window extraction for design inference.

Usage

parse_text(text, context_window_size = 2)

Arguments

text

Character vector of text to parse

context_window_size

Number of sentences before/after to capture (default 2)

Value

Tibble with parsed elements including context windows

Examples

parsed <- parse_text("t(28) = 2.21, p = .035, d = 0.80")
parsed$test_type
parsed$stat_value

Calculate phi coefficient from Chi-square

Description

Calculate phi coefficient from Chi-square

Usage

phi_from_chisq(chisq, N)

Arguments

chisq

Chi-square statistic

N

Total sample size

Value

Phi coefficient


Plot method for effectcheck objects

Description

Creates visualizations of effectcheck results.

Usage

## S3 method for class 'effectcheck'
plot(x, type = c("status", "uncertainty", "test_type", "delta", "all"), ...)

Arguments

x

An effectcheck object

type

Type of plot: "status", "uncertainty", "test_type", "delta", or "all"

...

Additional arguments passed to plotting functions

Value

Invisibly returns x.

Examples


res <- check_text("t(28) = 2.21, p = .035, d = 0.80")
plot(res, type = "status")


Plot effect size delta distribution

Description

Plot effect size delta distribution

Usage

plot_delta(x)

Plot status distribution

Description

Plot status distribution

Usage

plot_status(x)

Plot test type distribution

Description

Plot test type distribution

Usage

plot_test_type(x)

Plot uncertainty distribution

Description

Plot uncertainty distribution

Usage

plot_uncertainty(x)

Print method for effectcheck objects

Description

Displays a formatted summary of effectcheck results.

Usage

## S3 method for class 'effectcheck'
print(x, short = TRUE, n = 10, ...)

Arguments

x

An effectcheck object

short

Logical, if TRUE show abbreviated output (default TRUE)

n

Maximum number of rows to display (default 10)

...

Additional arguments (ignored)

Value

Invisibly returns x.

Examples

res <- check_text("t(28) = 2.21, p = .035, d = 0.80")
print(res)

Print method for effectcheck comparison

Description

Print method for effectcheck comparison

Usage

## S3 method for class 'effectcheck_comparison'
print(x, ...)

Arguments

x

An effectcheck_comparison object

...

Additional arguments (ignored)

Value

Invisibly returns x.

Examples


comp <- compare_with_statcheck("t(28) = 2.21, p = .035, d = 0.80")
print(comp)


Print method for summary.effectcheck objects

Description

Print method for summary.effectcheck objects

Usage

## S3 method for class 'summary.effectcheck'
print(x, ...)

Arguments

x

A summary.effectcheck object

...

Additional arguments (ignored)

Value

Invisibly returns x.

Examples

res <- check_text("t(28) = 2.21, p = .035, d = 0.80")
s <- summary(res)
print(s)

Calculate correlation r from t-statistic

Description

Calculate correlation r from t-statistic

Usage

r_from_t(t, df)

Arguments

t

t-statistic

df

Degrees of freedom

Value

Correlation r


Combine effectcheck objects

Description

Combine effectcheck objects

Usage

## S3 method for class 'effectcheck'
rbind(...)

Arguments

...

effectcheck objects to combine

Value

Combined effectcheck object

Examples

res1 <- check_text("t(28) = 2.21, p = .035")
res2 <- check_text("F(1, 50) = 4.03, p = .049")
combined <- rbind(res1, res2)

Read text from .docx, .html, .txt, or .pdf (DEFUNCT in v0.4.0)

Description

This function was removed in effectcheck 0.4.0. ESCImate now delegates file extraction to docpluck. Extract text externally and pass the result to check_text().

Usage

read_any_text(path, try_tables = TRUE, try_ocr = FALSE)

Arguments

path

File path

try_tables

(defunct argument)

try_ocr

(defunct argument)

Value

Errors with a migration message.


Render an enhanced HTML report

Description

Creates an HTML report with summary statistics, expandable sections, and uncertainty visualization.

Usage

render_report(res, out)

Arguments

res

tibble returned by check_text() / check_files()

out

output file path (html)

Value

Invisible path to the generated HTML report file.

Examples


res <- check_text("t(28) = 2.21, p = .035, d = 0.80")
render_report(res, out = tempfile(fileext = ".html"))


Render report as PDF via rmarkdown

Description

Falls back to HTML if rmarkdown is not available.

Usage

render_report_pdf(
  res,
  out,
  title = "EffectCheck Report",
  author = NULL,
  source_name = NULL,
  include_repro_code = TRUE
)

Arguments

res

Results tibble

out

Output file path

title

Report title

author

Author name

source_name

Source file name

include_repro_code

Include reproducible code

Value

Invisible path to generated file


Safe Stop

Description

Stops execution with a sanitized error message in production, or full details in development.

Usage

safe_stop(msg, public_msg = "An error occurred during processing.")

Arguments

msg

Internal detailed error message

public_msg

Optional public-facing message (default: generic error)

Value

Does not return; always calls stop().


P-value for Spearman's rho (large-sample t approximation)

Description

Matches the approximation that cor.test(method = "spearman", exact = FALSE) uses: t = rho * sqrt((n - 2) / (1 - rho^2)) on n - 2 df.

Usage

spearman_pvalue(rho, n)

Arguments

rho

Spearman correlation coefficient.

n

Sample size.

Value

Two-sided p-value, or NA if inputs are unusable.


Summary method for effectcheck objects

Description

Provides comprehensive summary statistics for effectcheck results.

Usage

## S3 method for class 'effectcheck'
summary(object, ...)

Arguments

object

An effectcheck object

...

Additional arguments (ignored)

Value

A list of class "summary.effectcheck" containing summary statistics

Examples

res <- check_text("t(28) = 2.21, p = .035, d = 0.80")
summary(res)

Verify adjusted R-squared consistency

Description

Verify adjusted R-squared consistency

Usage

verify_adj_R2(R2, adj_R2_reported, n, p, tol = 0.01)

Arguments

R2

R-squared value

adj_R2_reported

Reported adjusted R-squared

n

Sample size

p

Number of predictors

tol

Tolerance (default 0.01)

Value

List with computed, delta, consistent


Verify t-statistic from regression coefficient and SE

Description

Checks if t = b/SE is consistent with the reported t-value.

Usage

verify_t_from_b_SE(b, SE, reported_t, tol = 0.01)

Arguments

b

Regression coefficient

SE

Standard error of b

reported_t

Reported t-value

tol

Tolerance for matching (default 0.01)

Value

List with computed_t, delta, and consistent (logical)