I am trying to plot net transfers by groups in € (y-axis) against age (x-axis) in one graph
I defined the variables where anhhgba represents the monetary annual sum for each household, then I sorted them as follows according to age and group to get the annual average:
Code:
bysort age group: egen grouphhgba_mean = mean(anhhgba) twoway (line grouphhgba_mean age [aw=hhrf], sort), by(group)
In general, is line graph the best way to plot this or would you suggest another better way?
Regarding the weights, I tried applying different weights (aw, pw, none) all give the same result and the same graph. I searched and it seems that weights will not change the graph unless some step is made beforehand, the post however did not explain much how this could be done. Which weights should fit into this? And how to get a weighted graph in the end? (I can shift to any other graph type not necessarily a line graph)
For some suggestions I would be grateful!
0 Response to Sample weights to twoway line graph
Post a Comment