Hello,
I think I'm being a little dumb here. If you load the attached file and run the following code:
... then the third and eigth observation of I_MORT should not be connected, right? But when I run it, they always are. What am I doing wrong? 
Running the following example I've found on the internet works just fine, but I can't find the difference to my data or code.
I think I'm being a little dumb here. If you load the attached file and run the following code:
Code:
clear
cd " "
use irdata
tsset DATE_MONTH
twoway (line I_NFC I_MORT I_OTH DATE_MONTH , cmissing(n)) /*
*/ (line I_CONS DATE_MONTH, yaxis(2) cmissing(n)) /*
*/ , xline(657) xtitle("") ytitle("", axis(2)) yscale(range(4.8 8.2) axis(2)) yscale(range(.8 4.2)) ylabel(5(1)8, axis(2))

Running the following example I've found on the internet works just fine, but I can't find the difference to my data or code.
Code:
clear
set obs 60
//Generating date variable
local i = 0
local cmd generate
forvalues month = 1/12{
forvalues year = 2011(1)2015{
`cmd' datestr = "1/`month'/`year'" in `=`++i''
local cmd replace
}
}
generate date = date(datestr, "DMY")
format date %d
//Sorting on date
sort date
//Generating 'ratio' variable
gen Ratio = rbeta(3,0.5)
//Making some observations missing
forvalues i = 1(9)60{
replace date = . in `i'
}
//Generating a treatment indicator
gen treated = mod(_n,2)
//Plotting
twoway (line Ratio date if treated==1, cmissing(n)) (line Ratio date if treated==0, cmissing(n))
, ///
ysc(r(0 1)) ylab(0(0.2)1, format(%9.1f)) xtitle("") xlab(, format(%tddd/nn/YY)) ///
legend(pos(6) ring(1) col(2) lab(1 "Treatment") lab(2 "Control") size(3) region(c(none)))

Comment