Skip to content
Prev 17944 / 20628 Next

Export several lme outputs to a single excel file

Dear users,
it is not such an statistical question but how to export results
I fit several *lme* model s and I know how can I export the data to excel,
this way:
lme1 <- lme(Mean ~ x*y, data = Data, random = ~ 1|factor(ID))
anova(lme1)->resultslme1
And to export to excel since keep the data in ordered in rows/columns
write.xlsx( resultslme1  ,"C:/Users/Desktop/resultslme1.xlsx")

What I want to do is to export output from several lme at the same time,
and adding the name/reference of the model. Something like this
lme1
  numDF denDF F.value p.value
(Intercept) 1 78 653,6152 0
x 2 78 0,822612 0,443057
y 2 39 0,479357 0,622781
x:y 4 78 2,593825 0,042787

lme2
  numDF denDF F.value p.value
(Intercept) 1 78 653,6152 0
x 2 78 0,822612 0,443057
y 2 39 0,479357 0,622781
x:y 4 78 2,593825 0,042787


I tried with merge, abind, paste,... but I did not find the solution

Thanks in advance