Linear Regression in STATA

In STATA one can estimate a linear regression using the command regress. In this post I will present how to use the STATA function regress to run OLS on the following model

y = \alpha + \beta_{1} x_{1}

In this example, our dependent variable y will be my weekly average weight, the explanatory variable x_{1} represents the sum of calories that I burned during the previous week. For a more detailed description of the data see here.

*start with empty workspace
clear all 

*import sample data
import excel using "https://economictheoryblog.com/wp-content/uploads/2016/08/data.xlsx",first 

*estimate linear regression model 
regress weight lag_calories 

 

The function regress returns point estimates for \alpha and \beta_{1}. Moreover, the function returns standard error for the point estimates, along with its t-statistic, the p-value and 95% confidence intervals. The function also allows to conduct multiple regressions. That is, the function allows additional explanatory variables that can simply be added to the function as additional arguments.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.