data(MktDATA, package = "UBStats")
# Character vectors, factors, and discrete numeric vectors
# - Default: joint counts
distr.table.xy(LikeMost, Children, data = MktDATA)
# - Joint and conditional distribution of x|y
# counts and proportions, no totals
distr.table.xy(LikeMost, Education, freq = c("counts","Prop"),
freq.type = c("joint","x|y"), total = FALSE,
data = MktDATA)
# - Joint and conditional row and column distributions (%)
distr.table.xy(CustClass, Children, freq = "Percentages",
freq.type = c("joint","row","column"),
data = MktDATA)
# Numerical variables classified or measured in classes
# - A numerical variable classified into intervals
# and a factor
distr.table.xy(CustClass, TotPurch,
breaks.y = c(0,5,10,15,20,35),
freq = c("Counts","Prop"), freq.type = "y|x",
data = MktDATA)
# - Two numerical variables, one measured in classes
# and the other classified into intervals
distr.table.xy(Income.S, TotPurch, interval.x = TRUE,
breaks.y = c(0,5,10,15,20,35),
freq = c("Counts","Prop"),
freq.type = c("row","col"), data = MktDATA)
# Argument force.digits
# - Default: manages possible excess of rounding
distr.table.xy(CustClass, Children, freq = "Percentages",
freq.type = c("x|y"),data = MktDATA)
# - Force to the required rounding
distr.table.xy(CustClass, Children, freq = "Percentages",
freq.type = c("x|y"),
force.digits = TRUE, data = MktDATA)
# Output the list with the requested tables
tables.xy<-distr.table.xy(Income.S, TotPurch,
interval.x = TRUE,
breaks.y = c(0,5,10,15,20,35),
freq = c("Counts","Prop"),
freq.type = c("joint","row","col"),
data = MktDATA)
Run the code above in your browser using DataLab