Skip to content

Instantly share code, notes, and snippets.

@moritzpschwarz
Last active December 11, 2023 20:30
Show Gist options
  • Save moritzpschwarz/35fc5be900b99a1a593ab5dd7018ff7b to your computer and use it in GitHub Desktop.
Save moritzpschwarz/35fc5be900b99a1a593ab5dd7018ff7b to your computer and use it in GitHub Desktop.
logLik.plm function
logLik.plm <- function(object){
out <- -plm::nobs(object) * log(2 * var(object$residuals) * pi)/2 - deviance(object)/(2 * var(object$residuals))
attr(out,"df") <- nobs(object) - object$df.residual
attr(out,"nobs") <- plm::nobs(object)
return(out)
}
@enarhetali
Copy link

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment