Example: stock market

Estimation and postestimation commands - Stata

20 Estimation and postestimation Estimation commands work the same prior Estimation Estimation the Estimation the width of confidence the coefficient the variance covariance Obtaining predicted Using Making in-sample Making out-of-sample Obtaining standard errors, tests, and confidence intervals for Accessing estimated Performing hypothesis tests on the Linear Using Likelihood-ratio Nonlinear Wald Obtaining linear combinations of Obtaining nonlinear combinations of Obtaining marginal means, adjusted predictions, and predictive Obtaining estimated marginal Obtaining adjusted Obtaining predictive Obtaining conditional and average marginal Obtaining conditional marginal Obtaining average marginal Obtaining pairwise Obtaining contrasts, tests of interactions, and main Graphing margins, marginal effects, and Dynamic forecasts and Obtaining robust variance Interpreting standard Correlated errors: cluster robust standard Obtaining Weighted Frequency Analytic Sampling Importance A list of postestimation References12 [ U ] 20 Estimation and postestimation All Estimation commands work the same wayAll Stata com

1. You can use the standard features of Stata’s syntax— if exp and in range—to specify the estimation subsample; you do not have to make a special dataset. 2. You can retype the estimation command without arguments to redisplay the most recent estimation results. For instance, after fitting a model with regress, you can see the estimates ...

Tags:

  Estimation, The estimation

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Estimation and postestimation commands - Stata

1 20 Estimation and postestimation Estimation commands work the same prior Estimation Estimation the Estimation the width of confidence the coefficient the variance covariance Obtaining predicted Using Making in-sample Making out-of-sample Obtaining standard errors, tests, and confidence intervals for Accessing estimated Performing hypothesis tests on the Linear Using Likelihood-ratio Nonlinear Wald Obtaining linear combinations of Obtaining nonlinear combinations of Obtaining marginal means, adjusted predictions, and predictive Obtaining estimated marginal Obtaining adjusted Obtaining predictive Obtaining conditional and average marginal Obtaining conditional marginal Obtaining average marginal Obtaining pairwise Obtaining contrasts, tests of interactions, and main Graphing margins, marginal effects, and Dynamic forecasts and Obtaining robust variance Interpreting standard Correlated errors: cluster robust standard Obtaining Weighted Frequency Analytic Sampling Importance A list of postestimation References12 [ U ] 20 Estimation and postestimation All Estimation commands work the same wayAll Stata commands that fit statistical models commands such asregress,logit,sureg, andso on work the same way.

2 Most single-equation Estimation commands have the syntaxcommand varlist[if] [in] [weight] [,options]and most multiple-equation Estimation commands have the syntaxcommand(varlist) (varlist)..(varlist)[if] [in] [weight] [,options]Adopt a loose definition of single and multiple equation in interpreting this. For instance,heckmanis atwo-equation system, mathematically speaking, yet we categorize it, syntactically, with single-equationcommands because most researchers think of it as a linear regression with an adjustment for thecensoring. The important thing is that most Estimation commands have one or the other of these single-equation commands , the first variable in thevarlistis the dependent variable, and theremaining variables are the independent variables, with some exceptions. For instance,mixedallowsspecial variable prefixes to identify random commands may be specified in front of an Estimation command to modify what it syntax the prefix commands arePrefix commandDescriptionManual entrybyrepeat command on subsets of data[D]bystatsbycollect results across subsets of data[D]statsbyrollingtime-series rolling Estimation [TS]rolling*svyestimation for complex survey data[SVY]svy*mi estimatemultiply imputed data and multiple imputation[MI]mi estimate*nestregnested model statistics[R]nestreg*stepwisestepwise Estimation [R]stepwise*xiinteraction expansion[R]xi*fpfractional polynomials[R]fp*mfpmultiple fractional polynomials[R]mfp*Available for some but not all Estimation commandsTwo other prefix commands bootstrapandjackknife also work with Estimation commands see [R]bootstrapand [R]

3 Jackknife but usually it is easier to specify the Estimation -commandoptionvce(bootstrap)or vce(jackknife).Also, all Estimation commands whether single or multiple equation share the following features:1. You can use the standard features of Stata s syntax ifexpandinrange to specify theestimation subsample; you do not have to make a special You can retype the Estimation command without arguments to redisplay the most recent estimationresults. For instance, after fitting a model withregress, you can see the estimates again bytypingregressby itself. You do not have to do this immediately any number of commandscan occur between the Estimation and the replaying, and, in fact, you can even replay the lastestimates after the data have changed or you have dropped the data altogether. Stata neverforgets (unless you typediscard; see [P]discard).

4 [ U ] 20 Estimation and postestimation commands 33. You can specify thelevel()option at the time of Estimation , or when you redisplay resultsif that makes sense, to specify the width of the confidence intervals for the coefficients. Thedefault islevel(95), meaning 95% confidence intervals. You can reset the default withsetlevel; see [R] You can use the postestimation commandmarginsto display model results in terms of marginaleffects (dy/dxor evendf(y)/dx), which can be displayed as either derivatives or elasticities;see [R] You can use the postestimation commandmarginsto obtain tables of estimated marginalmeans, adjusted predictions, and predictive margins; see[U] Obtaining conditional andaverage marginal effectsand see [R] You can use the postestimation commandpwcompareto obtain pairwise comparisons across levelsof factor variables.

