parse_CI_string {MetaUtility}R Documentation

Parse a string with point estimate and confidence interval

Description

Given a vector of strings such as "0.65 (0.6, 0.70)", for example obtained by running optical character recognition (OCR) software on a screenshot of a published forest plot, parses the strings into a dataframe of point estimates and upper confidence interval limits. Assumes that the point estimate occurs before an opening bracket of the form "(" or "[" and that the confidence interval upper limit follows a the character sep (by default a comma, but might be a hyphen, for example). To further parse this dataframe into point estimates and variances, see MetaUtility::scrape_meta.

Usage

parse_CI_string(string, sep = ",")

Arguments

string

A vector of strings to be parsed.

sep

The character (not including whitespaces) separating the lower from the upper limits.

Examples

# messy string of confidence intervals
mystring = c( "0.65 [0.6, 0.7]", "0.8(0.5, 0.9]", "1.2  [0.3, 1.5)")
parse_CI_string(mystring)

# now with a hyphen separator
mystring = c( "0.65 [0.6- 0.7]", "0.8(0.5 - 0.9]", "1.2  [0.3 -1.5)")
parse_CI_string(mystring, sep="-")

[Package MetaUtility version 2.1.2 Index]