Page 1 of 1

Disabling covariance multinomial model in R2MLwiN

Posted: Mon May 30, 2016 9:21 am
by pimverbunt
Dear all,

I'm currently modelling a mulitnomial multilevel model in R2MLwiN. My code is the following:

model = logit(se_arop_md3, denom) ~ 1 + (1 | country)
multinomial_empty <- runMLwiN(model, D = "Unordered Multinomial", data = mydata)

When I run this basic model it works. However, when I try to disable the covariance estimation the model does not work, giving the following message:
"Error in read.dta(IGLSfile) :
unable to open file: 'No such file or directory'"

The code I use is the following:

covmatrix <- matrix(, nrow = 3, ncol = 1)
covmatrix[1, 1] <- 2
covmatrix[2, 1] <- "Intercept_1"
covmatrix[3, 1] <- "Intercept_2"

multinomial_empty <- runMLwiN(model, D = "Unordered Multinomial", estoptions = list(clre = covmatrix), data = mydata)

I have tried replacing level "covmatrix[1, 1] <- 2" with "covmatrix[1, 1] <- 3" and various other changes in the code but I still get no results.

Can anyone help me with this problem? What is the exact code to not estimate the covariance in the variance-covariance matrix in a multinomial model?

Thanks in advance,

Pim Verbunt

Re: Disabling covariance multinomial model in R2MLwiN

Posted: Tue May 31, 2016 12:01 pm
by ChrisCharlton
The parameter names that you pass to the clre option must appear exactly as displayed in MLwiN (e.g. Intercept.<category1>, etc). Probably the best way to determine what they should be is to add the debugmode=TRUE option into your estoptions list and then check via the equations window. If you just want a diagonal covariance matrix another option is to use the smat option, as in the following example.

Code: Select all

smat <- matrix(, nrow=2, ncol=1)
smat[1, 1] <- 2 # Level of covariance matrix
smat[2, 1] <- 1 # Set matrix type to diagonal

multinomial_empty <- runMLwiN(model, D = "Unordered Multinomial", estoptions = list(smat=smat), data = mydata)

Re: Disabling covariance multinomial model in R2MLwiN

Posted: Thu Jun 02, 2016 10:49 am
by pimverbunt
Thanks you for the suggestion Chris. Using the debugmode=TRUE option showed the correct parameter names.