- //Predictive margins with 95% confidence interval - using margins
- /*Requires: parmest
- to download this program type the following on the Stata command
- line (if not already loaded):*/
- ssc install parmest
- sysuse auto, clear
- gen kprice=price/1000
- regress mpg c.kprice##c.kprice i.foreign i.rep78 turn trunk headroom
- margins, at(kprice=(3/15)) vsquish post
- return list
- ereturn list
- parmest, norestore //saves parameters
- l
- gen kprice=3 + _n - 1
- l
- label var kprice "Price(\$1000)"
- twoway ///
- (rarea max95 min95 kprice, pstyle(ci)) ///
- (line estimate kprice), ///
- ytitle(Miles per gallon) ///
- title(Predictive margins with 95% confidence interval) ///
- xlabel(3(3)15 10.4) legend(off)


雷达卡
京公网安备 11010802022788号







