Search found 1340 matches

by ChrisCharlton
Fri Jun 17, 2022 1:51 pm
Forum: MLwiN user forum
Topic: Calculating level-three residuals in multilevel model
Replies: 2
Views: 4065

Re: Calculating level-three residuals in multilevel model

If you are using MLwiN then the residuals returned from the Model>Residuals menu are already shrunken (see chapter 3 of the MLwiN User's Guide ). If you need an unshrunken version then the REFLATE command (see the MLwiN on-line help) is provided to calculate this, and more details of the formula use...
by ChrisCharlton
Tue Jun 14, 2022 11:05 am
Forum: R2MLwiN user forum
Topic: informative priorParam in random slope
Replies: 2
Views: 3874

Re: informative priorParam in random slope

As you state the 'prior variance matrix is not positive definite' message usually occurs when the starting values for the covariance matrix, used as the prior for MCMC, is invalid. Normally this matrix is obtained from the IGLS estimates, however you can specify it manually via the startval option. ...
by ChrisCharlton
Tue Apr 12, 2022 1:14 pm
Forum: runmlwin user forum
Topic: Level 2 unit problem
Replies: 1
Views: 4685

Re: Level 2 unit problem

Although you have checked the sorting, this does look like the sort of behaviour you would get if the data was not sorted by the identifiers defining the unit hierarchy. Can you confirm that the data is sorted by all of these ('n', 'wave_num' and 'wave')? You could also try recoding 'n' to go from 1...
by ChrisCharlton
Thu Mar 10, 2022 9:04 pm
Forum: R2MLwiN user forum
Topic: how to extract credible intervals
Replies: 1
Views: 4038

Re: how to extract credible intervals

For MCMC models the parameter chains are stored in a chains slot of the returned object, in your case this would be modelstim@chains . You can use the functions provided in the coda package to manipulate these, for example: library(coda) summary(modelstim@chains) will list summary statistics for eac...
by ChrisCharlton
Fri Feb 25, 2022 1:41 pm
Forum: runmlwin user forum
Topic: melogit verse runmlwin
Replies: 4
Views: 5323

Re: melogit verse runmlwin

I asked George if he could think of an explanation for this and he suggested running the model with PQL2 instead of MQL1, as MQL1 variances are biased downwards.
by ChrisCharlton
Thu Feb 24, 2022 1:10 pm
Forum: runmlwin user forum
Topic: melogit verse runmlwin
Replies: 4
Views: 5323

Re: melogit verse runmlwin

You should be able to get this to work if you remove the predictors from the level-1 specification, i.e.: generate id = _n runmlwin depression cons age10, level2(mcsid: cons) level1(id:) discrete(distribution(binomial) link(logit) denominator(cons)) nopause You can find examples of this and other mo...
by ChrisCharlton
Mon Feb 21, 2022 4:34 pm
Forum: R2MLwiN user forum
Topic: Saving Level 2 Residuals When Running Multiple Chains
Replies: 2
Views: 3551

Re: Saving Level 2 Residuals When Running Multiple Chains

Thanks for letting us know about this, the error appears to be due to a bug. I have made a fix in the development version of the package which once the r-forge mirror ( https://github.com/r-forge/r2mlwin/tree/master/R2MLwiN ) has synchronised you should be able to install with the commands: library(...
by ChrisCharlton
Mon Feb 14, 2022 2:21 pm
Forum: runmlwin user forum
Topic: MCMC: calculating estimates, CrIs for combinations of terms/interactions
Replies: 7
Views: 6186

Re: MCMC: calculating estimates, CrIs for combinations of terms/interactions

The p-values reported here are one-tailed bayesian p-values, and essentially give the proportion of the chain that crosses zero (or one if the variable is exponentiated and it is aware of this). You can find the code for this in runmlwin_mcmcdiag.ado , and is as follows: local compval 0 if "`ef...
by ChrisCharlton
Fri Feb 11, 2022 1:55 pm
Forum: runmlwin user forum
Topic: MCMC: calculating estimates, CrIs for combinations of terms/interactions
Replies: 7
Views: 6186

Re: MCMC: calculating estimates, CrIs for combinations of terms/interactions

It should be fairly easy to modify mcmcsum to do this. You can see where the r-class is filled in on lines 535-552 or 410-427 of mcmcsum . To add Bayesian p-values you just need to decide whether you want the mean, median or mode version and add an extra line to return this, i.e. return scalar pvalu...
by ChrisCharlton
Wed Feb 09, 2022 3:48 pm
Forum: MLwiN user forum
Topic: mlnscript for Rocky Linux/OpenBLAS
Replies: 5
Views: 4508

Re: mlnscript for Rocky Linux/OpenBLAS

Thank you for the update, it's useful to know that this method works in this situation.