|
Examples
-----------------------------------------------------------------------------------------------
Setup
. sysuse auto
. regress mpg weight c.weight#c.weight foreign
Obtain predicted values
. predict pmpg
. summarize pmpg mpg
-----------------------------------------------------------------------------------------------
Setup
. webuse newautos, clear
Obtain out-of-sample prediction
. predict mpg
Obtain standard error of the forecast
. predict se_mpg, stdf
-----------------------------------------------------------------------------------------------
Setup
. sysuse auto, clear
. regress price weight foreign##c.mpg
Residual-versus-fitted plot
. rvfplot, yline(10)
Added-variable plot
. avplot mpg
Added-variable plots for every regressor
. avplots
-----------------------------------------------------------------------------------------------
Setup
. webuse auto1
. regress price mpg weight
Component-plus-residual plot
. cprplot mpg, mspline msopts(bands(13))
Augmented component-plus-residual plot
. acprplot mpg, mspline msopts(bands(13))
Residual-versus-predictor plot
. rvpplot mpg, yline(0)
-----------------------------------------------------------------------------------------------
Setup
. sysuse auto
. regress mpg weight c.weight#c.weight foreign
Diagonal elements of projection matrix
. predict xdist, hat
-----------------------------------------------------------------------------------------------
Setup
. sysuse auto, clear
. regress price weight foreign##c.mpg
Leverage-versus-residual-squared plot
. lvr2plot
Standardized residuals
. predict esta if e(sample), rstandard
Studentized residuals
. predict estu if e(sample), rstudent
-----------------------------------------------------------------------------------------------
Setup
. sysuse auto, clear
. regress price weight foreign##c.mpg
DFITS influence measure
. predict dfits, dfits
Cook's distance
. predict cooksd if e(sample), cooksd
Welsch distance
. predict wd, welsch
COVRATIO influence measure
. predict covr, covratio
DFBETAs influence measure
. sort foreign make
. predict dfor, dfbeta(1.foreign)
DFBETAs for all variables in regression
. dfbeta
Ramsey's test for omitted variables
. estat ovtest
Test for heteroskedasticity
. estat hettest
. estat hettest weight foreign##c.mpg, mtest(b)
Rank test for heteroskedasticity
. estat szroeter, rhs mtest(holm)
Tests for heteroskedasticity, skewness, and kurtosis
. estat imtest
-----------------------------------------------------------------------------------------------
Setup
. webuse bodyfat, clear
. regress bodyfat tricep thigh midarm
Variance inflation factors
. estat vif
-----------------------------------------------------------------------------------------------
Setup
. webuse nhanes2
Regress systolic blood pressure on age group, sex, and their interaction
. regress bpsystol agegrp##sex
Predictive margins of blood pressure for age groups
. margins agegrp
Profile plot of margins
. marginsplot
Margins for interaction between age group and sex
. margins agegrp#sex
Interaction plot
. marginsplot
Estimate for each age group a contrast comparing men and women
. margins r.sex@agegrp
Plot contrasts and confidence intervals against age group
. marginsplot
|