Hi all, sorry for my 3rd reshape/xpose question of late, but I have a new (though similar) issue that I can't seem to solve.
Essentially I want to tuck the SEs underneath the means in a new row, for each var, so it would produce a data frame where there's just 4 columns: "var", "all", "most", "never", and then each var has the mean and the SE in consecutive rows. Is it possible to basically just reshape only on the "se_" columns here?
I tried:
But that doesn't get quite what I want--it keeps one se column while creating new rows per each vble.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str10 var double(b_all se_all b_most se_most b_never se_never) "white" .3 .02 .43 .02 .52 .02 "black" .43 .03 .35 .03 .25 .02 "hisp" .11 .02 .09 .02 .1 .01 "age" 14.3 .56 14.8 .5 15 .54 "female" .5 .01 .5 .01 .52 .01 "test_score" 56.7 2.2 58 2.4 48 2.4 end
Essentially I want to tuck the SEs underneath the means in a new row, for each var, so it would produce a data frame where there's just 4 columns: "var", "all", "most", "never", and then each var has the mean and the SE in consecutive rows. Is it possible to basically just reshape only on the "se_" columns here?
I tried:
Code:
reshape long se_, i(var) j(vble) string
Comment