Dear Statalisty,

I am really struggling with generating graphs in Stata.
For the dataset below (which in complete consists of many years) I need the mean for total_dir, typI, typL, typE and n_indep per year as a vertical bar chart.

As in each line total_dir is the sum of typI, -L and -E, it would be nice if there are all are in one bar per year separated by color.

Does anyone have an idea? Thanks!


Code:
clear
input float year long permno double didown float(total_dir typI typL typE n_indep)
1996 10016  4337000  8 3 2 3 3
1996 10035 20143600  6 2 3 1 2
1996 10048  3367000  9 3 1 5 3
1996 10062 20128400 11 1 9 1 1
1996 10064 20155100 11 3 5 3 3
1996 10071 20001800  9 6 0 3 6
1996 10078     2426  7 5 1 1 5
1996 10104     6038  6 2 1 3 2
1996 10107  3362600  8 5 2 1 5
1996 10108     1459  8 5 2 1 5
end