I am currently working on a multilevel model with a high number of variables and interaction terms. So far I have used the plotLMER3d.fnc-function of the LMERConvenienceFunctions-package to obtain 3D plots for some of these interactions. Unfortunately, as I add more variables to the regressions, I receive an error message:
fit3_plot <- lmer(OTIF ~ FtO* Variability + FtO* COLT2 + Products *FtO + FtO *Age4 + Products *FtO + Orders2*FtO + Age2*Variability +COLT2*Variability + COLT2*Age2 + COLT2*Products + COLT2*OpC + (1 | BU) + (1 | BU:RBU_SBU), data = Data4)
plotLMER3d.fnc(fit3_plot, pred = "Variability", intr = "COLT2", plot.type = "persp", phi = 25, theta=90)
Error in gzfile(file, "wb") : cannot open the connection
In addition: Warning message:
In gzfile(file, "wb") : cannot open compressed file 'C:\Users\XXX\AppData\Local\Temp\RtmpKEw4FX/lmer___OTIF_FtO_Variability__FtO_COLT2__Products_FtO__FtO_Age4__Products_FtO__Orders2_FtO__Age2_Variability__COLT2_Variability__COLT2_Age2__COLT2_Products__COLT2_OpC__WWW1_BUWWW__WWW1_BU_RBU_SBUWWW___Data4___Variability_COLT2.rda', probable reason 'No such file or directory'
However, when I delete the first 6 interactions from the regression, I am able to obtain a plot.
Does somebody have an idea on how to resolve this issue? I would be very grateful!
Best,
Christian
the problem is that plotLMER3d.fnc saves a temporary .rda file with a too long file name. In windows for example the maximum length of a path is limited to 260 characters. As a result the function can't retrieve the .rda file. You can solve the problem by changing the file name using the plot.data argument: e.g. plot.dat = "my_plotting.data"