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 variancecovariance matrix in a multinomial model?
Thanks in advance,
Pim Verbunt
Disabling covariance multinomial model in R2MLwiN

 Posts: 11
 Joined: Wed May 06, 2015 9:22 am

 Posts: 1193
 Joined: Mon Oct 19, 2009 10:34 am
Re: Disabling covariance multinomial model in R2MLwiN
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)

 Posts: 11
 Joined: Wed May 06, 2015 9:22 am
Re: Disabling covariance multinomial model in R2MLwiN
Thanks you for the suggestion Chris. Using the debugmode=TRUE option showed the correct parameter names.