```
#########Fake imputed data set######
library(MASS)
mydata<-data.frame(mvrnorm(1000, rep(0,3), matrix(c(1,.5,.3,
.5,1,.25,
.3, .25,1),3)))
mydata$imp<-rep(1:10, each=100)
############################################
#######Regression separately by imputations and save results##
# simple regression model y~x1 + x2
results<-sapply(split(mydata, mydata$imp), function(x) summary(lm(x[,1]~x[,2]+x[,3]))$coef[,1:2])
results<-t(results)
colnames(results)<-c('int.est',"x1.est","x2.est","int.se","x1.se","x2.se")
#############################################
##Pooled estimates####
#POOLED Point estimates
colMeans(results[,c(1:3)])
#Pooled standard errors
colMeans(results[,c(4:6)]) + (1+1/10)*(apply(results[,c(1:3)],2, var))
```