# 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 STATA clustered standard errors are obtained by adding the option cluster(variable_name) to your regression, where variable_name specifies the variable that defines the group / cluster in your data. The summary output will return clustered standard errors. Here is the syntax:
 regress x y, cluster(variable_name)
”Robust” standard errors is a technique to obtain unbiased standard errors of OLS coefficients under heteroscedasticity. In contrary to other statistical software, such as R for instance, it is rather simple to calculate robust standard errors in STATA. All you need to is add the option  robust  to you regression command. That is: