Multicolinearity Removal


In this section, you will learn to remove multicolinearity from dataset in STATA. We will explain in detail about them in the following steps:


Step 1: Upload the MS-Excel datasheet in STATA


Let us assume, the name of the MS-Excel datasheet is "Panel-Data-Representation.xlsx" and it is located in the path "D:\data\". Then the data upload command in STATA is given by:

import excel "D:\data\Panel-Data-Representation.xlsx", sheet("DATA") firstrow

Now click ENTER. Your data is uploaded in STATA.



Step 2: Define the data as panel data in STATA

Once the data is uploaded in STATA, we need to define the data to be panel data. For that purpose, we need to declare the cross-section and time-series ids in the data. Then the data declaration command in STATA is given by:

xtset CODE YEAR

Once you click ENTER, you will get the following:

panel variable: CODE (strongly balanced)
time variable: YEAR, 2001 to 2013
delta: 1 unit


Now your data is declared in STATA.



Step 3: Check for multicolineariy in STATA


Once the data is declared in STATA, you can check for multicolinearity. The basic command for checking multicolinearity in STATA is correl. In the dataset, there are five variables (POP, EC, PT, Y, and N). Now, we will check for multicolinearity among the aforesaid variables. Then the command in STATA is given by:

correl Y POP EC PT N

Once you click ENTER, you will get the following:



Now, please note that the correlation coefficients among the variables are reasonably high. It signifies that there is a certain problem of multicolinearity in the data.


Step 4: Remove multicolineariy in STATA


By far, we have tested that there is problem of multicolinearity in the data. In order to remove that, we need to use orthogonal transformation of the dataset. After this transformation, a new set of variables will be generated, and those variables will be free from multicolinearity. The basic command for performing orthogonal transformation in STATA is orthog. Let us assume that the new variables will be Y_1, POP_1, EC_1, PT_1, and N_1. The command in STATA is given by:

orthog Y POP EC PT N, generate (Y_1 POP_1 EC_1 PT_1 N_1)

Once you click ENTER, five new variables will be generated.


Step 5: Check for multicolineariy again in STATA


After transforming the data, it is required to check whether the multicolinearity has been removed properly, or not. For this, we will have to repeat Step 3. The comand in STATA is given by:

correl Y_1 POP_1 EC_1 PT_1 N_1

Once you click ENTER, you will get the following:



Now, please note that the correlation coefficients among the variables are zero. It signifies that the problem of multicolinearity in the data has been rectified.

Following these steps, you can easily check and rectify the problem of multicolineariy in STATA. For more information on these tests and carrying out other tests for checking multicolineariy, please give the following command in STATA:

help correl

If the correl command is not installed in STATA, then you will have to use the following command in STATA to find and install the code:

findit correl

For more information on orthogonal transformation, please give the following command in STATA:

help orthog

If the
orthog command is not installed in STATA, then you will have to use the following command in STATA to find and install the code:

findit orthog


Go Backfast_rewind
add