# Re: [R] nested case-control study

From: array chip <arrayprofile_at_yahoo.com>
Date: Mon, 28 Feb 2011 17:02:54 -0800 (PST)

Terry, thanks very much!

Professor Langholz used a SAS software trick to estimate absolute risk by creating a fake variable "entry_time" that is 0.001 less than the variable "exit_time" (i.e. time to event), and then use both variables in Phreg. Is this equivalent to your creating a dummy survival with time=1?

Another question is, is using offset(logweight) inside the formula of coxph() the same as using weight=logweight argument in coxph(), because my understanding of Professor Langholz's approach for nested case-control study is weighted regression?

Thank you very much for the help.

John

From: Terry Therneau <therneau_at_mayo.edu>

Cc: r-help_at_r-project.org
Sent: Mon, February 28, 2011 6:59:23 AM
Subject: Re: [R] nested case-control study

> Hi, I am wondering if there is a package for doing conditional
logistic
> regression for nested case-control study as described in "Estimation
of
> absolute
> risk from nested case-control data" by Langholz and Borgan (1997)
where
> Horvitz-Thompson sampling weight (log of (number in the risk set
divided by
> the
> number sampled)) is used with regression. In SAS Proc Phreg, this is
> implemented
> as an offset (offset=logweight). I checked clogistic() in Epi package
and
> clogit() in survival package, but couldn't figure out how to
incorporate
> this
> weighting with either.
>

The clogit command is simply a wrapper for coxph. To fit a nested case-control model directly with coxph:

1. Create a dummy surival with time=1 (or any number you like) and status = 1 for case, 0 for control.
2. Create a group vector such that each case-control set is one group.
3. coxph(dummy ~ x1 + x2 + .... + strata(grp), data=mydata)

You now can use the offset statement just as you did in phreg. In fact, doing this directly in coxph is exactly like doing it directly in phreg. (The last time I looked the phreg manual proposed a more complex rule for creating the dummy time/status pair. It also works but no differently than the simple one above.)

```
[[alternative HTML version deleted]]

______________________________________________
```
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 01 Mar 2011 - 01:04:53 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 01 Mar 2011 - 13:50:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.