Hi all,
I need advice on how to change the dataset which is in the form of table with 6 rows * 3 columns to table with 4 rows * 4 columns.
The original dataset is as follows.
input str6 treat1 str6 treat2 double(value)
treat1 treat2 value
1. "SK" "tPA" 0.98
2. "SK" "atPA" 0.84
3. "SK" "Comb" 0.95
4. "tPA" "atPA" 0.85
5. "tPA" "Comb" 0.97
6. "atPA" "Comb" 1.13
7. end
I need transformation to dataset like this.
input str6 row str6 SK str6 tPA str6 atPA str6 Comb
row SK tPA atPA Comb
1. "SK" . 0.98 0.84 0.95
2. "tPA" 0.98 . 0.85 0.97
3. "atPA" 0.84 0.85 . 1.13
4. "Comb" 0.95 0.97 1.13 .
5. end
I am struggling to find the solution.
I very much appreciate advice/help.
With warm regards,
Sateesh
Related Posts with Reshape long to wide
Merge not matching for one year for a specific variable unrelated to the mergeI am looking at data on recycling and compost rates and have merged this data with recycling and was…
Matching firm algorithmI am fairly new to Stata and for my PhD would like to try and reproduce previous research done. I h…
Reshape Long to Wide to create dummy variablesI currently have data that looks like this: a X 0 a Y 0 a Y 1 b X 0 b Y 0 b Z 1 c X 1 c Y 1 c Z 0 …
Aggregating individual-level data to studysite-level dataDear all, I am still very new to Stata and would need your help with the following: I am currently …
Difference-in-difference model with continuous treatment levelsHi all, For my master thesis I have to calculate the effect of CSR investment on various performanc…
Subscribe to:
Post Comments (Atom)
0 Response to Reshape long to wide
Post a Comment