Re: [R] Problem with na.action within own function

2013-08-08 Thread ivan
I found the solution. coeftest does not work with na.exclude but with na.omit only, i.e. one needs to omit missing values from the residual matrix. Cheers! On Thu, Aug 8, 2013 at 10:19 AM, ivan wrote: > Dear R Community, > > I am trying to build a very simple function which uses lm and coefte

[R] Problem with na.action within own function

2013-08-08 Thread ivan
Dear R Community, I am trying to build a very simple function which uses lm and coeftest to return a coefficient matrix with heteroskedasticity robust standard errors. The function is the following: reg=function(formula,data,na.action){ res=lm(formula=formula,data=data,na.action=na.action) h