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
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.
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.
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/
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.