I'm trying to generate a calibration plot and its associated statistics using the vap.prob.ci.2 command in Calibration Curves on RStudio with the following code:

LRModel_CCA1_CV <- lrm(delirium2 ~ agenum  + asa2 + cogimpair2 + infection2 + optime + casetype + anestype3,
                       data = PUF21CCA,     #PUF21CCA is a dataframe with >60000 observations
                       x = TRUE, y = TRUE)
predicted_probabilities <- predict(LRModel_CCA1_CV, newdata = PUF21CCA, type = "fitted") 
 
CalibrationCurves::val.prob.ci.2( p= predicted_probabilities, y = PUF21CCA$delirium2)

It generates the following error:your text Error in double(N * M1) : vector size cannot be NA In addition: Warning message: In N * M1 : NAs produced by integer overflow

I know the dataset and coding are appropriate because when I run the same code on a subset of the dataframe PUF21CCA using:

 original_size <- nrow(PUF21CCA)
 subset_size <- ceiling(original_size / 3)
 subset.PUF21CCA <- PUF21CCA[sample(nrow(PUF21CCA), subset_size, replace = FALSE), ]

It works perfectly and generates the plot. I've tried the gmp package and Rmpfr packages to change the datatype for integer overflow but that did not yield any solutions. The Rmpfr approach just resulted in a computation that ran all night long without a result and the gmp approach just yielded:

delirium_bigz <- as.bigz(PUF21CCA$delirium2)
CalibrationCurves::val.prob.ci.2(p = predicted_bigz, y = delirium_bigz)

Error in log.default(p/(1 - p)) : non-numeric argument to mathematical function

I've been at this for a few days now so any help would be appreciated. I feel like I'm missing something obvious.

0

There are 0 best solutions below