Please see the attached data. I want to make a graph that has year on the x axis and %of ivf use on the y axis and the two lines to show the use with phi_bin. So essentially I want the graph to have two lines one for if phi_bin==1 and the other one for phi_bin=0.

I am using the following code provided by Nick Cox in a previous message :
egen toshow = mean(ivf), by(year phi_bin)
separate toshow, by(phi_bin) veryshortlabel
line toshow? year , ytitle(% of IVF users)

but it is not producing what I want, I only want two lines and not multiple as the code is doing. Any help is appreciated thanks!!

dataex year id ivf phi_bin
clear
input byte year double id float(ivf phi_bin)
4 700002 0 1
5 700002 0 1
7 700002 0 1
8 700002 0 1
4 700004 0 0
7 700004 0 1
4 700006 0 1
5 700006 0 0
6 700006 0 0
7 700006 0 0
8 700006 0 0
4 700007 0 1
5 700007 0 1
6 700007 0 1
7 700007 0 1
8 700007 0 1
6 700008 0 0
4 700009 0 0
6 700009 0 0
7 700009 0 1
8 700009 1 1
4 700010 0 0
7 700010 0 1
8 700010 0 1
4 700011 0 0
5 700011 0 0
6 700011 0 0
7 700011 0 1
8 700011 0 1
4 700012 0 0
5 700012 0 0
6 700012 0 0
8 700012 0 0
4 700016 0 1
5 700016 0 1
6 700016 0 1
7 700016 0 1
8 700016 0 1
4 700017 0 1
5 700017 0 0
6 700017 0 1
7 700017 0 1
4 700020 0 0
4 700022 0 1
5 700022 1 1
6 700022 1 1
7 700022 0 1
8 700022 0 1
4 700023 1 1
5 700023 0 1
6 700023 1 1
8 700023 . .
4 700024 0 0
6 700024 0 1
7 700024 0 1
8 700024 0 1
4 700025 0 0
5 700025 0 0
6 700025 0 0
7 700025 0 0
8 700025 0 0
4 700026 0 0
5 700026 0 0
6 700026 0 1
7 700026 0 1
4 700027 0 1
5 700027 0 1
6 700027 0 1
7 700027 0 1
8 700027 1 1
4 700030 0 1
5 700030 0 1
6 700030 0 1
7 700030 0 1
8 700030 0 1
4 700031 0 0
4 700032 0 1
6 700032 0 1
7 700032 0 1
8 700032 0 1
4 700033 0 0
4 700034 . 1
5 700034 0 1
6 700034 0 1
7 700034 0 1
8 700034 0 1
4 700037 0 1
5 700037 0 1
6 700037 0 1
7 700037 0 1
8 700037 0 1
4 700038 0 0
5 700038 0 1
6 700038 0 1
8 700038 . .
4 700039 0 1
5 700039 1 1
7 700039 1 1
4 700040 0 1
5 700040 0 0
end
label values ivf a
label def a 0 "IVF Non-User", modify
label def a 1 "IVF User", modify
[/CODE]


Thanks!