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]

Re: st: alternative calculation method due to "too many values" / tabulate


From   Oliver Jones <ojones@wiwi.uni-bielefeld.de>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: alternative calculation method due to "too many values" / tabulate
Date   Fri, 02 Mar 2012 16:09:48 +0100

Hi Martin

1.
It would be helpful if you could tell us why you want to -tabulate- a variable with more than 200 000 different values.

2.
The output you pasted into your message looks horrible. I don't know if it is a problem of the email program you use, or the way how it is processed by the Statalist, or if it looked horrible on your screen. If it looked horrible on your screen try to make it look nice, mybe like this:

Var1 has 220 thousand different values.
Var2 has 3 different values, namely "a", "b", and "c".

I want to create a table like this:

      |    Var2   |
Var1  |  a  b  c  | Total
------+-----------+------
0     |  2  0  9  | 11
1     |  8  7  1  | 16
.     |           |
.     |           |
.     |           |

My Problem:
I typed -tabulate Var1 Var2- and received the error message "too many values".

Best
Oliver


Am 02.03.2012 15:05, schrieb Martin:
Dear stata cumunity,

I would like to calculate the values which I have in my table in this form:

FSHNETCSP3      luse_csp              count
0               10                      500
0             1010                      124
1               10                      500
2             1010                      240
2               10                      120
3             1010                      130
3               10                      120
4               10                      101
…...

To receive the following result:

            |                                       luse_csp
FSHNETCSP3 |         0          1          2          3          4
5         10       1000 |     Total
-----------+----------------------------------------------------------------
------------------------+----------
          0 |         0          9          0          0          5
0        327          3 |       344
          1 |         0          0          0          0          0
0        315          0 |       315
          2 |         0          5          0          0          0
0        321          5 |       331
          3 |         0          0          0          0          0
0        439          1 |       440
          4 |         0          0          0          0          0
0        412          8 |       420
          5 |         1          2          3          0          0
0        440          0 |       446
          6 |         0          0          0          0          0
0        413          7 |       420
….....

I used the following command:
. tabulate FSHNETCSP3  luse_csp [fweight =  count] in 1/1000

However, because I have 220.000 different FSHNETCSP3 values I get the error
“too many values”. I tried the “bigtab” command from the list, but there I
can`t add a weight. I don`t want to use collapse because I need the exact
values for further calculations.

Can someone help? This is my first post so just say if the form of this mail
isn´t good. I am a beginner.


Thank you very much and best regards,
Martin



*
*   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/
*
*   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