Dear R users, I am building a hierarchical model on a large data set. It can take quite some time to finish one fit, I was just wondering whether it is possible to store the fit object (the result) to a file for later (offline) analysis. thanks Julia -- View this message in context: http://www.nabble.com/how-to-store-lme-lmer-fit-result-tp19910951p19910951.html Sent from the R help mailing list archive at Nabble.com.
liujb <liujulia7 <at> yahoo.com> writes:> I am building a hierarchical model on a large data set. It can take quite > some time to finish one fit, I was just wondering whether it is possible to > store the fit object (the result) to a file for later (offline) analysis.Like with any other R object, you can use save and load for this. Dieter
> I am building a hierarchical model on a large data set. It can takequite> some time to finish one fit, I was just wondering whether it is possibleto> store the fit object (the result) to a file for later (offline)analysis. See ?save. Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}
Dear Julia, I think the best thing to do is to save your workspace, including all your objects. This works conveniently using the drop-down menu on Windows. Alternatively, you can use sink(), for example using the Windows clibboard: sink("clipboard") summary(...) # your object(s) here sink() Best wishes Christoph liujb schrieb:> Dear R users, > > I am building a hierarchical model on a large data set. It can take quite > some time to finish one fit, I was just wondering whether it is possible to > store the fit object (the result) to a file for later (offline) analysis. > > thanks > Julia
On Thu, Oct 9, 2008 at 8:51 PM, liujb <liujulia7 at yahoo.com> wrote:> Dear R users,> I am building a hierarchical model on a large data set. It can take quite > some time to finish one fit, I was just wondering whether it is possible to > store the fit object (the result) to a file for later (offline) analysis.As others have suggested, you can use save/load to save and restore the fitted model. However, there is a problem with trying to save and load a model fit by lmer. These are S4 classed objects and can only be reloaded in a version of the lme4 package with the same definition of the S4 class. Unfortunately, as I develop the computing methods I change the class definition to reflect the newer approach. This can mean that you can restore a model fit with a previous version of the lme4 package but you can't do anything with it. I regret that this happens but I do feel that the changes ultimately are beneficial. The best advice is that, in addition to saving the fitted model, you should also save the original data and a copy of the code that was used to fit the model. An alternative is to save a copy of the lme4 package and the Matrix package along with the saved model so you can downdate those packages if necessary. This may be tricky because of dependencies between packages that may prevent downdating some but not all packages.