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.files.wordpress.com/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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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