R/ci_z2.R
ci_z2.Rd
Calculates the confidence interval for the difference of the mean between 2 samples (Z distribution).
ci_z2(x1, sig1, n1, x2, sig2, n2, conf.level = 0.95, digits = 2)
x1 | Sample's 1 mean |
---|---|
sig1 | Population's 1 standard deviation |
n1 | Sample size of sample 1 |
x2 | Sample's 2 mean |
sig2 | Population's 2 standard deviation |
n2 | Sample size of sample 2 |
conf.level | Confidence level to use for the confidence interval (Default is 0.95) |
digits | Number of digits to round to (Default is 2) |
A tibble with the difference of means, and lower and upper ends of the confidence interval
x1 <- 42 sig1 <- 8 n1 <- 75 x2 <- 36 sig2 <- 6 n2 <- 50 ci_z2(x1, sig1, n1, x2, sig2, n2)#> # A tibble: 1 × 3 #> mean_diff lower upper #> <dbl> <dbl> <dbl> #> 1 6 3.54 8.46