Changelog
Source:NEWS.md
pcdreg 0.1.0
First release.
pcdreg()fits the semiparametric proportional rate model for panel count data with time-varying covariates, using the EM algorithm of Sun et al. (2024).pcdreg(model = "mean")fits the proportional means model by the estimating equation of Hu, Sun and Wei (2003). It is the comparator used in the application of Sun et al. (2024), and is included so that the two model families can be compared on the same data. Note that the two are not reparametrisations of each other when covariates vary over time, and that the fitted mean function is not constrained to increase.Covariance estimation for the rate model follows the paper directly.
vcov()supportstype = "robust"(the sandwich estimator, consistent without the Poisson assumption),type = "information"(the efficient information estimator), andtype = "profile"(the Murphy–van der Vaart profile likelihood estimator, computed only when requested viapcdreg(profile = TRUE)). The means model has no likelihood, so only the sandwich estimator is available for it.Model specification uses
pcd()on the left hand side of the formula, following theSurv()convention:pcd(id, time, count)for examination-time rows andpcd(id, tstart, tstop, count)for counting-process rows carrying time-varying covariates.Both fitters return an object inheriting from
"pcdfit", socoef(),vcov(),confint(),summary(),baseline(),predict()andplot()work the same way for either.tidy(),glance()andaugment()methods are provided for the broom generics.tidy()takes the sametypeargument asvcov(), so the tidy path reports the same standard errors assummary().augment()adds the fitted mean, the observed cumulative count and their difference to each row.sim_pcd()simulates from the design of the paper’s simulation study.autoplot()methods returnggplotobjects for the data, drawn as one tile per examination interval shaded by its count, and for the fitted baseline.plot()draws them and returns the object invisibly.baseline(),predict(type = "mean")andsim_pcd()return tibbles.Errors, warnings and messages use cli and carry condition classes, so a particular failure can be caught with
tryCatch()rather than by matching on message text.