Skip to content

tmerge #3

@IKRAMTUN

Description

@IKRAMTUN

I have a problem merging two data with repetitive measurements.
The merging did not include the second measurment.

library(survival)
data1<- data.frame(
subject = c(1, 2, 3),
time1 = c(3, 2, 2),
time2= c(4, 8, 6),
status = c(1, 0, 1),
First_measu=c(54, 66, 18))

data2<- data.frame(
subject = c(1, 2, 3),
Second_measu=c(66, 73, 82))

###Merge the data to do the coxph

merged_data<-tmerge(data1, data2, id=subject, tstart=time1, tstop=time2)
print(merged_data)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions