hi everybody,
I have difficulties to create a line graph with averages from different observations. On the y axis I have 10 different variables with a each different scale and I on the x axis I have one variable which can have the values 1, 2, 3, 4 and 5
Now I have many observations y with a given x. I dont wont to have a scatter graph or a lfit line but I would like to generate a graph who shows the average of the different Levels for the x variable and combines These lines.
I would like to have a graph who shows These Points (mean(yvariable1) if |xvariable=1) next Point (mean(yvariable2)|xvariable=1); (mean(yvariable2|xvariable=2) etc.
example: graph twoway line mean(yvariable1) xvariable if (...) || line mean (yvariable 2) xvariable if (...)
unfortunately gen newvar = mean(oldvar) does not work and exist
egen also does not help me because I cannot replace with mean(var) the variable I created with the fucntion egen
I would really be pleased if someone could help me.
Thanks in advance
Thomas
I have difficulties to create a line graph with averages from different observations. On the y axis I have 10 different variables with a each different scale and I on the x axis I have one variable which can have the values 1, 2, 3, 4 and 5
Now I have many observations y with a given x. I dont wont to have a scatter graph or a lfit line but I would like to generate a graph who shows the average of the different Levels for the x variable and combines These lines.
I would like to have a graph who shows These Points (mean(yvariable1) if |xvariable=1) next Point (mean(yvariable2)|xvariable=1); (mean(yvariable2|xvariable=2) etc.
example: graph twoway line mean(yvariable1) xvariable if (...) || line mean (yvariable 2) xvariable if (...)
unfortunately gen newvar = mean(oldvar) does not work and exist
egen also does not help me because I cannot replace with mean(var) the variable I created with the fucntion egen
I would really be pleased if someone could help me.
Thanks in advance
Thomas
Comment