Search code examples
rregressionpanel

Solving error for the good beginning of the day


Let's consider data following

library(plm)
library(pglm)
data("EmplUK", package="plm")

I will add new column with 0 and 1 randomly placed. After that I want to perform logit random effects model.

df1<-EmplUK
#adding 0's and 1's
df1<-cbind(df1,'binary'=sample(0:1,1031,replace=T))
#Performing logit regression 
pglm(binary~output+wage, data=df1, family=quasibinomial(link='logit'), start = NULL, model = 'random')

And the following problem occurs :

Error in maxRoutine(fn = logLik, grad = grad, hess = hess, start = start,  : 
  argument "start" is missing, with no default

I'm not sure exactly what's the reason, I've read about this error and it seems that there are some problems when you trying to estimate 'within' model, but I get this error for every model type. Could you please give me a hand pointing out reason of this error ?


Solution

  • I don't think the quasibinomial family is setup in this function. Inside pglm there is a function pglm:::starting.values that looks for specific families:

    "binomial"
    "ordinal"
    "poisson"
    "negbin"
    "gaussian"
    "tobit"
    

    Negative binomial allows for modelling of the variance so that may suit your needs else binomial(link='logit') works ok if there's no evidence of overdispersion.

    edit: happy to be corrected on this, I haven't worked with this package before :)