Announcement

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

  • Coefficients plot

    I want to plot regression coefficients using variables tot, newYCC and TM8. newYCC contains numbers from 1 to 7, representing the different time and TM8 is a dummy which represents the time different from 1 to 7. I want to use the second variable coefficient as yline in order to compare how the variable tot behaves during newYCC and TM8.
    I've been using the command below but it actually doesn't work to plot the second's variable coefficient. These commands works just if I leave the second regression out.

    quietly reg tot i.newYCC , nocons
    quietly eststo c1: margins,at(newYCC=(1 2 3 4 5 6 7)) post

    quietly reg totdev TM8 , nocons
    quietly eststo c2: margins,at(TM8=(1)) post

    coefplot c1 c2 , vertical yline(`a')recast(line) title("Terms of trade") lwidth(*2) ciopts(recast(rline) lpattern(dash))xlabel(1 "t-3" 2 "t-2" 3 "t-1" 4 "t" 5 "t+1" 6 "t+2" 7 "t+3")


    input float year double tot float newYCC byte TM8
    1974 103.132 . 1
    1975 100.262 . 1
    1976 99.2711 1 0
    1977 99.5796 2 0
    1978 100.738 3 0
    1979 100.646 4 0
    1980 96.1591 5 0
    1981 91.7276 3 0
    1982 92.5663 4 0
    1983 91.1926 4 0
    1984 91.6308 4 0
    1985 92.9575 4 0
    1986 96.9068 5 0
    1987 97.8541 4 0
    1988 98.7667 5 0
    1989 97.7916 4 0
    1990 98.0709 5 0
    1991 98.2167 6 0
    1992 100.408 7 0
    1993 102.646 . 1
    1994 101.052 . 1
    1995 100 . 1
    1996 99.4396 . 1
    1997 98.5263 . 1
    1998 99.7306 . 1
    1999 98.92 . 1
    2000 96.5638 . 1
    2001 96.5245 . 1
    2002 97.7203 . 1
    2003 97.8623 . 1
    end







  • #2
    First, never use quietly when you're debugging. Running without quietly, you'll see that your second margins command is only giving you one value. No wonder it doesn't plot.

    Comment

    Working...
    X