Hi,
I would like to reshape my dataset below to a wide format such that my first column contains only single values while the second column contains same values. I have done this only for one Age_Group_=1 as shown in the what I want example dataset.
Thanks,
Nader
clear
input float(sample_label Age_Group_ meanTLE_ meanHLE_ meanPLE_)
10 1 34.345562 26.949627 .7846588
10 2 25.502546 19.94874 .782223
10 3 17.263601 13.420696 .7773955
11 1 36.008446 28.711313 .7973411
11 2 26.84264 21.37448 .7962812
11 3 18.146757 14.363532 .7915174
12 1 35.14976 26.588387 .7564103
12 2 26.15379 19.72889 .7543169
12 3 17.69569 13.256854 .7491353
13 1 34.352455 26.53276 .7723663
13 2 25.51025 19.64049 .7699032
13 3 17.27008 13.210564 .7649361
14 1 35.999706 29.11195 .8086639
14 2 26.833727 21.67034 .8075716
14 3 18.13978 14.565585 .8029606
15 1 34.3562 26.222485 .7632507
15 2 25.514814 19.410906 .7607672
15 3 17.274118 13.054158 .7557027
16 1 35.14116 27.348135 .7782167
16 2 26.143465 20.291723 .7761453
16 3 17.686651 13.640334 .7712016
17 1 34.346046 26.931656 .7841246
17 2 25.50309 19.935823 .7816998
17 3 17.26402 13.411888 .7768664
18 1 36.006386 28.772425 .7990835
18 2 26.840286 21.416553 .7979179
18 3 18.145027 14.392232 .7931737
19 1 35.14572 26.8311 .7634027
19 2 26.14876 19.903845 .7611521
19 3 17.69166 13.375977 .7560384
20 1 34.350166 26.595913 .7742561
20 2 25.50756 19.68392 .7716869
20 3 17.268095 13.24015 .7667372
21 1 36.00021 29.09467 .8081727
21 2 26.83426 21.65792 .8070929
21 3 18.14018 14.557106 .8024755
22 1 34.351376 26.45478 .7701202
22 2 25.509 19.57796 .7674892
22 3 17.269518 13.167942 .7624925
23 1 35.141567 27.329313 .7776722
23 2 26.143934 20.27816 .7756125
23 3 17.687017 13.63109 .770663
end
*example what I want for only 50-51
clear
input float(sample_label Age_Group_ meanTLE_ meanHLE_ meanPLE_ sample_label_01 Age_Group__01 meanTLE__01 meanHLE__01 meanPLE__01)
10 1 34.345562 26.949627 .7846588 17 1 34.346046 26.931656 .7841246
11 1 36.008446 28.711313 .7973411 18 1 36.006386 28.772425 .7990835
12 1 35.14976 26.588387 .7564103 19 1 35.14572 26.8311 .7634027
13 1 34.352455 26.53276 .7723663 20 1 34.350166 26.595913 .7742561
14 1 35.999706 29.11195 .8086639 21 1 36.00021 29.09467 .8081727
15 1 34.3562 26.222485 .7632507 22 1 34.351376 26.45478 .7701202
16 1 35.14116 27.348135 .7782167 23 1 35.141567 27.329313 .7776722
end
I would like to reshape my dataset below to a wide format such that my first column contains only single values while the second column contains same values. I have done this only for one Age_Group_=1 as shown in the what I want example dataset.
Thanks,
Nader
clear
input float(sample_label Age_Group_ meanTLE_ meanHLE_ meanPLE_)
10 1 34.345562 26.949627 .7846588
10 2 25.502546 19.94874 .782223
10 3 17.263601 13.420696 .7773955
11 1 36.008446 28.711313 .7973411
11 2 26.84264 21.37448 .7962812
11 3 18.146757 14.363532 .7915174
12 1 35.14976 26.588387 .7564103
12 2 26.15379 19.72889 .7543169
12 3 17.69569 13.256854 .7491353
13 1 34.352455 26.53276 .7723663
13 2 25.51025 19.64049 .7699032
13 3 17.27008 13.210564 .7649361
14 1 35.999706 29.11195 .8086639
14 2 26.833727 21.67034 .8075716
14 3 18.13978 14.565585 .8029606
15 1 34.3562 26.222485 .7632507
15 2 25.514814 19.410906 .7607672
15 3 17.274118 13.054158 .7557027
16 1 35.14116 27.348135 .7782167
16 2 26.143465 20.291723 .7761453
16 3 17.686651 13.640334 .7712016
17 1 34.346046 26.931656 .7841246
17 2 25.50309 19.935823 .7816998
17 3 17.26402 13.411888 .7768664
18 1 36.006386 28.772425 .7990835
18 2 26.840286 21.416553 .7979179
18 3 18.145027 14.392232 .7931737
19 1 35.14572 26.8311 .7634027
19 2 26.14876 19.903845 .7611521
19 3 17.69166 13.375977 .7560384
20 1 34.350166 26.595913 .7742561
20 2 25.50756 19.68392 .7716869
20 3 17.268095 13.24015 .7667372
21 1 36.00021 29.09467 .8081727
21 2 26.83426 21.65792 .8070929
21 3 18.14018 14.557106 .8024755
22 1 34.351376 26.45478 .7701202
22 2 25.509 19.57796 .7674892
22 3 17.269518 13.167942 .7624925
23 1 35.141567 27.329313 .7776722
23 2 26.143934 20.27816 .7756125
23 3 17.687017 13.63109 .770663
end
*example what I want for only 50-51
clear
input float(sample_label Age_Group_ meanTLE_ meanHLE_ meanPLE_ sample_label_01 Age_Group__01 meanTLE__01 meanHLE__01 meanPLE__01)
10 1 34.345562 26.949627 .7846588 17 1 34.346046 26.931656 .7841246
11 1 36.008446 28.711313 .7973411 18 1 36.006386 28.772425 .7990835
12 1 35.14976 26.588387 .7564103 19 1 35.14572 26.8311 .7634027
13 1 34.352455 26.53276 .7723663 20 1 34.350166 26.595913 .7742561
14 1 35.999706 29.11195 .8086639 21 1 36.00021 29.09467 .8081727
15 1 34.3562 26.222485 .7632507 22 1 34.351376 26.45478 .7701202
16 1 35.14116 27.348135 .7782167 23 1 35.141567 27.329313 .7776722
end
Comment