'R module Prediction generates an error after Parglm
My runs are taking several hours, and I would like to take advantage of the multiprocessor capabilities of the R module PARGLM in conjunction with the PREDICTION module, but the PREDICTION module generates the following error after a PARGLM call. It runs fine after the GLM call.
Error in qr.R(qr.lm(object)) : argument is not a QR decomposition
Is there a way around this?
Thanks.
Bob
Toy example below:
library(parglm)
library(prediction)
library(sandwich)
a <- structure(list(Family = c(1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3,
4, 4, 4, 4, 4, 2),
Sex = c("F", "F", "F", "M", "M", "F", "F",
"M", "M", "M", "F", "M", "F", "F", "M", "M", "M", "F"),
Height = c(67, 66, 64, 71, 72, 63, 67, 69, 68, 70, 63, 64, 67, 66, 67, 69, 67, 63)),
row.names = c(NA, 18L), class = "data.frame")
**Call to GLM**
fit <- glm(Height~Sex,
family=Gamma(link="log"),
data=a
)
v<-vcovCL(fit,cluster=a$Family)
summary(prediction(fit,data=a,vcov=v),type = "link")
Prediction SE z p lower upper 66.83 0.6002 111.4 0 65.66 68.01
**Call to PARGLM**
fit <- parglm(Height~Sex,
data=a, family=Gamma(link="log"), cluster="Family",
control = parglm.control(nthreads = 1L)
)
v<-vcovCL(fit,cluster=a$Family)
summary(prediction(fit,data=a,vcov=v),type = "link")
Error in qr.R(qr.lm(object)) : argument is not a QR decomposition
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
