Problem

I am using R 3.3.3 on Windows 10 (x64 bit). I get the following prediction output from the glmmPQL prediction function as follows:

library(MASS) library(nlme) library(dplyr)

model<-glmmPQL(a ~ b + c + d, data = trainingDataSet, family = binomial, random = list( ~ 1 | e), correlation = corAR1())

The prediction values are given as follows:

p <- predict(model, newdata=testingDataSet, type="response",level=0) (1.0)

The output it gives is as follows:

I then try to measure the performance of this output using the following code:

pr <- prediction(p, testingDataSet$a) (1.1)

It gives us the following error as follows:

Error in prediction(p, testingDataSet$a) : Format of predictions is invalid. (1.2)

I have successfully been able to use the prediction method in R using other functions (glm,svm,nn) when the data looks something like as follows:

model<-glm(a ~ b + c + e, family = binomial(link = 'logit'), data = trainingDataSet)

p <- predict(model, newdata=testingDataSet, type="response") (1.3)

Attempts

I believe the fix to the above problem is to get it into the format shown below (1.3). I have tried the following things using R and have been failing.

I have tried casting p in 1.0 using as.numeric() and as.list() and other things. I want to get look like the p R object in 1.3 . In other words, I believe the format is reason why things not working for me?

No matter what mutate or casting I try, I can't seem to get it into the form in 1.3 and image shown as desired. Especially with the index as columns features. I'm coming up empty handed on stackoverflow and the R help files. When I use the command class(p) both tell me they are numeric.

Question

Give the above, can someone tell me how I can use R to get the output from glmmPQL in a format that the prediction function can use as shown above please?