coxph data format

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

coxph data format

Ehsan Karim
Dear List,

Here is an example of survival data in counting process format
(detailed record of each day)

> data[data$Id == 11,]
# extracted one person's record
    Id Event Fup Start Stop sex Drug1
601 11     0   6     0    1   0     0
602 11     0   6     1    2   0     0
603 11     0   6     2    3   0     0
604 11     0   6     3    4   0     0
605 11     0   6     4    5   0     1
606 11     1   6     5    6   0     1

which is compressed in the following format (unchanged records of drug
exposure merged):

> compressed.data[compressed.data$Id ==11,]
# compressed same person's record
   Id Event Fup Start Stop sex Drug1
21 11     0   6     0    4   0     0
22 11     1   6     4    6   0     1

My question is: since the provided information is the same, should I
expect numerically exactly same results from the following coxph
outputs? If no, then which format is recommended?

> data <- read.csv("http://stat.ubc.ca/~e.karim/dd.csv")
> compressed.data <- read.csv("http://stat.ubc.ca/~e.karim/cd.csv")
> head(data)
> head(compressed.data)
> coef(coxph(Surv(Start, Stop, Event) ~ sex + Drug1 + cluster(Id), robust = T, data))
      sex     Drug1
0.8696213 3.1755854
> coef(coxph(Surv(Start, Stop, Event) ~ sex + Drug1 + cluster(Id), robust = T, compressed.data))
      sex     Drug1
0.8674742 2.7147013

PS: discrete time analogue to Cox's (using cloglog link) also gives
similar results corresponding to the dataset chosen.

Any suggestions/references/direction to R-package will be highly appreciated.

Thanks,

Ehsan

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

svyglm: p-values and confidence intervals contradictory

Ehsan Karim-3
Dear list:

I am getting p-values and confidence intervals contradictory in
svyglm() output from the survey package.

Here is a reproducible example:
https://ehsanx.github.io/SurveyDataAnalysis/#114_Regression_analysis

This problem can be easily fixed by setting appropriate df.resid in
the summary function though. But as a default option, contradictory
p-values and confidence intervals or Inf SEs is probably a bug, or I
may have missed something.

Regards,

Ehsan
https://ehsank.com/
----------------------------
packageVersion("survey")
‘4.0’
R.version
               _
platform       x86_64-w64-mingw32
arch           x86_64
os             mingw32
system         x86_64, mingw32
status
major          4
minor          0.2
year           2020
month          06
day            22
svn rev        78730
language       R
version.string R version 4.0.2 (2020-06-22)
nickname       Taking Off Again

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.