Non linear regression analysis in STATA and its interpretation

In the previous article on Linear Regression using STATA, a simple linear regression model was used to test the hypothesis. However the linear regression will not be effective if the relation between the dependent and independent variable is non linear. The non linear regression is used more in the real life as compared to the linear regression.

Log-transformation for non linear regression

The main purpose of logarithmic transformations is to handle situations when there is non-linear relationship between independent and dependent variables. Using the logarithmic model for one or more variables will make effective non-linear relationship and also preserve the linear model. These models also are used to analyse variables in order to transform a highly skewed model into a normal one. There are three different ways to incorporate log in the regression model.

Linear – log regression model

In the linear log regression analysis the independent variable is in log form whereas the dependent variable is kept normal. The linear log regression analysis can be written as:


In this case the independent variable (X1) is transformed into log. One can transform the normal variable into log form using the following command:

gen lnX = log(X)  (if you want to create new variable with log transformation)  
replace X = log(X)     (if you want to replace the variable with its log form)

In case of linear log model the coefficient can be interpreted as follows:

If the independent variable is increased by 1% then the expected change in dependent variable is (β/100) units, holding all other things constant.

using log transformation of independent variable for non linear relatiohship

Regression results for level log regression

For example the linear log regression analysis was performed using the same data set in previous articles. Here price is dependent variable and lnmpg is the independent variable. The independent variable lnmpg is the log transformation of the mpg. The coefficient of lnmpg -5992.728 can be interpreted as follows:

With 1% increase in mpg the price of auto declines by (5992.72/100)  or 59.93 units, holding all other factors constant. 

Interpretation of all other components in the above table is similar to the linear regression, explained in previous article.

Log- linear regression model

As the name suggest in log linear regression model the dependent variable is in log form instead of the independent variable. The regression equation of the log-linear regression is as follows:

log level

The dependent variable can also be transformed into log form using the similar command given in the previous section.

The coefficient of independent variable in case of log-linear regression can be interpreted as:

If independent variable is increased by 1 unit, the dependent variable is expected to increase by (β*100)% holding all things constant.

log linear results

Regression results for log linear results

Using the same data set, the log linear regression has been performed. In this case lnprice is the dependent variable which is the log transformation of price and independent variable mpg is in its normal form.

The coefficient of mpg can be interpreted as:

If mpg is increased by one unit the price is expected to decrease by 3.32 %, holding all other factors constant.

Log-log model

In log-log model both the dependent and the independent variables are in log form. The regression equation of log-log regression is as follows:

log log

The coefficient of the log log model can be interpreted as:

If independent variable increase by 1% the dependent variable will increase/ decrease by β %, holding all other factors constant.

both the dependent and independent variables in log

Results for log log regression

In this case both the dependent variable and independent variable are in log form. The interpretation of coefficient  lnmpg is:

If mpg increase by 1% the price of auto decreases by 0.83%, holding all other factors constant.

The log log regression is also used to find the elasticity. This is because it shows one % change in dependent variable with change in 1% in the independent variable.

Indra Giri

Indra Giri

Senior Analyst at Project Guru
He completed his Masters in Development Economics from South Asian University, New Delhi. His areas of interest includes various socio development issues like poverty, inequality and unemployment in South Asia. Apart from writing for Project Guru he loves to travel and play football in his spare time.
Indra Giri

Latest posts by Indra Giri (see all)

Related articles

  • Procedure and interpretation of linear regression analysis using STATA Linear regression analysis is conducted to predict the dependent variable based on one or more independent variables.
  • Correlation analysis using STATA Correlation analysis is conducted to examine the relationship between dependent and independent variables. There are two types of correlation analysis in STATA.
  • Introduction to STATA STATA, like SPSS is a smart data analysis tool used for data management and analysis. It is a fast and easy to use, across all operating systems such as Windows, Unix and Mac.
  • Building univariate ARIMA model for time series analysis in STATA Autoregressive Integrated Moving Average (ARIMA) is popularly known as Box-Jenkins method. The emphasis of this method is on analyzing the probabilistic or stochastic properties of a single time series. Unlike regression models where Y is explained by X1 X2….XN regressor (like […]
  • Multivariate analysis with more than on one dependent variable The normal linear regression analysis and the ANOVA test are only able to take one dependent variable at a time. So one cannot measure the true effect if there are multiple dependent variables. In such cases multivariate analysis can be used. Thus, multivariate analysis (MANOVA) is done […]


  1. I like the discussions and they are very elaborate and informative. Can i get some notes on data analysis using stata program, just for practice? I will appreciate. Thank you.


We are looking for candidates who have completed their master's degree or Ph.D. Click here to know more about our vacancies.