Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[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 <[email protected]>
To   [email protected]
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index