[R] Unexpected error message when making predictions from fitted PWP-CP (Cox) model

Bonnett, Laura L.J.Bonnett at liverpool.ac.uk
Mon Apr 3 11:51:43 CEST 2017


Dear all,

I am using R x64 3.3.2 on Windows 10.

I have fitted a Prentice-Williams-Peterson counting process model with a number of covariates as follows:
Coxmod1 <- coxph(Surv(start,stop,status)~var1+var2+factor(var3)+cluster(var4)+strata(var5),data=Lauras)

I would now like to make predictions based on either a subset of patients from the original data set, or a new patient with randomly selected characteristics.
I have used the following code for both scenario:
Original dataset:
Subset1 <- subset(Lauras,(var1=="M") & (var2==2) & (var3<=10))
Output1 <- predict(Coxmod1,Subset1,type="expected",se.fit=TRUE)

New patient:
Subset2 <- (0, 365, 1, "M", 2, 10, "A001", 12)
Output2 <- predict(Coxmod1,Subset2,type="expected",se.fit=TRUE)

In both cases I receive in excess of 50 warnings which all state:
1: In min(diff(time)) : no non-missing arguments to min; returning Inf

The outputted predictions contain a surprisingly high number of 1s, as a result of "returning Inf" I assume.  However, the characteristics for the patients with a prediction of 1 are not unusual i.e. there are no missing values etc.

Can anyone suggest what might be causing these warning messages, and what steps I can take to prevent them reoccurring as they are causing predictions for every patient subgroup to have the same summary statistics.

Kind regards,
Laura



	[[alternative HTML version deleted]]



More information about the R-help mailing list