5 You can compare estimated cell means, marginal means, intercepts, marginalintercepts, slopes, or marginal slopes collectively called margins. See[U] Obtainingpairwise comparisons, [R]margins, and [R]margins, You can use the postestimation commandcontrastto obtain contrasts, which is to say,to compare levels of factor variables and their interactions. This command can also produceANOVA-style tests of main effects, interactions effects, simple effects, and nested effects; andit can be used after most Estimation commands . See[U] Obtaining contrasts, tests ofinteractions, and main effects, [R]contrast, and [R]margins, You can use the postestimation commandmarginsplotto graph any of the results producedbymargins, and becausemarginscan replicate any result produced bypwcompareandcontrast, you can graph any result produced by them, too.

6 See [R] You can use the postestimation commandestatto obtain common statistics associated with themodel. Which statistics are available are documented in the postestimation section followingthe documentation of the Estimation command, for instance, in [R]regress postestimationfollowing [R] can always use the postestimation commandestat vceto obtain the variance covariancematrix of the estimators (VCE), presented as either a correlation matrix or a covariance matrix.(You can also obtain the estimated coefficients and covariance matrix as vectors and matricesand manipulate them with Stata s matrix capabilities; see[U] Accessing matrices createdby Stata commands .)10. You can use the postestimation commandpredictto obtain predictions, residuals, influencestatistics, and the like, either for the data on which you just estimated or for some other can use postestimation commandpredictnlto obtain point estimates, standard errors,etc.

7 , for customized predictions. See [R]predictand [R] You can use the postestimation commandforecastto perform dynamic and static forecasts,with optional forecast confidence intervals. This includes the ability to produce forecasts frommultiple Estimation commands , even when estimates imply simultaneous systems. An exampleof a simultaneous system is wheny2predictsy1in Estimation 1 andy1predictsy2inestimation many facilities for creating comparative forecast [TS] You can refer to the values of coefficients and standard errors in expressions (such as withgenerate) by using standard notation; see[U] Accessing coefficients and standarderrors. You can refer in expressions to the values of other Estimation -related statistics by usinge(resultname). For instance, all commands definee(N)recording the number of observationsin the Estimation subsample.

8 After Estimation , typeereturn listto see a list of all that is4 [ U ] 20 Estimation and postestimation commandsavailable. See theStored resultssection in the Estimation command s documentation for especially usefule()result ise(sample): it returns 1 if an observation was used in theestimation and 0 otherwise, so you can addif e(sample)to the end of other commandsto restrict them to the Estimation subsample. You could type, for instance,summarize ife(sample).13. You can use the postestimation commandtestto perform tests on the estimated parameters(Wald tests of linear hypotheses),testnlto perform Wald tests of nonlinear hypotheses, andlrtestto perform likelihood-ratio tests. You can use the postestimation commandlincomto obtain point estimates and confidence intervals for linear combinations of the estimatedparameters and the postestimation commandnlcomto obtain nonlinear You can specify thecoeflegendoption at the time of Estimation or when you redisplay resultsto see how to type your coefficients in postestimation commands such astestandlincom(see [R]testand [R]lincom) and in You can use thestatsbyprefix command (see [D]statsby) to fit models over each categoryin a categorical variable and collect the results in a Stata You can use the postestimation commandestimatesto store Estimation results by name forlater retrieval or for displaying/comparing multiple models by usingestimates, or for savingthem in a file.

9 See [R] You can use the postestimation commandestimatesto hold estimates, perform otherestimation commands , and then restore the prior estimates. This is of particular interest toprogrammers. See [P] You can use the postestimation commandsuestto obtain the joint parameter vector andvariance covariance matrix for coefficients from two different models by using seeminglyunrelated Estimation . This is especially useful for testing the equality, say, of coefficients acrossmodels; see [R] You can use the postestimation commandhausmanto perform Hausman model-specificationtests by usinghausman; see [R] With some exceptions, you can specify thevce(robust)option at the time of Estimation to obtainthe Huber/White/robust alternate estimate of variance, or you can specify thevce(clusterclustvar)option to relax the assumption of independence of the observations.

10 See [R] Estimation commands also allow avce(vcetype)option to specify other alternativevariance estimators which ones are allowed are documented with the estimator and usuallyvce(opg),vce(bootstrap), andvce(jackknife)are Standard syntaxYou can combine Stata sifexpandinrangewith any Estimation command. Estimation commandsalso allowbyvarlist:, where it would be 1We have data on 74 automobiles that record the mileage rating (mpg), weight (weight), andwhether the car is domestic or foreign produced (foreign). We can fit a linear regression model ofmpgonweightand the square ofweight, using just the foreign-made automobiles, by typing[ U ] 20 Estimation and postestimation commands 5. use (1978 Automobile Data). regress mpg weight # if foreignSourceSS df MS Number of obs = 22F( 2, 19) = 2 Prob > F = 19 R-squared = R-squared = 21 Root MSE = Std.


Related search queries