Advertisement
otorp2

simple two way table

Jul 6th, 2017
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. > barplot(smoke,legend=T,beside=T,main='Smoking Status by SES')
  2. > smoke <- matrix(c(51,43,22,92,28,21,68,22,9),ncol=3,byrow=TRUE)
  3. > colnames(smoke) <- c("High","Low","Middle")
  4. > rownames(smoke) <- c("current","former","never")
  5. > smoke <- as.table(smoke)
  6. >
  7. > smoke
  8. High Low Middle
  9. current 51 43 22
  10. former 92 28 21
  11. never 68 22 9
  12. > barplot(smoke,legend=T,beside=T,main='Smoking Status by SES')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement