0

I am trying to run a multilevel mixed-effects Tobit regression in Rstudio but I can't find a way to do it.

My dataset comprises transfers (in euros) to Italian regions from 1989 to 2018 and other several economic and political variables. The dependent variable is the amount of transfers received by a region in a given year. The distribution has a peak in 0, with 312 observations out of 968 that assume value 0. Hence I would like to account for this peak in the zeros by running a Tobit model. Moreover, I would like to apply random effects at the regional level. I can't find a way to fit this kind of multilevel mixed-effects Tobit model in Rstudio.

I found out that in Stata there is an metobit command that does this and I would like to replicate it in Rstudio.

I tried several combinations of packages and functions but none of that seems to be working. Basically I would like to replicate the following Stata command in Rstudio.

metobit Total_fund GDP_capita || region:, ll(0)

I tried using the gamlss package. Below an example of the code I ran.

model1 <- gamlss(Total_fund ~ GDP_capita,
                 sigma.formula = ~ 1,  
                 data = data_regression_2_ventile,
                 family = TF)  

model1$method$REML <- TRUE 
model1$method$REMLscope <- list(bsc = "none")  
model1$method$REMLconstraint <- NULL  

model1$method$na.action <- na.exclude  
model1$method$REMLscope$region <- "~ 1"  

What happens is that I receive the error (Warning message: In RS() : Algorithm RS has not yet converged) and that the second part of the code does not change the regression output.

I also saw that using the glmmTMB package could be of help but i received several errors. Warning messages:

1: In checkMatrixPackageVersion() :
  Package version inconsistency detected.
TMB was built with Matrix version 1.5.4
Current Matrix version is 1.5.1
Please re-install 'TMB' from source using install.packages('TMB', 
        type = 'source') or ask CRAN for a binary version of 'TMB' matching 
        CRAN's 'Matrix' package
2: In checkDepPackageVersion(dep_pkg = "TMB") :
  Package version inconsistency detected.
  glmmTMB was built with TMB version 1.9.3
  Current TMB version is 1.9.4
  Please re-install glmmTMB from source or restore original ‘TMB’ package   
  (see '?reinstalling' for more information)
> 

I tried reinstalling but it didn't help.

Any suggestions on how I can fit a multilevel mixed efffects Tobit model in Rstudio?

kjetil b halvorsen
  • 1,206
  • 2
  • 18
  • 28
daddo
  • 11
  • When outcomes are nonnegative, Tobit appeals much less than Poisson regression, even if you (think you) have zero inflation. – Nick Cox May 21 '23 at 11:42
  • the [mixed model task view](https://cran.r-project.org/web/views/MixedModels.html) lists a few packages (search for "Censored" or "Tobit"), including `gamlss`. You could try one of the packages listed other than `gamlss`. However, it might be more effective to give us a [mcve] so we can help you sort out what's wrong with your current approach ... – Ben Bolker May 21 '23 at 17:41

0 Answers0