![]() ![]() ![]() It seems that the following works, but would also be a lot more time-consuming for my data. Using multiple statistical outcomes from one collapse can make keeping track of statistic output. Is there a solution that avoids an additional by operation? Get to know Statas collapse commandits your new friend. If I use (first), then the first error clears, but (count) still fails. collapse (firstnm) name (count) random, by(mark) Without seeing the structure of your data, it is hard to say but it sounds to me like you wouldn't even need to issue both sets of collapse commands since your data will be collapsed by the same variables each time and you are calculating the same statistics for Complete and allm. replace mark = mark if missing(mark)īut my collapses fail with type mismatch errors. I want to collapse on "mark", which is simple enough with replace and subscripts. I have a data set with a lot of strings that I want to collapse, but it seems that in general collapse doesn't place nicely with strings, particularly (firstnm) and (count). I'm just being lazy here (I don't know how to generate random letters). For example, if you want to use the collapse command, which replaces the dataset. Fortunately, Stata develops labels for each variable providing details on which statistic occurred from a collapse. Unfortunately, not many existing commands fully optimize these new abilities. It isn't necessarily the case that the string variable is destringable. Using multiple statistical outcomes from one collapse can make keeping track of statistic output somewhat difficult by looking at the variable name alone. Edit: I should have generated better data. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |