RATS GUIDELINES

RUNNING RATS

Go PC library or (I believe) any PC LAB.

Click 'start' > all programs > departments > economics > winRATS 6.10 > winrats 6.10

Now you are in RATS: click:

File > then choose ‘chow2’ from the list of files on the menu. Once in the window, block copy the whole file

press I on list of options at top menu bar

press R on R/L (you need R to be highlighted L not and the little man running to be in blue).

press little man running

have a look at output (do this by pressing minimize box top left hand corner as in any other program.

save your results on your h drive

The program is he following:

*

* CHOW2.PRG

* Manual example 6.4

*

open data h:states.wks

data(org=obs,format=wks) 1 50 expend pcaid pop pcinc

set pcexp = expend/pop

set large = pop>=5000 ;* Will be one for large states

*

* Set up dummies for PCAID and PCINC

*

set dpcaid = pcaid*large

set dpcinc = pcinc*large

*

* Compute regression with dummies

*

linreg(robusterrors) pcexp

# constant pcaid pcinc large dpcaid dpcinc

*

* Test dummies

*

exclude

# large dpcaid dpcinc

The results should look like:

Linear Regression - Estimation by Least Squares

Robust Standard Error Calculations

Dependent Variable PCEXP

Usable Observations 50 Degrees of Freedom 44

Centered R**2 0.896484 R Bar **2 0.884720

Uncentered R**2 0.991021 T x R**2 49.551

Mean of Dependent Variable 0.7941835523

Std Error of Dependent Variable 0.2472352259

Standard Error of Estimate 0.0839434200

Sum of Squared Residuals 0.3100459017

Log Likelihood 56.12952

Durbin-Watson Statistic 1.509282

Variable Coeff Std Error T-Stat Signif

*******************************************************************************

1. Constant -0.759407260 0.129018352 -5.88604 0.00000000

2. PCAID 0.002460820 0.000308788 7.96929 0.00000000

3. PCINC 0.000257004 0.000024865 10.33612 0.00000000

4. LARGE 0.309601599 0.207916442 1.48907 0.13646962

5. DPCAID 0.000757015 0.000618384 1.22418 0.22088334

6. DPCINC -0.000098186 0.000047154 -2.08225 0.03731943

Null Hypothesis : The Following Coefficients Are Zero

LARGE

DPCAID

DPCINC

Chi-Squared(3)= 5.365171 or F(3,*)= 1.78839 with Significance Level 0.14692899

BASICS

Rats is case insensitive, it does not distinguish between upper and lower case. Sometimes the command is too long to fit on one line (maximum width 80 characters). You denote a continuation by space $ at the end of a line and just carry on to the next. A * at the beginning of a line denotes a comment line and the computer ignores it. Please note in the middle of loading in RATS Click 'start' > all programs > departments > economics > winRATS 6.10 (AT THIS STAGE) > winrats 6.10, you can access a help menu which is very good.

Guide to program.

open data h:states.wks opens a data file which will be on h drive. If you save it on a flash drive or floppy disk, you will have to change ‘h’ accordingly. The file is in LOTUS format (hence the .wks and and you can read it into Excel).

data(org=obs,format=wks) 1 50 expend pcaid pop pcinc This reads four variables into the memory, called expend pcaid pop pcinc. There are 50 observations (observations 1 to 50) the data is stored in columns (the default is that they are stored variable by variable, i.e. first the 50 observations on expend then on pcaid, etc. and because the LOTUS format is no-standard you need to tell the computer about it.

set pcexp = expend/pop This creates a new variable equal to expend divided by pop (in fact its per capita expenditure.

Set large = pop>=5000 ;* Will be one for large states

This is similar to before, i.e. a set statement, but this creates a DUMMY variable if pop is greater than 500 (presumably 500,000). That is for large countries it equals 1 for small it equals zero. Note the ‘; ‘ effectively ends the line and the * denotes the rest of this is a comment line.

set dpcaid = pcaid*large You should be able

set dpcinc = pcinc*large to figure this out yourself

linreg(robusterrors) pcexp

# constant pcaid pcinc large dpcaid dpcinc

This is a two stage command, the first line says do a linear regression with pxexp as the dependent variable (correcting t statistics for heteroscedasticity using White’s correction) The second line begins with a # as it is the second line of a two line statement it gives the right hand side variables, ‘constant’ is a ‘reserved name’ you do not have to define it, the computer knows it’s a constant term.

exclude

# large dpcaid dpcinc

This is another two part statement. The first is to exclude some variables from the previous regression and test for their significance. (The F test process in one of the early lectures). The second line again begins with a # and tells what variables to exclude.

Null Hypothesis : The Following Coefficients Are Zero

LARGE

DPCAID

DPCINC

Chi-Squared(3)= 5.365171 or F(3,*)= 1.78839 with Significance Level 0.14692899

Guide to the Results

I would simply use R Bar squared, a Durbin Watson statistic is reported but being a cross section analysis it is irrelevant. We can see we are regressing per capita expenditure on per capita aid income, the large country dummy variables, (three of them one shift and two slope ones (see lecture notes on Monte carlo Simulation, etc). We note that the coefficient on aid is positive and significant. The t statistic is 7.969 and this is significant at the 0.000000 level, well below 1%. Compare this with the t statistic on DPCINC 2.08225 (I always ignore – signs on t statistics) its level of significance 0.03731943 is less than 5% (0.05) but greater than 1% (0.01). We would therefore conclude that this variable is significant at the 5% level. The coefficient on PCAID is small 0.002460820 but without knowing more it is difficult to read much into this. What we can conclude is that aid increases expenditure (consumer expenditure I think).

Linear Regression - Estimation by Least Squares

Robust Standard Error Calculations

Dependent Variable PCEXP

Usable Observations 50 Degrees of Freedom 44

Centered R**2 0.896484 R Bar **2 0.884720

Uncentered R**2 0.991021 T x R**2 49.551

Mean of Dependent Variable 0.7941835523

Std Error of Dependent Variable 0.2472352259

Standard Error of Estimate 0.0839434200

Sum of Squared Residuals 0.3100459017

Log Likelihood 56.12952

Durbin-Watson Statistic 1.509282

Variable Coeff Std Error T-Stat Signif

*******************************************************************************

1. Constant -0.759407260 0.129018352 -5.88604 0.00000000

2. PCAID 0.002460820 0.000308788 7.96929 0.00000000

3. PCINC 0.000257004 0.000024865 10.33612 0.00000000

4. LARGE 0.309601599 0.207916442 1.48907 0.13646962

5. DPCAID 0.000757015 0.000618384 1.22418 0.22088334

6. DPCINC -0.000098186 0.000047154 -2.08225 0.03731943

This gives us the result of the F test The F statistic with 3 and 44 degrees of freedom is 1.78839. The critical values from the table are about 2.23 (10% level) and 2.84 (5% level). Clearly this is less than both and hence we would reject at the 10% level the hypothesis that these three variables are JOINTLY significant. The results also tell us this. It says it is significant at the 0.14692899 level, i.e. 14.7% substantially above the 10%. In other words the chances of these three variables not being significant is almost 15% and with the levels of significance we use that is just too great. A second figure is based on the chi squared (χ2) distribution which we do not got into at this stage.

Null Hypothesis : The Following Coefficients Are Zero

LARGE

DPCAID

DPCINC

Chi-Squared(3)= 5.365171 or F(3,*)= 1.78839 with Significance Level 0.14692899

EXERCISE

Add the following lines to your program.

SET SMALL = POP<5000

LINREG(SMPL=SMALL) PCEXP

# CONSTANT PCAID PCINC

EVAL RSSSMALL=RSS

IEVAL NDFSMALL=NDF

The regression is restricted to those countries where small equals one, i.e. for small countries. This [EVAL RSSSMALL=RSS] stores the residual sum of squares as a parameter you have called RSSSMALL. This is a real variable, i.e. a can have a decimal point hence we use eval which creates real constants. This [IEVAL NDFSMALL=NDF] stores the degrees of freedom as NDFSMALL. This is an integer and hence we use ieval.

Repeat the above but for ‘large’ countries. Then do:

*

LINREG PCEXP

# CONSTANT PCAID PCINC

EVAL RSSPOOL=RSS

*

EVAL RSSUNR=RSSSMALL+RSSLARGE

IEVAL NDFUNR=NDFSMALL+NDFLARGE

EVAL FSTAT = ( (RSSPOOL-RSSUNR)/3 ) / (RSSUNR/NDFUNR)

CDF FTEST FSTAT 3 NDFUNR

FSTAT is the F statistic to test for the stability of an equation in different samples – see your notes. CDF tells you how significant this is. It stands for the cumulative density function. Save the results in your h drive and save this modified program there too.