PDA

View Full Version : Computing standard errors for regression coefficients



@cbs.dk
09-19-2011, 03:21 AM
Hello,
I am trying to compute standard errors for regression coefficients. After studing IMSL library I came up with the following way:
CALL RLSE(Y,X,b,INTCEP=0)
Then
INTCEP=1
CALL RGIVN (XY,IIND,INDIND,IDEP,INDDEP,b,R=R,DFE=DFE,SCPE=SCP E)
Then
SSE = SCPE(1,1)
CALL RSTAT (IRBEF,b(:,1),R,DFE,SSE,AOV,SQSS,COEF,COVB)

Matrix X contains an intercept, so I had to notify the subroutine with INTCEP=0. Matrix XY contains X (without intercept, as RGIVN would give a mistake with INTCEP=0) and column of dependent variable Y. All the indicators IIND,INDIND,IDEP,INDDEP are set as in the explanation for the routine. The problem is that the resulting coefficients "b" from RGIVN are different from those produced by RLSE. Then applying RSTAT is meaningless.

My question would be: Can I expect the same coefficients from both RLSE and RGIVN? And what is the best way to compute standard errors if the above method is not good enough?

mecej4
09-23-2011, 01:47 AM
I do not quite understand what the difficulty is from your rather terse description.

The STAT manual for FNL7 gives two examples that you may look at first. Example-1 for RLSE and Example-2 for RGIVN solve the same problem (the latter does the solution for two sets of values for the dependent variable, but you can ignore the results for the second set).

You could model your code on the two examples. After you see the two subroutines yield essentially the same results, you could add code to find the standard errors in the regression coefficients.

@cbs.dk
09-23-2011, 04:18 AM
Thanks for your responce. I see two examples in the manual. I follow them exactly in my code. For some reason I do not get the same result.

mecej4
09-23-2011, 04:37 AM
Post the complete code by running which you do not get the same results from the two different subroutines. State also the OS, compiler and IMSL versions used.