estimate_pdiff_one: Estimate magnitudes of difference from a single measure...

View source: R/estimate_pdiff_one.R

estimate_pdiff_oneR Documentation

Estimate magnitudes of difference from a single measure compared to a know reference.

Description

Returns effect sizes appropriate for designs with one quantitative variable compared against a known reference.

Usage

estimate_pdiff_one(
  data = NULL,
  outcome_variable = NULL,
  comparison_cases = NULL,
  comparison_n = NULL,
  reference_p = 0,
  case_label = 1,
  outcome_variable_name = "My outcome variable",
  conf_level = 0.95,
  count_NA = FALSE
)

Arguments

data

For raw data - a dataframe or tibble

outcome_variable

For raw data - The column name of the outcome variable, which must be a factor, or a vector that is a factor

comparison_cases

For summary data, a numeric integer > 0

comparison_n

For summary data, a numeric integer >= count

reference_p

Reference proportion, numeric >=0 and <=1

case_label

An optional numeric or character label for the count level.

outcome_variable_name

Optional friendly name for the outcome variable. Defaults to 'My outcome variable' or the outcome variable column name if a data frame is passed.

conf_level

The confidence level for the confidence interval. Given in decimal form. Defaults to 0.95.

count_NA

Logical to count NAs (TRUE) in total N or not (FALSE)

Value

Returns object of class esci_estimate

Examples

# From Raw Data ------------------------------------
# Just pass in the data source, grouping column, and outcome column.
# You can pass these in by position, skipping the labels:

# Note... not sure if PlantGrowth dataset meets assumptions for this analysis
estimate_pdiff_one(
 datasets::PlantGrowth,
 group,
 reference_p = 0.33
)


rcalinjageman/esci4 documentation built on May 18, 2023, 4:01 a.m.