# Example 1a: Two-Sided 95% CI for 'vs'
ci.prop(mtcars$vs)
#
# Example 1b: Alternative specification using the 'data' argument
ci.prop(vs, data = mtcars)
# Example 2: Two-Sided 95% CI using Wald method
ci.prop(mtcars$vs, method = "wald")
# Example 3: One-Sided 95% CI
ci.prop(mtcars$vs, alternative = "less")
# Example 4: Two-Sided 99% CI
ci.prop(mtcars$vs, conf.level = 0.99)
# Example 5: Two-Sided 95% CI, print results with 4 digits
ci.prop(mtcars$vs, digits = 4)
# Example 6a: Two-Sided 95% CI for 'vs' and 'am',
# listwise deletion for missing data
ci.prop(mtcars[, c("vs", "am")], na.omit = TRUE)
# Example 6b: Alternative specification using the 'data' argument
# listwise deletion for missing data
ci.prop(vs, am, data = mtcars, na.omit = TRUE)
# Example 7a: Two-Sided 95% CI, analysis by 'gear' separately
ci.prop(mtcars[, c("vs", "am")], group = mtcars$gear)
# Example 7b: Alternative specification using the 'data' argument
ci.prop(vs, am, data = mtcars, group = "gear")
# Example 8: Two-Sided 95% CI, analysis by 'gear' separately, sort by variables
ci.prop(mtcars[, c("vs", "am")], group = mtcars$gear, sort.var = TRUE)
# Example 9: Two-Sided 95% CI, split analysis by 'cyl'
ci.prop(mtcars[, c("vs", "am")], split = mtcars$cyl)
# Example 10a: Two-Sided 95% CI, analysis by 'gear' separately, split by 'cyl'
ci.prop(mtcars[, c("vs", "am")], group = mtcars$gear, split = mtcars$cyl)
# Example 10b: Alternative specification using the 'data' argument
ci.prop(vs, am, data = mtcars, group = "gear", split = "cyl")
if (FALSE) {
# Example 11: Write results into a text file
ci.prop(vs, am, data = mtcars, group = "gear", split = "cyl", write = "Prop.txt")
}
Run the code above in your browser using DataLab