data(MktDATA, package = "UBStats")
# Success = one value of a character vector or factor
CI.prop(WouldSuggest, success = "Yes", data = MktDATA)
# - change confidence level and rounding
CI.prop(Education, success = "Post-Grad",
conf.level = 0.9, digits = 4,
data = MktDATA)
# Success = numeric value
CI.prop(Children, success = 2, data = MktDATA)
# Binary variable ('success' is 1 by default)
CI.prop(LastCampaign, digits = 3, data = MktDATA)
# Logical variable ('success' is TRUE by default)
CI.prop(RespCampaign, conf.level = 0.9, digits = 3, data = MktDATA)
# Success based on combined conditions
# - Build a (logical) vector indicating whether a condition is satisfied
IsTop <- MktDATA$CustClass == "Gold" | MktDATA$CustClass == "Platinum"
CI.prop(IsTop, conf.level = 0.9)
# - A very rare event
HighAOV <- MktDATA$AOV>150
CI.prop(HighAOV, conf.level = 0.9)
# Arguments force.digits, use.scientific
# - Default: manages possible excess of rounding
CI.prop(HighAOV)
# - Forcing digits to the default values (2)
CI.prop(HighAOV, force.digits = TRUE)
# - Allow scientific notation
CI.prop(HighAOV, use.scientific = TRUE)
# Output results
out_ci_prop<-CI.prop(HighAOV)
Run the code above in your browser using DataLab