Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- T4 <- table(bank$Term_deposit, bank$housing_loan)
- %>% prop.table(margin = 2) *100
- T4
- no yes
- no 83.418772 92.217126 <br/>
- yes 16.581228 7.782874
- kable(T4, caption = "%agewise comparison for marital status")
- | | no| yes|<br/>
- |:---|--------:|---------:|<br/>
- |no | 83.41877| 92.217126|<br/>
- |yes | 16.58123| 7.782874|<br/>
- | | no| yes|<br/>
- |:---|--------:|---------:|<br/>
- CAT1 | 83.41877| 92.217126|<br/>
- |CAT2| 16.58123| 7.782874|
- | | cat1| cat2|<br/>
- |:---|--------:|---------:|<br/>
- CAT1 | 83.41877| 92.217126|<br/>
- |CAT2| 16.58123| 7.782874|<br/>
- library(pandoc)
- colnames(T4) <- c("CAT1", "CAT2")
- rownames(T4) <- c("no", "yes")
- pandoc.table(T4)
- -------------------------
- CAT1 CAT2
- -------- -------- -------
- **y** 13473 77311
- **n** 226221 0
- -------------------------
- colnames(T4) <- c("deposit: no", "deposit: yes")
- rownames(T4) <- c("loan: no", "loan: yes")
- pandoc.table(T4)
- --------------------------------------------
- deposit: no deposit: yes
- --------------- ------------- --------------
- **loan: no** 13473 77311
- **loan: yes** 226221 0
- --------------------------------------------
- library(expss)
- df <- apply_labels(bank,
- Term_deposit= "Term deposit",
- housing_loan= "Housing loan")
- cro_cpct(bank$Term_deposit, bank$housing_loan)
- | | | Housing loan | |
- | | | 0 | 1 |
- | ------------ | ------------ | ------------ | --- |
- | Term deposit | 0 | 39.4 | 100 |
- | | 1 | 60.6 | |
- | | #Total cases | 66.0 | 34 |
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement