Estimates sampling probabilities with logistic regression. The weights included in the Cox-regressions (wpl) and which could be used for other procedures are inverse sampling probabilities i.e. the inverse of these probabilities. The probabilties are estimated for all subjects in the cohort.

`survtime`

, `left.time`

and continuous matching variables are
included in the logistic regression as continuous variables while
categorical matching variables are taken as factors.

1 | ```
GLMprob(survtime, samplestat, left.time = 0, match.var = 0, match.int = 0)
``` |

`survtime` |
Follow-up time for all cohort subjects |

`samplestat` |
A vector containing sampling and status information: 0 represents non-sampled subjects in the cohort, 1: sampled controls, 2,3,... indicate different events. Cohort dimension. |

`left.time` |
Entry time if the survival times are left-truncated. Cohort dimension. |

`match.var` |
If the controls are matched to the cases (on other variables than time), match.var is the vector of matching variables. Cohort dimension. |

`match.int` |
A vector of length 2*number of matching variables. For caliper matching (matched on value pluss/minus epsilon) match.int should consist of c(-epsilon,epsilon). For exact matching match.int should consist of c(0,0). |

A vector of cohort dimension of sampling probabilities.

Nathalie C. Stoer

Stoer NC and Samuelsen SO (2013): Inverse probability weighting in nested case-control studies with additional matching - a simulation study. Statistics in Medicine, 32(30), 5328-5339.

`wpl`

, `coxph`

, `Chenprob`

, `GAMprob`

,
`KMprob`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
data(CVD_Accidents)
attach(CVD_Accidents)
GLMprob(agestop,samplestat,agestart)
GLMprob(agestop,samplestat,agestart,match.var=cbind(sex,bmi),match.int=c(0,0,-2,2))
## The function is currently defined as
function (survtime, samplestat, left.time = 0, match.var = 0,
match.int = 0)
{
n.cohort = length(survtime)
status = rep(0, n.cohort)
status[samplestat > 1] = 1
samplestat[samplestat > 1] = 1
pglm = pGLM(status, survtime, samplestat, n.cohort, left.time,
match.var, match.int)
p = rep(1, n.cohort)
p[status == 0] = pglm
p
}
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

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.