Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: too many values for -tabulate twoway, summarize-, but not -tabulate twoway-


From   László Sándor <sandorl@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: too many values for -tabulate twoway, summarize-, but not -tabulate twoway-
Date   Wed, 4 Apr 2012 12:25:45 -0400

Hi,

I am still fiddling around with -tab, sum()- (using Stata MP 12.1 for
mac). I encountered some curious behavior that I could not track down.

This works without an error:
tab x by [aw=w]

While this gives me r(134):
tab x by [aw=w], sum(y)

Why should there be a difference? Are these limits documented somewhere?

FWIW, at the end I paste how I generated data for my particular test run.

Thanks,

Laszlo

For reference, here is the help on this error:

[P]     error . . . . . . . . . . . . . . . . . . . . . . . .  Return code 134
        too many values;
        1) You attempted to encode a string variable that takes on
        more than 65,536 unique values.  2) You attempted to tabulate
        a variable or pair of variables that take on too many values.
        If you specified two variables, try interchanging them.
        3) You issued a graph command using the by option.  The
        by-variable takes on too many different values to construct
        a readable chart.


set obs 1000
set seed 19821009
g y = rnormal()
g y2 = rnormal()
g by = y2 > 0.5
g w = runiform()
g x = runiform()
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index