Example: confidence

Title stata.com regress — Linear regression

Linear regressionDescriptionQuick startMenuSyntaxOptionsRemarks and examplesStored resultsMethods and formulasAcknowledgmentsReferencesAlso seeDescriptionregressperforms ordinary least-squares Linear also perform weightedestimation, compute robust and cluster robust standard errors, and adjust results for complex startSimple Linear regression ofyonx1regress y x1 regression ofyonx1,x2, and indicators for categorical variablearegress y x1 x2 the interaction between continuous variablex2andaregress y x1 ## model for observations wherev1is greater than zeroregress y x1 x2 if v1>0 With cluster robust standard errors for clustering by levels ofcvarregress y x1 x2 , vce(cluster cvar)With bootstrap standard errorsregress y x1 x2 , vce(bootstrap)Report standardized coefficientsregress y x1 x2 , betaAdjust for complex survey design usingsvysetdatasvy: regress y x1 x2 sampling weightwvarregress y x1 x2 [pweight=wvar]MenuStatistics> Linear models and related> Linear regression12 regress Linear regressionSyntaxregressdepvar[indepvars] [if] [in] [weight] [,options]optionsDescriptionModelnoconst antsuppress constant termhasconshas user-supplied constanttssco

regress performs ordinary least-squares linear regression. regress can also perform weighted estimation, compute robust and cluster–robust standard errors, and adjust results for complex survey designs. Quick start Simple linear regression of y on x1 regress y x1 Regression of y on x1, x2, and indicators for categorical variable a regress y ...

Tags:

  Robust, Regression

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 regressionDescriptionQuick startMenuSyntaxOptionsRemarks and examplesStored resultsMethods and formulasAcknowledgmentsReferencesAlso seeDescriptionregressperforms ordinary least-squares Linear also perform weightedestimation, compute robust and cluster robust standard errors, and adjust results for complex startSimple Linear regression ofyonx1regress y x1 regression ofyonx1,x2, and indicators for categorical variablearegress y x1 x2 the interaction between continuous variablex2andaregress y x1 ## model for observations wherev1is greater than zeroregress y x1 x2 if v1>0 With cluster robust standard errors for clustering by levels ofcvarregress y x1 x2 , vce(cluster cvar)With bootstrap standard errorsregress y x1 x2 , vce(bootstrap)Report standardized coefficientsregress y x1 x2 , betaAdjust for complex survey design usingsvysetdatasvy: regress y x1 x2 sampling weightwvarregress y x1 x2 [pweight=wvar]MenuStatistics> Linear models and related> Linear regression12 regress Linear regressionSyntaxregressdepvar[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.

2 Programmer s optiondisplayoptionscontrol columns and column formats, row spacing, line width,display of omitted variables and base and empty cells, andfactor-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 ,bootstrap,by,collect,fmm,fp,jackknife,m fp,mi estimate,nestreg,rolling,statsby,stepwis e,andsvyare allowed; see[U] Prefix commands. For more details, see [BAYES]bayes: regressand[FMM]fmm: (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; see[U] ,notable,plus,mse1, andcoeflegenddo not appear in the dialog [U] 20 Estimation and postestimation commandsfor more capabilities of estimation Model noconstant; see [R]Estimation that a user-defined constant or its equivalent is specified among the independentvariables inindepvars.

3 Some caution is recommended when specifying this option, as resultingregress Linear regression 3estimates 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.

4 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. 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 alternative bias corrections for the robust variance (hc2)andvce(hc3)may not be specified with thesvyprefix.

5 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. 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.

6 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 (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 This4 regress Linear regressionmethod 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 :noci,nopvalues,noomitted,vsquish,noempt ycells,baselevels,allbaselevels,nofvlabe l,fvwrap(#),fvwrapon(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.

8 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 X) 1(seeMethods and formulasbelow) and affecting calculated standard errors. 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 regressionVideo exampleregressperforms Linear regression , including ordinary least squares and weighted least [U] 27 Overview of Stata estimation commandsfor a list of other regression commands thatmay be of interest.

9 For a general discussion of Linear regression , see Kutner et al. (2005).See Stock and Watson (2019) and Wooldridge (2020) for an excellent treatment of estimation,inference, interpretation, and specification testing in Linear regression models. See Wooldridge (2010,chap. 4) for a more advanced discussion along the same Hamilton (2013, chap. 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 (2021)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.

10 We also recommendWeisberg (2014), who emphasizes the importance of the assumptions of Linear regression and problemsresulting from these assumptions. Becketti (2020) discusses regression analysis with an emphasis ontime-series data. Angrist and Pischke (2009) approach regression as a tool for exploring relationships, regress Linear regression 5estimating treatment effects, and providing answers to public policy questions. For a mathematicallyrigorous treatment, see Peracchi (2001, chap. 6). Finally, see Plackett (1972) if you are interested inthe history of regression . Least squares, which dates back to the 1790s, was discovered independentlyby Legendre and least squaresExample 1: Basic Linear regressionSuppose that we have data on the mileage rating and weight of 74 automobiles.


Related search queries