Example: barber

Title stata.com regress — Linear regression

Linear regressionSyntaxMenuDescriptionOptionsRe marks and examplesStored resultsMethods and formulasAcknowledgmentsReferencesAlso seeSyntaxregressdepvar[indepvars] [if] [in] [weight] [,options]optionsDescriptionModelnoconst antsuppress constant termhasconshas user-supplied constanttssconscompute total sum of squares with constant; seldom usedSE/Robustvce(vcetype)vcetypemay beols,robust,clusterclustvar,bootstrap,j ackknife,hc2, orhc3 Reportinglevel(#)set confidence level; default islevel(95)betareport standardized beta coefficientseform(string)report exponentiated coefficients and label asstringdepname(varname)substitute dependent variable name; programmer s optiondisplayoptionscontrol column formats, row spacing, line width, display of omittedvariables and base and empty cells, and factor-variable labelingnoheadersuppress output headernotablesuppress coefficient tableplusmake table extendablemse1force mean squared error to1coeflegenddisplay legend instead of statisticsindepvarsmay contain factor variables; see[U] Factor contain time-series operators; see[U] Time-series ,by,fp,jackknife,mfp,mi estimate,nestreg,rolling,statsby,stepwis e, andsvyare allowed;see[U] Prefix (bootstrap)andvce(jackknife)are not allowed with themi estimateprefix; see [MI]mi are not allowed with thebootstrapprefix; see [R] are not allowed with thejackknifepr

frontier [R] frontier stochastic frontier models gmm [R] gmm generalized method of moments estimation heckman [R] heckman Heckman selection model ... Chatterjee and Hadi(2012) explain regression analysis by using examples containing typical problems that you might encounter when performing exploratory data analysis. We also recommend

Tags:

  Analysis, Frontier, Stochastic, Frontier stochastic frontier

Information

Domain:

Source:

Link to this page:

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

Other abuse

Transcription of Title stata.com regress — Linear regression

1 Linear regressionSyntaxMenuDescriptionOptionsRe marks and examplesStored resultsMethods and formulasAcknowledgmentsReferencesAlso seeSyntaxregressdepvar[indepvars] [if] [in] [weight] [,options]optionsDescriptionModelnoconst antsuppress constant termhasconshas user-supplied constanttssconscompute total sum of squares with constant; seldom usedSE/Robustvce(vcetype)vcetypemay beols,robust,clusterclustvar,bootstrap,j ackknife,hc2, orhc3 Reportinglevel(#)set confidence level; default islevel(95)betareport standardized beta coefficientseform(string)report exponentiated coefficients and label asstringdepname(varname)substitute dependent variable name; programmer s optiondisplayoptionscontrol column formats, row spacing, line width, display of omittedvariables and base and empty cells, and factor-variable labelingnoheadersuppress output headernotablesuppress coefficient tableplusmake table extendablemse1force mean squared error to1coeflegenddisplay legend instead of statisticsindepvarsmay contain factor variables; see[U] Factor contain time-series operators; see[U] Time-series ,by,fp,jackknife,mfp,mi estimate,nestreg,rolling,statsby,stepwis e, andsvyare allowed;see[U] Prefix (bootstrap)andvce(jackknife)are not allowed with themi estimateprefix; see [MI]mi are not allowed with thebootstrapprefix; see [R] are not allowed with thejackknifeprefix; see [R] ,tsscons,vce(),beta,noheader,notable,plu s,depname(),mse1, and weights are not allowed withthesvyprefix; see [SVY] ,fweights,iweights, andpweights are allowed.

2 See[U] ,notable,plus,mse1, andcoeflegenddo not appear in the dialog [U] 20 Estimation and postestimation commandsfor more capabilities of estimation regress Linear regressionMenuStatistics> Linear models and related> Linear regressionDescriptionregressfits a model ofdepvaronindepvarsusing Linear is a short list of other regression commands that may be of interest. Seehelp estimationcommandsfor a complete [R]aregan easier way to fit regressions with many dummy variablesarch[TS]archregression models with ARCH errorsarima[TS]arimaARIMA modelsboxcox[R]boxcoxBox Cox regression modelscnsreg[R]cnsregconstrained Linear regressioneivreg[R]eivregerrors-in-varia bles regressionetregress[TE]etregressLinear regression with endogenous treatment effectsfrontier[R]frontierstochastic frontier modelsgmm[R]gmmgeneralized method of moments estimationheckman[R]heckmanHeckman selection modelintreg[R]intreginterval regressionivregress[R]ivregresssingle-eq uation instrumental-variables regressionivtobit[R]ivtobittobit regression with endogenous variablesnewey[TS]neweyregression with Newey West standard errorsnl[R]nlnonlinear least-squares estimationnlsur[R]nlsurestimation of nonlinear systems of equationsqreg[R]qregquantile (including median)

3 Regressionreg3[R]reg3three-stage least-squares (3 SLS) regressionrreg[R]rrega type of robust regressiongsem[SEM]intro 5generalized structural equation modelssem[SEM]intro 5linear structural equation modelssureg[R]suregseemingly unrelated regressiontobit[R]tobittobit regressiontruncreg[R]truncregtruncated regressionxtabond[XT]xtabondArellano Bond Linear dynamic panel-data estimationxtdpd[XT]xtdpdlinear dynamic panel-data estimationxtfrontier[XT]xtfrontierpanel- data stochastic frontier modelsxtgls[XT]xtglspanel-data GLS modelsxthtaylor[XT]xthtaylorHausman Taylor estimator for error-components modelsxtintreg[XT]xtintregpanel-data interval regression modelsxtivreg[XT]xtivregpanel-data instrumental-variables (2 SLS) regressionxtpcse[XT]xtpcselinear regression with panel-corrected standard errorsxtreg[XT]xtregfixed- and random-effects Linear modelsxtregar[XT]xtregarfixed- and random-effects Linear models with an AR(1) disturbancexttobit[XT]xttobitpanel-data tobit modelsregress Linear regression 3 Options Model noconstant; see [R]estimation that a user-defined constant or its equivalent is specified among the independentvariables inindepvars.

4 Some caution is recommended when specifying this option, as resultingestimates may not be as accurate as they otherwise would be. Use of this option requires sweeping the constant last, so the moment matrix must be accumulated in absolute rather than deviation option may be safely specified when the means of the dependent and independent variablesare all reasonable and there is not much collinearity between the independent variables. The bestprocedure is to viewhasconsas a reporting option estimate with and withouthasconsandverify that the coefficients and standard errors of the variables not affected by the identity of theconstant are the total sum of squares to be computed as though the model has a constant, that is,as deviations from the mean of the dependent variable. This is a rarely used option that has aneffect only when specified withnoconstant. It affects the total sum of squares and all resultsderived from the total sum of squares.

5 SE/Robust vce(vcetype)specifies the type of standard error reported, which includes types that are derivedfrom asymptotic theory (ols), that are robust to some kinds of misspecification (robust), thatallow for intragroup correlation (clusterclustvar), and that use bootstrap or jackknife methods(bootstrap,jackknife); see [R] (ols), the default, uses the standard variance estimator for ordinary least-squares allows the following:vce(hc2)andvce(hc3)specify an alternative bias correction for the robust variance (hc2)andvce(hc3)may not be specified withsvyprefix. In the unclustered case,vce(robust)uses 2j={n/(n k)}u2jas an estimate of the variance of thejth observation,whereujis the calculated residual andn/(n k)is included to improve the overall estimate ssmall-sample (hc2)instead usesu2j/(1 hjj)as the observation s variance estimate, wherehjjis thediagonal element of the hat (projection) matrix.

6 This estimate is unbiased if the model reallyis (hc2)tends to produce slightly more conservative confidence (hc3)usesu2j/(1 hjj)2as suggested by Davidson and MacKinnon (1993), who reportthat this method tends to produce better results when the model really is (hc3)produces confidence intervals that tend to be even more Davidson and MacKinnon (1993, 554 556) and Angrist and Pischke (2009, 294 308) formore discussion on these two bias corrections. Reporting level(#); see [R]estimation that standardized beta coefficients be reported instead of confidence intervals. The betacoefficients are the regression coefficients obtained by first standardizing all variables to have amean of 0 and a standard deviation of not be specified withvce(clusterclustvar)or regress Linear regressioneform(string)is used only in programs and ado-files that useregressto fit models other thanlinear ()specifies that the coefficient table be displayed in exponentiated formas defined in [R]maximizeand thatstringbe used to label the exponentiated coefficients in (varname)is used only in programs and ado-files that useregressto fit models other thanlinear ()may be specified only at estimation recorded asthe identity of the dependent variable, even though the estimates are calculated usingdepvar.

7 Thismethod affects the labeling of the output not the results calculated but could affect subsequentcalculations made bypredict, where the residual would be calculated as deviations fromvarnamerather ()is most typically used whendepvaris a temporary variable (see[P]macro) used as a proxy ()is not allowed with :noomitted,vsquish,noemptycells,baseleve ls,allbaselevels,nofvla-bel,fvwrap(#),fv wrapon(style),cformat(%fmt),pformat(%fmt ),sformat(%fmt), andnolstretch; see [R]estimation following options are available withregressbut are not shown in the dialog box:noheadersuppresses the display of theANOVA table and summary statistics at the top of the output;only the coefficient table is displayed. This option is often used in programs and display of the coefficient that the output table be made extendable. This option is often used in programs used only in programs and ado-files that useregressto fit models other than linearregression and is not allowed with the mean squared error to1, forcingthe variance covariance matrix of the estimators to be(X DX) 1(seeMethods and formulasbelow) and affecting calculated standard errors.

8 Degrees of freedom fortstatistics is calculatedasnrather thann ; see [R]estimation and are presented under the following headings:Ordinary least squaresTreatment of the constantRobust standard errorsWeighted regressionInstrumental variables and two-stage least-squares regressionVideo exampleregressperforms Linear regression , including ordinary least squares and weighted least a general discussion of Linear regression , see Draper and Smith (1998), Greene (2012), orKmenta (1997).See Wooldridge (2013) for an excellent treatment of estimation, inference, interpretation, andspecification testing in Linear regression models. This presentation stands out for its clarification ofthe statistical issues, as opposed to the algebraic issues. See Wooldridge (2010, chap. 4) for a moreadvanced discussion along the same Linear regression 5 See Hamilton (2013, chap.)

9 7) and Cameron and Trivedi (2010, chap. 3) for an introduction tolinear regression using Stata. Dohoo, Martin, and Stryhn (2012, 2010) discuss Linear regression usingexamples from epidemiology, and Stata datasets and do-files used in the text are available. Cameronand Trivedi (2010) discuss Linear regression using econometric examples with Stata. Mitchell (2012)shows how to use graphics and postestimation commands to understand a fitted regression and Hadi (2012) explain regression analysis by using examples containing typicalproblems that you might encounter when performing exploratory data analysis . We also recommendWeisberg (2005), who emphasizes the importance of the assumptions of Linear regression and problemsresulting from these assumptions. Becketti (2013) discusses regression analysis with an emphasis ontime-series data. Angrist and Pischke (2009) approach regression as a tool for exploring relationships,estimating treatment effects, and providing answers to public policy questions.

10 For a discussion ofmodel-selection techniques and exploratory data analysis , see Mosteller and Tukey (1977). For amathematically rigorous treatment, see Peracchi (2001, chap. 6). Finally, see Plackett (1972) if youare interested in the history of regression . Least squares, which dates back to the 1790s, was discoveredindependently by Legendre and least squaresExample 1: Basic Linear regressionSuppose that we have data on the mileage rating and weight of 74 automobiles. The variables inour data arempg,weight, andforeign. The last variable assumes the value 1 for foreign and 0 fordomestic automobiles. We wish to fit the modelmpg= 0+ 1weight+ 2foreign+ This model can be fit withregressby typing. use (1978 Automobile Data). regress mpg weight foreignSourceSS df MS Number of obs = 74F( 2, 71) = 2 Prob > F = 71 R-squared = R-squared = 73 Root MSE = Std.


Related search queries