# NOT RUN {
## Computes a contingency table
## (expressed in percentages)
## of jazz and age variables
## from the 'Music' example data set
## with or without weights
data(Music)
prop.wtable(Music$Jazz)
prop.wtable(Music$Jazz,Music$Gender)
prop.wtable(Music$Jazz,Music$Gender,dir=1)
prop.wtable(Music$Jazz,Music$Gender,dir=2)
weight <- rep(c(0,0.5,1,1.5,2), length.out=nrow(Music))
prop.wtable(Music$Jazz,w=weight)
prop.wtable(Music$Jazz,Music$Age,weight)
prop.wtable(Music$Jazz,Music$Age,weight,dir=1)
prop.wtable(Music$Jazz,Music$Age,weight,dir=2)
# }
Run the code above in your browser using DataLab