Hi,
What S3 or S4 method is a R2mlwin object? I am specifically thinking about what arguments I can use for the linearHypothesis() function in the car package.
Related to this question, can one generally pass R2mlwin objects to other packages, e.g. the effects package? I know that R2mlwin object (if estimated with IGLS) is of class "mlwinfitIGLS". But I wonder if there some generality build in to mlwinfitIGLS similar to that of e.g. a lm objec?
Thanks
what S3 or S4 method is a R2mlwin object?
-
- Posts: 1384
- Joined: Mon Oct 19, 2009 10:34 am
Re: what S3 or S4 method is a R2mlwin object?
When you call R2MLwiN you get back an mlwinfitIGLS S4 object if you fit the model using IGLS, an miwinfitMCMC S4 object if you fit the model using the MLwiN MCMC engine or an mcmc.list (defined by the coda package) object if you use it to generate and call BUGS code. As far as I am aware no other packages directly understand the R2MLwiN specific classes, however we do implement a number of R generic functions (e.g. coef and nobs) which allow them to be used by third party packages in functions such as linearHypothesis. Whether this works for individual packages will depend on whether we have implemented enough of the generic functions that can use.
Re: what S3 or S4 method is a R2mlwin object?
Thanks, Chris, for the clarification.
Are the specific R generic functions listed somewhere for the users reference? Would be great to have them a a guid.however we do implement a number of R generic functions (e.g. coef and nobs) which allow them to be used by third party packages in functions such as linearHypothesis. Whether this works for individual packages will depend on whether we have implemented enough of the generic functions that can use.
-
- Posts: 1384
- Joined: Mon Oct 19, 2009 10:34 am
Re: what S3 or S4 method is a R2mlwin object?
We don't currently list these altogether explicitly, however if you look in the PDF version of the documentation (https://cran.r-project.org/web/packages ... 2MLwiN.pdf) you will see that the methods for the IGLS classes all have mlwinfitIGLS-method in their names, and the MCMC ones have mlwinfitMCMC-method. You could also look directly at the code for these classes (e.g. https://github.com/rforge/r2mlwin/blob/ ... nfitIGLS.R) where you will see these defined with a setMethod function.