Announcement

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

  • xtline does not work

    Hello,

    I have an unbalanced data set of around 250,000 observations that means I have annual data of all listed North American companies from 1990-2015 on Dividends, Interest Rates, Cash, Long Term Debt, and so on. So I have a cross-section time-series data set.

    Now I wanted to make a xtline for Cash/GDP ratio over the period 1990-2015. But that does not work.

    I inserted following code, and the response was:

    . xtline Cash_GDP, overlay
    "macro substitution results in line that is too long
    The line resulting from substituting macros would be longer than allowed. The
    maximum allowed length is 645,216 characters, which is calculated on the basis
    of set maxvar.

    You can change that in Stata/SE and Stata/MP. What follows is relevant only if
    you are using Stata/SE or Stata/MP.

    The maximum line length is defined as 16 more than the maximum macro length,
    which is currently 645,200 characters. Each unit increase in set maxvar
    increases the length maximums by 129. The maximum value of set maxvar is
    32,767. Thus, the maximum line length may be set up to 4,227,159 characters if
    you set maxvar to its largest value."

    What can I do in this case? Please help?!

    Kind Regards,
    Diana

  • #2
    have you already xtset your data? if no, you must use the "i" and "t" options

    Comment


    • #3
      How many panels are you trying to plot? Very likely a scatter plot will be just as intelligible.

      Note that even with ~10 panels, the result is usually just spaghetti. Compare

      Code:
      webuse grunfeld
      xtline invest, overlay

      Comment


      • #4
        Mr Goldstein: Sorry but what are the "i" and "t" options? Yes I have xtset the data.
        Mr Cox: I want just one line for all companies, i.e. a cumulated line for a specific year in that case 1990-2015. Is there a special code for that?

        Comment


        • #5
          ahh ok "i" and "t" options are i(panelvar) and t(timevar) options. Yes I have xtset the data accordingly.

          Comment


          • #6
            First names are fine by Rich and me; otherwise you strip us of our hard-earned doctorates.

            More seriously, I don't understand what that means, so you may need to give an example if no one else chips in while I am at the dentist.

            Comment


            • #7
              Nick good luck at the dentist. I try to explain better: I want to show through a line graph on the x-axis the time (1990-2015) and on the y-axis the "Cash/GDP ratio". But as this is a cross-sectional time-series data set it will not work because I have multiple companies per year. Therefore I am searching for another code which enables my intention.

              Comment


              • #8
                Sorry, but this is no clearer to me. But if you want some kind of summary across companies it is possible that you need a prior collapse.

                Comment


                • #9
                  Thank you very much. With collapse it worked out.

                  Comment

                  Working...
                  X