Hi i have this data
And would like to reshape to this:
I have tried
However, as I'm not sure if it works with string.
any insight would be fantastic
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str9 v1 float(v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12) "gender" 0 0 0 0 0 0 0 0 0 0 0 "Age" 40 45 50 55 60 65 70 75 80 85 90 "inc Cost" -4096.732 -4072.8906 -4053.416 -4041.457 -4039.64 -4049.648 -4075.639 -4117.9536 -4171.0566 -4231.0615 -4283.3975 "inc QALY" -.3069413 -.3040651 -.29440674 -.27768388 -.2502006 -.2042741 -.1462058 -.05806535 .06411792 .19958808 .3567987 "TK qualy" 15.857925 14.933599 13.889514 12.70926 11.393097 9.958816 8.413136 6.783762 5.200871 3.756846 2.604844 end
And would like to reshape to this:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str6 var1 str3 var2 str8 var3 "gender" "age" "inc Cost" "1" "40" "-3682.84" "1" "45" "-3673.99" end
I have tried
Code:
reshape wide var, i(gender) j(Age)
any insight would be fantastic
Comment