get.stats {JATSdecoder}R Documentation

get.stats

Description

Extracts statistical results from text string, XML, CERMXML, HTML or DOCX files. The result is a list with a vector containing all identified sticked results and a matrix containing the reported standard statistics and recalculated p-values if computation is possible.

Usage

get.stats(
  x,
  output = "both",
  stats.mode = "all",
  recalculate.p = TRUE,
  checkP = FALSE,
  alpha = 0.05,
  criticalDif = 0.02,
  alternative = "undirected",
  estimateZ = FALSE,
  T2t = FALSE,
  R2r = FALSE,
  select = NULL,
  rm.na.col = TRUE,
  cermine = FALSE,
  warnings = TRUE
)

Arguments

x

NISO-JATS coded XML or DOCX file path or plain textual content.

output

Select the desired output. One of c("both", "allStats", "standardStats").

stats.mode

Select a subset of test results by p-value checkability for output. One of: c("all", "checkable", "computable", "uncomputable").

recalculate.p

Logical. If TRUE recalculates p-values of test results if possible.

checkP

Logical. If TRUE observed and recalculated p-values are checked for consistency.

alpha

Numeric. Defines the alpha level to be used for error assignment.

criticalDif

Numeric. Sets the absolute maximum difference in reported and recalculated p-values for error detection.

alternative

Character. Select test sidedness for recomputation of p-values from t-, r- and beta-values. One of c("undirected", "directed"). If "directed" is specified, p-values for directed null-hypothesis are added to the table but still require a manual inspection on consistency of the direction.

estimateZ

Logical. If TRUE detected beta-/d-value is divided by reported standard error "SE" to estimate Z-value ("Zest") for observed beta/d and recompute p-value. Note: This is only valid, if Gauss-Marcov assumptions are met and a sufficiently large sample size is used. If a Z- or t-value is detected in a report of a beta-/d-coefficient with SE, no estimation will be performed, although set to TRUE.

T2t

Logical. If TRUE capital letter T is treated as t-statistic.

R2r

Logical. If TRUE capital letter R is treated as correlation.

select

Select specific standard statistics only (e.g.: c("t", "F", "Chi2")).

rm.na.col

Logical. If TRUE removes all columns with only NA from standardStats.

cermine

Logical. If TRUE CERMINE specific letter conversion will be peformed on allStats results.

warnings

Logical. If FALSE warning messages are omitted.

Value

If output="all": list with two elements. E1: vector of extracted results by allStats and E2: matrix of standard results by standardStats.
If output="allStats": vector of extracted results by allStats.
If output="standardStats": matrix of standard results by standardStats.

Source

A minimal web application that extracts statistical results from single documents with get.stats is hosted at: https://www.get-stats.app/

Statistical results extracted with get.stats can be analyzed and used to identify articles stored in the PubMed Central library at: https://www.scianalyzer.com/.

References

Böschen (2021). "Evaluation of JATSdecoder as an automated text extraction tool for statistical results in scientific reports.” Scientific Reports. doi: 10.1038/s41598-021-98782-3.

See Also

study.character for extracting different study characteristics at once.

Examples

## Extract results from plain text input
x<-c("The mean difference of scale A was significant (beta=12.9, t(18)=2.5, p<.05).",
"The ANOVA yielded significant results on 
 faktor A (F(2,18)=6, p<.05, eta(g)2<-.22)",
"the correlation of x and y was r=.37.")
get.stats(x)

## Extract results from native NISO-JATS XML file
# download example XML file via URL if a connection is possible
x<-"https://journals.plos.org/plosone/article/file?id=10.1371/journal.pone.0114876&type=manuscript"
# file name
file<-paste0(tempdir(),"/file.xml")
# download URL as "file.xml" in tempdir() if a connection is possible
tryCatch({
  readLines(x,n=1)
  download.file(x,file)
  },
  warning = function(w) message(
  "Something went wrong. Check your internet connection and the link address."),
  error = function(e) message(
  "Something went wrong. Check your internet connection and the link address.")
)
# apply get.stats() to file
if(file.exists(file)) get.stats(file)

[Package JATSdecoder version 1.2.0 Index]