[R] function censReg in panel data setting
Arne Henningsen
arne.henningsen at googlemail.com
Tue Sep 6 06:41:24 CEST 2011
Dear Igors
On 5 September 2011 23:58, Igors <igors.lahanciks at gmail.com> wrote:
> I have a problem estimating Random Effects model using censReg function.
>
> small part of code:
>
> UpC <- censReg(Power ~ Windspeed, left = -Inf, right =
> 2000,data=PData_In,method="BHHH",nGHQ = 4)
>
> Error in maxNRCompute(fn = logLikAttr, fnOrig = fn, gradOrig = grad,
> hessOrig = hess, :
> NA in the initial gradient
>
>
> ...then I tried to set starting values myself and here is the error what I
> got:
>
> UpC <- censReg(Power ~ Windspeed, left = -Inf, right =
> 2000,data=PData_In,method="BHHH",nGHQ = 4,start=c(-691,189,5))
>
> Error in names(start) <- c(colnames(xMat), "logSigmaMu", "logSigmaNu") :
> 'names' attribute [4] must be the same length as the vector [3]
>
>
> How can I solve any of these errors?
You chose a suitable solution for the first problem (NA in initial
gradient). Unfortunately, the documentation of "censReg" is not very
clear regarding starting values of panel tobit models. Please note
that you have to specify 4 starting values: intercept, slope
parameter, variance of the individual effects ("mu"), and variance of
the general error term ("nu").
http://cran.r-project.org/web/packages/censReg/vignettes/censReg.pdf
Best wishes from Copenhagen,
Arne
--
Arne Henningsen
http://www.arne-henningsen.name
More information about the R-help
mailing list