[R-sig-Geo] splm and LogLik, help again!

Roger Bivand Roger.Bivand at nhh.no
Mon Jan 18 15:39:44 CET 2016


On Sun, 17 Jan 2016, Maria Bakhtsiyarava wrote:

> Hello everyone,
>
> I want to follow up on one of the previous posts about retrieving Log
> Likelihood for models in package "splm". I would really appreciate any help!
> I tried the following solution that was posted earlier:
>
> "fixInNamespace("sperrorlm", "splm")
> manually add "ll=LL" as an element to the "return" list at the end of the
> function so that it reads:
> return <- list(coeff = betas, lambda = lambda, s2 = s2, rest.se = rest.se,
>        lambda.se = lambda.se, asyvar1 = asyvar1, ll=LL)"
>
> However, after I edited the return object that way and then run my model, I
> got this error (the model ran just fine before that.):
> >Error in (function (arg)  : object 'sarpanelerror' not found.

This error comes in:

     opt <- optimize(sarpanelerror, interval = interval, maximum = TRUE,
         env = env, tol = con$tol.opt)

so I guess you need to use fixInNamespace("sperrorlm", "splm") again to 
prepend splm::: to all non-exported objects in the edited function. I 
can't reproduce this with splm_1.3-7 and R 3.2.3 under Linux. I think 
you'd have to pass the returned value up through spfeml() and spml() too, 
but you probably know that already.

Hope this helps,

Roger

>
> Here is my model: fmL=spml(model,data=dat, listw=sp_weightsm, model =
> "within", effect = "time", spatial.error = "b", lag = FALSE, quiet = T)
>
> Is there something else that needs to be edited to obtain the LogLik value?
> Or is there an alternative way to get it?
>
> Thank you so much,
> Maryia
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: Roger.Bivand at nhh.no
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
http://depsy.org/person/434412



More information about the R-sig-Geo mailing list