- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I've been struggling with data that is overlapping (many defendants correlating to one claim). I'm trying to get a pvalue using the Kruskal Wallis test comparing medians of 3 continuous variables (paymentsum1, paymentsum2, paymentsum3). Below is the structure of the data. I can't combine paymentsum1-3 into long format because the 1, 2, 3 correlate to different groups and that grouping cannot be lost. I'm hoping this is obvious!
case_id paymentsum1 paymentsum2 paymentsum3
1 $500 $1000 $20
2 $100 . .
3 $200 $500
4 $1000
Thanks
Laura
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Why would this data structure be inappropriate?
claim_id group payment
1 1 $500
2 1 $100
3 1 $200
4 1 $1000
1 2 $1000
3 2 $500
1 3 $20
no information is lost.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Why would this data structure be inappropriate?
claim_id group payment
1 1 $500
2 1 $100
3 1 $200
4 1 $1000
1 2 $1000
3 2 $500
1 3 $20
no information is lost.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
use proc transpose to convert wide data to long data.
https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-long-to-wide-using-proc-transpose/