Announcement

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

  • graph fractions

    Hi all,

    I hope one of you guys can help me out because i am very very new to stata.
    We have time series data ranging from 1990 to 2013.
    We have for different companies and years the ratios Debt/Total Assets.
    I now want to make a graph of the fraction of the full sample that has a ratio>0.4 for every year and the fraction that has a ratio of 0 for each year.
    But i have really no idea how to do this.

    Thanks in advance
    Stata Failure

  • #2
    "stata failure": We do ask for full real names here please. See http://www.statalist.org/forums/help#realnames

    As I understand it: Your classification is like this:

    Code:
    gen class = 2 
    bysort company (ratio) : replace class = 1 if ratio[1] == 0 & ratio[_N] == 0 
    by company: replace class = 3 if ratio[1] > 0.4 
    label def class 1 "always 0" 2 "others" 3 "always >0.4" 
    label val class class 
    egen tag = tag(company) 
    histogram class if tag, discrete xla(1/3, valuelabel) frequency barw(0.8)
    The logic is this: The classification is 1 if every ratio is 0. For that it is sufficient that, once sorted, the first and the last values are 0.
    The classification is 3 is every ratio is above 0.4. For that it is sufficient that, once sorted, the first value is > 0.4.
    You don't mention other companies but presumably they are in the middle.

    In a graph, you need to count companies, not observations.

    This is untested code, as I can't see your data and you didn't give an example. I neglect the possibility that ratios can be negative or missing.

    Comment


    • #3
      Nick thank you for your reply ... i'll try to apply it.

      Comment

      Working...
      X