I have two models which I am running across an imputed dataset in order to produce pooled estimates. My understanding is that because both models are ran through hundreds of imputed data frames, I have to pool or essentially "average out" all the regression model estimates into one "overall" estimate. Below are the steps I did:
#1 IMPUTE MASTER DATASET
imputed_data <- mice(master, m=20, maxit=50, seed=5798713)
#2 RUN LINEAR MODEL
model.linear <- with(imputed_data, lm(outcome~exposure+age+gender+weight))
summary(pool(model.linear))
#3 RUN NON-LINEAR RESTRICTED CUBIC SPLINE (3-KNOT) MODEL
model.rcs <- with(imputed_data, lm(outcome~rcs(exposure,3)+age+gender+weight))
summary(pool(model.rcs))
#4 COMPARE BOTH MODELS USING POOL.COMPARE FUNCTION
pool.compare(model.rcs, model.linear)
Both linear and RCS models produce "pooled" estimates, 95% CI's, and p-values once I use the "summary(pool(..)" function. However, the issue is that when I run the "pool.compare" function, I get an error that states:
Error: Model 'fit0' not contained in 'fit1'
In addition: Warning message:
'pool.compare' is deprecated.
Use 'D1' instead.
See help("Deprecated")
I'm confused as to why the model says fit0 is not contained in fit1 when the "exposure", "outcome", and all the covariates listed are the same between the linear and RCS models. Is there an option that I'm missing here?
Any help/guidance would be very appreciated.
P.S. I am unfortunately unable to provide a sample datacut considering how large the imputed dataset is. Let me know how I can better improve my question if there's any confusion.