CI_mdiff_one: Estimate the mean difference from a sample mean to a...

Description Usage Arguments Value Details Examples

View source: R/CI_mdiff_one.R

Description

\loadmathjax

CI_mdiff_one returns the point estimate and confidence interval for the mean difference between a sample mean and a population/reference mean \mjdeqn M_diff = X - \muMdiff = X - mu

Usage

1
2
3
4
5
6
7
8
CI_mdiff_one(
  comparison_m,
  comparison_s,
  comparison_n,
  population_m = 0,
  population_s = NULL,
  conf_level = 0.95
)

Arguments

comparison_m

Mean from the sample

comparison_s

Standard deviation from the sample

comparison_n

Sample size

population_m

Optional value for population mean; defaults to 0

population_s

Optional value for population sd; defaults to NULL. If NULL function returns a CI based on the sample sd and a t-distribution. If a numeric value is passed, returns a CI based on the population_sd and a z-distribution

conf_level

The confidence level in decimal form. Defaults to 0.95.

Value

Returns a list with these named elements:

Details

If population_s is passed:

If population_s is NULL:

Examples

1
2
3
4
5
  CI_mdiff_one(
    comparison_m = 10, 
    comparison_s = 3, 
    comparison_n = 25
  )   

rcalinjageman/esci2 documentation built on Dec. 22, 2021, 1:02 p.m.