Dear all,
I have a dataset that looks like this. People have taken multiple loans for multiple reasons.
I need to see what were the reasons for taking the loans (total of three categories). I want to produce something like this
I tried using the collapse and count command on Stata 14.2 but could not succeed. Do I need to restructure my data, or will a better collapse coding help?
Thanks!
I have a dataset that looks like this. People have taken multiple loans for multiple reasons.
| ID | Gender | Reasons for taking loans | |||
| Loan1 | Loan2 | Loan3 | Loan4 | ||
| 1 | Female | 1 | 1 | 1 | 3 |
| 2 | Male | 1 | 2 | 1 | 2 |
| 3 | Female | 3 | 1 | 2 | . |
| 4 | Male | 2 | 3 | . | . |
| Gender | Count of each reason | Total | ||
| Count 1 | Count 2 | Count 3 | ||
| Male | 2 | 3 | 1 | 6 |
| Female | 4 | 1 | 2 | 7 |
Thanks!

Comment