Hello,
an easy one for you I guess, but I got stuck:
I would like to calculate the difference between two variables by year and group and then display the difference as a line with 95% confidence interval.
I tried around with, but probably I miss something...
[CODE]bysort year (group) : gen difference = var1 - var2
What I have as data: I have several individuals (either male or female) and data for several years (panel data), two relevant variables in this context (Var1 = yearly mean of income of all male individuals; Var2 = yearly mean of income of all female individuals). Now I would like to calculate the difference between the yearly means. For each observation I have either a value for Var1 or Var2, thats why I cannot just use gen difference = var1 - var2
I would like to display the difference as a line (twoway line difference year) and would like to show the 95% confidence interval as well.
Could you help me out please? Thank you.
an easy one for you I guess, but I got stuck:
I would like to calculate the difference between two variables by year and group and then display the difference as a line with 95% confidence interval.
I tried around with, but probably I miss something...
[CODE]bysort year (group) : gen difference = var1 - var2
What I have as data: I have several individuals (either male or female) and data for several years (panel data), two relevant variables in this context (Var1 = yearly mean of income of all male individuals; Var2 = yearly mean of income of all female individuals). Now I would like to calculate the difference between the yearly means. For each observation I have either a value for Var1 or Var2, thats why I cannot just use gen difference = var1 - var2
I would like to display the difference as a line (twoway line difference year) and would like to show the 95% confidence interval as well.
Could you help me out please? Thank you.
Comment