[R] Problem of data format using function of tmerger()

2019-03-20 Thread wong jane
We want to perform a survival analysis using time-dependent covariates in the Cox regression. In this analysis, ESRD1_END and ESRD1_TIME are the outcome and follow-up time,respectively. AKI_END is a binary time-dependent variable, while AKI_TIME is the time point for AKI_END measurement. The Cox

[R] Fitting problem for Cox model with Strata as interaction term

2018-05-08 Thread wong jane
Dear All, I got a warning message "X matrix deemed to be singular" in Cox model with a time dependent coefficient. In my analysis, the variable "SEX" is a categorical variable which violate the PH assumption in Cox. I first used the survSplit() function to break the data set into different time

[R] How to pass a variable to a function which use variable name as a parameter

2015-05-26 Thread wong jane
There are functions which use variable names as parameters in some R packages. However, if the variable name is stored in another variable, how can I pass this variable to the function. Taking the rms package as an example: library(rms) n - 1000 age - rnorm(n, 50, 10) sex -

[R] Cox regression model for matched data with replacement

2014-06-23 Thread wong jane
My problem was how to build a Cox model for the matched data (1:n) with replacement. Usually, we can use stratified Cox regression model when the data were matched without replacement. However, if the data were matched with replacement, due to the re-use of subjects, we should give a weight for

[R] Restricted Cubic Spline using rms package

2014-02-25 Thread wong jane
I am trying to use restricted cubic spline to examine the association between an independent variable and outcome. When I plot the relationship between HR and the independent variable, I found the HR is not equal to 1 for the specified reference value. For example: dat - read.table(mydata.csv)