reg y x //y对x回归
replace x=x+6 if _n>=50 //对后面50个观测值每个加6
predict yhat //预测y
predict yhat_se, stdp //生成SE
gen ci_low=yhat-invt(df,p) //生成95%CI的下限,其中df是n-K,n个观测值,K个变量,p=0.975
gen ci_hig=yhat+invt(df,p)
sort x
twoway(scatter yhat x)(line ci_low ci_hig x) //绘制图像