data(MktDATA, package = "UBStats")
# Marginal summaries
# - Numerical variable: Default summaries
distr.summary.x(x = AOV, data = MktDATA)
# - Numerical variable: More summaries
distr.summary.x(x = AOV,
stats = c("central","dispersion","fivenum"),
data = MktDATA)
distr.summary.x(x = AOV, stats = c("mode","mean","sd","cv","fivenum"),
data = MktDATA)
# - Character or factor (only proper statistics calculated)
distr.summary.x(x = LikeMost, stats = c("mode","mean","sd","cv","fivenum"),
data = MktDATA)
distr.summary.x(x = Education, stats = c("mode","mean","sd","cv","fivenum"),
data = MktDATA)
# Measures conditioned to a single variable
# - Numerical variable by a character vector
distr.summary.x(x = TotVal,
stats = c("p5","p10","p25","p50","p75","p90","p95"),
by1 = Gender, digits = 1, data = MktDATA)
# - Numerical variable by a numerical variable
# classified into intervals
distr.summary.x(x = TotVal,
stats = c("central","dispersion"),
by1 = AOV, breaks.by1 = 5,
digits = 1, data = MktDATA)
# - Numerical variable by a variable measured in classes
distr.summary.x(x = TotVal,
stats = c("central","dispersion"),
by1 = Income.S,
interval.by1 = TRUE,
digits = 1, data = MktDATA)
# Measures conditioned to two variables
distr.summary.x(x = TotVal, stats = "fivenumbers",
by1 = Gender, by2 = Kids, data = MktDATA)
distr.summary.x(x = TotVal, stats = "fivenumbers",
by1 = Income.S, by2 = Gender,
interval.by1 = TRUE, data = MktDATA)
distr.summary.x(x = TotVal, stats = "fivenumbers",
by1 = Gender, by2 = AOV,
breaks.by2 = 5, data = MktDATA)
# Arguments adj.breaks and use.scientific
# Variables with a very wide range
LargeX<-MktDATA$TotVal*1000000
LargeBY<-MktDATA$AOV*5000000
# - Default: no scientific notation
distr.summary.x(LargeX, by1=LargeBY, breaks.by1 = 5,
data = MktDATA)
# - Scientific notation for summaries
distr.summary.x(LargeX, by1=LargeBY, breaks.by1 = 5,
use.scientific = TRUE, data = MktDATA)
# - Scientific notation for intervals endpoints
distr.summary.x(LargeX, by1=LargeBY, breaks.by1 = 5,
adj.breaks = FALSE, data = MktDATA)
# - Scientific notation for intervals endpoints and summaries
distr.summary.x(LargeX, by1=LargeBY, breaks.by1 = 5,
adj.breaks = FALSE, use.scientific = TRUE,
data = MktDATA)
# Output the list with the requested summaries
Out_TotVal<-distr.summary.x(x = TotVal,
by1 = Income.S, by2 = Gender,
interval.by1 = TRUE,
stats = c("central","fivenum","dispersion"),
data = MktDATA)
Run the code above in your browser using DataLab