Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error: too many values

    Hey,
    I want to do the chi squared test with my variables in my data set.
    but if I command: "tabulate COMP_STD ROIC, chi2"
    stata can't calculate because there are too many values. I don't have that much of observations and I don't know how to fix this problem. COMP_STD is a float variable and ROIC a double.

    thanks for your help!

  • #2
    Giulia:
    have you already checked the absence of spaces before and/or after the inderscore in "COMP_STD"?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Stata is not telling you that you have too many observations, but rather than one or both of your variables takes too many different values making the resulting tabulation have too many rows or columns.

      Perhaps if you run
      Code:
      codebook COMP_STD ROIC
      and copy the output from Stata's results window and paste it into a reply post, Statalist can tell you if your hope of using tabulate is reasonable.

      To assure we can easily read the results that you post, please copy them from the Results window or your log file into a code block in the Forum editor, as explained in section 12 of the Statalist FAQ linked to at the top of the page. For example, the following:

      [code]
      . sysuse auto, clear
      (1978 Automobile Data)

      . describe make price

      storage display value
      variable name type format label variable label
      -----------------------------------------------------------------
      make str18 %-18s Make and Model
      price int %8.0gc Price
      [/code]

      will be presented in the post as the much more readable:
      Code:
      . sysuse auto, clear
      (1978 Automobile Data)
      
      . describe make price
      
                    storage   display    value
      variable name   type    format     label      variable label
      -----------------------------------------------------------------
      make            str18   %-18s                 Make and Model
      price           int     %8.0gc                Price

      Comment


      • #4
        you don't say what "flavor" of Stata you have but it matters; looking at "help limits" we see that a two way table using Stata/IC has a limit of 300 rows by 20 columns while using either Stata/SE or Stata/MP, the limits are 1,200 rows by 80 columns; the issue here may relate to the number of distinct values in ROIC (which is the column variable); you can use a number of different Stata commands to see how many distinct values each variable has, including -codebook- and -inspect- as well as user-written routines such as -unique- and -distinct- (use -search- to find and download these)

        added - crossed with #3

        Comment


        • #5
          I'm a student so I have the student's version. I know, that there are limits, but I don't know how to fix this problem as I need the chi tabulate :/
          this is the output for the command codebook:

          Code:
              
          COMP_STD        Gesamtvergütung pro Kopf normiert über Erbrachte Mannmonate
                  
          
              type:    numeric (float)
          
              range:    [4.6511407,8.4876633]        units:  1.000e-07
              unique values:    351                      missing .:  4/360
          
              mean:    6.79955
              std. dev:    .840614
          
              percentiles:    10%       25%       50%       75%       90%
                                5.74975   6.14657   6.81449   7.46823   7.92814
          
                  
          ROIC        Return on Investment - operative Unternehmensperformance
                  
          
              type:    numeric (double)
          
              range:    [-150.34,146.95]             units:  .01
              unique values:    341                      missing .:  0/360
          
              mean:    9.82992
              std. dev:    29.1947
          
              percentiles:    10%       25%       50%       75%       90%
                                 10.98      5.49     13.37     20.42     27.73
          thanks for your help!
          Last edited by Giulia Wa; 07 Sep 2017, 09:27.

          Comment


          • #6
            how about a graph instead? the only way that I can see to get a table is to collapse your values into categories; if you want to go that route, see
            Code:
            help recode

            Comment


            • #7
              Let me point out that you have 356 observations where neither value is missing. And in those 356 observations, you have 351 distinct values of your row variable and 341 distinct values of your column variable. The tabulation will have 351*341 = 119,691 cells of which at most 356 will be non-zero, and most or all of those will be 1.

              Without collapsing your data into fewer categories, using tabulate to produce a chi-square test on these data will not produce useful results.

              Comment


              • #8
                okay thanks for your help

                Comment

                Working...
                X