# NOT RUN {
### Generate two factor vectors
treatment <- factor(c(rep(0, 33), rep(1, 45), rep(0, 63), rep(1, 21)),
levels=c(0,1), labels=c("no", "yes"));
survival <- factor(c(rep(0, 78), rep(1, 84)),
levels=c(0, 1), labels=c("no", "yes"));
### Compute and display odds ratio
oddsratio(treatment, survival);
### Or present a table
oddsratio(table(treatment, survival));
# }
Run the code above in your browser using DataLab