Description Usage Arguments Value See Also Examples

For a longitudinal dataset subject to irregular observation, use a Cox proportional hazards model for visit intensities to compute inverse intensity weights

1 |

`phfit` |
coxph object for the visit process |

`data` |
The dataset featuring longitudinal data subject to irregular observation for which inverse-intensity weights are desired |

`id` |
character string indicating which column of the data identifies subjects |

`time` |
character string indicating which column of the data contains the time at which the visit occurred |

`first` |
logical variable. If TRUE, the first observation for each individual is assigned an intensity of 1. This is appropriate if the first visit is a baseline visit at which recruitment to the study occurred; in this case the baseline visit is observed with probability 1. |

A vector of inverse-intensity weights for each row of the dataset. The first observation for each subject is assumed to have an intensity of 1.

Other iiw: `iiw.weights`

, `iiwgee`

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
library(nlme)
data(Phenobarb)
library(survival)
library(geepack)
Phenobarb$id <- as.numeric(Phenobarb$Subject)
Phenobarb$event <- as.numeric(is.finite(Phenobarb$conc))
Phenobarb.conc <- Phenobarb[is.finite(Phenobarb$conc),]
Phenobarb.conc <- lagfn(Phenobarb.conc,c("time","conc"),"id","time")
mph <- coxph(Surv(time.lag,time,event)~I(conc.lag>0) + conc.lag + cluster(id),data=Phenobarb.conc)
summary(mph)
Phenobarb.conc$weight <- iiw(mph,Phenobarb.conc,"id","time",TRUE)
head(Phenobarb)
``` |

IrregLong documentation built on May 2, 2019, 8:30 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.