clear set obs 1000 range xvar -3.3 3.3 1000 gen yvar = (1/sqrt(2*_pi))* exp(-(xvar^2/2)) two (fun y=(1/sqrt(2*_pi))* exp(-(x^2/2)), range(-3 3)) /// (area yvar xvar if xvar<=-1.96, color(red)) (area yvar xvar if xvar>=1.96, color(red)) /// (fun y=0, range(0 0.4) hor lp(dash) lc(gs5)) /// , name(p2, replace) legend(off) /// xlab(-1.96 0 1.96) xtitle("") /// text(0.015 -2.2 "2.5%", size(small)) text(0.015 2.2 "2.5%", size(small)) /// title("Standard normal distribution")