I would like to efficiently convert the following data:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str20 name byte(knowsA knowsB freqA freqB lengthA lengthB) "A" 0 1 . 2 . 10 "B" 1 0 4 . 9 . end
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str20(source target) byte(knows freq length) "A" "A" 0 . . "A" "B" 1 2 10 "B" "A" 1 4 9 "B" "B" 0 . . end
This way of formatting variables is not satisfactory because, as you may guess, I have many more individuals which also means many more variables. Instead, I would like to have a dataset of n*n observations with all the combinations of individuals being displayed. However, I am unsure whether this problem requires a reshape long command, because I don't understand what I am supposed to write as a _j variable. I also get the following error message:
. reshape long freq length knows, i(name) j(s)
variable s contains all missing values
Did I miss something obvious or does this case require another command? Thanks a lot for your help.
0 Response to Does this situation require a reshape long, or something different?
Post a Comment