Tag Info

9

OK from your R code you are assuming an exponential distribution (constant hazard) for your baseline hazard. Your hazard functions are therefore: $$h\left(t \mid X_i\right) = \begin{cases} \exp{\left(\alpha \beta_0\right)} & \text{if X_i = 0,} \\ \exp{\left(\gamma + \alpha\left(\beta_0+\beta_1+\beta_2 t\right)\right)} & \text{if X_i = 1.} \... 8 Its hard without seeing your data, so I'll try making it generic. First of all, the two main ways that a data frame should look like for the use in the survival package: The bare-bones ID - a unique variable to identify each unit of analysis (e.g., patient, country, organization) Event - a binary variable to indicate the occurrence of the event tested (e.... 6 Edit (The same idea was proposed by Stephan Kolassa a few minutes before I posted my answer. The answer below can still give you some relevant details.) You could use seasonal dummies. For simplicity I illustrate this for a quarterly time series. Seasonal dummies are indicator variables for each season. The i-th seasonal dummy takes on the value 1 for ... 6 If the covariate x_i is strongly associated with the outcome, then you would expect to gain in predictive performance irrespectively of the fact that this covariate is not time-varying. For example, say that x_i is a dummy variable for sex with levels male and female and that there is a big difference in the levels of y_i between the two groups. Then ... 5 Certainly there is. Simply include monthly dummies in an interaction with B_t. Let M_{tm} denote a dummy that is 1 if time t corresponds to month m and 0 otherwise. Then fit the following regression with ARMA errors:$$ G_t = \beta M_{t\cdot} + \gamma B_tM_{t\cdot} + Z_t $$where Z_t is ARMA(p,q) and \beta and \gamma are parameter vectors of ... 5 The short answer is that no, you do not have to. The explanation is in the documentation of the survival package. See vignette("timedep", package = "survival"). The main reasoning is that an individual is at risk only in disjoint time intervals. Since the Cox partial likelihood is a sum over event time points, at each of those time points an individual may ... 4 If you don't want to discretise the seasonal effect, you could assume that the regression coefficients vary in a cyclic manner as a function of the time of year, i.e. \beta_0(t) = w_0 + w_1\sin nt + w_2\cos nt and \beta_1(t) = w_3 + w_4\sin nt + w_5\cos nt, then if you substitute these into your linear model, you should get something of the form G_t = ... 4 I'm also working with data that involves including a time varying covariate. I'll start off this answer by giving an example that I'll use throughout. Say we have a longitudinal study where there are two treatments available, treatment and non-treatment. Participants in the study can freely move between the two. The event of interest will be called event.... 4 You are still assuming that the effect of the value at each covariates/factor at each timepoint is the same, you simply allow the covariate to vary its value over time (but the change in the log-hazard rate associated with a particular value is still exactly the same across all timepoints). Thus, it does not change the assumption. Or was the presenter ... 4 I may be wrong but I believe that Björn's answer is not completely correct. The proportional hazards assumption means that the ratio of the hazard for a particular group of observations (determined by the values of the covariates) to the baseline hazard (when all covariates are zero) is constant over time. If there are time-varying covariates this is not ... 4 It seems that your question concerns not the specific R function coxph, but survival models in general. The vignette, when speaking about "covariate values of each subject just prior to the event time", refers to the hazard function h(t). This function in fact only takes into account the current values of covariates, and determines the risk for individuals ... 4 This is a situation with recurrent events (i.e., possibly more than one) and time-dependent covariates, which with some care can be handled pretty easily. For example, this can be done in R with the coxph() function in the survival package--if your data are formatted correctly. You need to specify your data with separate lines for time intervals of interest ... 4 If we add time-dependent covariates or interactions with time to the Cox proportional hazards model, then it is not a “proportional hazards” model any longer. See this presentation: http://ms.uky.edu/~mai/sta635/Cox%20model.pdf or this lecture notes: http://www.math.ucsd.edu/~rxu/math284/slect7.pdf But this is a widely known feature. 4 Calculating predicted probabilities using a Cox model There is a way of obtaining prediction out of a Cox model, as survival probability at time t (S(t)) depends on your cox model like so: S(t) = e^{-H_0(t) * LP} in this formula H_0(t) is called the baseline hazard at time t; and LP is the linear predictor. If X_i are the predictor ... 4 I would suggest to match only on pre-treatment variables and not on post-treatment variables. If we match on post-treatment variables it is extremely plausible we induce selection bias in our sample and thus we get bogus insights. Selection bias can appear when one of the variables C we use in matching is related to the treatment A as well as the outcome ... 3 Your second attempt defines an entirely different model than the first. In your first attempt you are creating an object in which V and W are not matrices, as they should be. Better use the constructor function dlm that will take care of those details for you, rather than using list. 3 The short answer is: you do need the "main", i.e. non-time varying effect of the covariate. Based on the help file forstccreg, if X is declared a time-dependent covariate, then the time-dependence is modeled parametrically as X(t) = X\cdot f(t), where the default is f(t)=t. That means that at time 0, the time-dependent portion has no effect, and then ... 3 Cox models allow for staggered entry of at-risk participants into a prospective cohort, regardless of who died prior to the onset of data collection. The only requirement is that you know when they received the transplant and/or received the post-transplant conversion. Risk sets will omit left-truncated participants at failure-times prior to the conversion. ... 3 This is a model in which you control for a state-by-state linear time trend as well as variations from that trend that are common to all states at each individual time. To see this, consider some synthetic data generated according to this model. (The method to create them is described at the end of this post.) It consists of five observations in each of ... 2 You can plot the martingale residuals for each subject. For me deviance residuals are more clear, both can be computed in R. dev <- resid(fit,type = "deviance") In particular, these plots will enable outlying observations to be identified. However, diagnostic plots for covariates are not so useful because there are a number of tdc for any, and it is ... 2 Setting up time-interactions First you need to split your dataset in order to do the time interaction. Then you set the start-time as the interaction term as that is independent of the outcome. Decreasing/increasing Yes, it is either decreasing or increasing with time although note that you also need to take into account the raw variable. There are two ... 2 If your dynamic system is$$ x_t = A_t x_{t-1} + \eta_t  y_t = B_t x_t + \varepsilon_t $$Then when people say system matrices A_t, B_t should be deterministic, this means that Kalman Filter gives you an estimate of state x_t conditional on past and current values of parameters$$\mathbf E\left(x_t|\,y_t,\dots,y_1, \,A_t,\dots,A_1, \,B_t, \dots, ...

2

Yes, the concept of non-linear cointegration has been introduced in the litterature, and there are various authors who adressed the case of time varying cointegration. Look for example at: Bierens, Martins, Time Varying Cointegration, Econometric Theory, 2010, Page 1 of 38 Park, Hahn, Cointegrating Regressions With Time Varying Coefficients, Econometric ...

2

First of - Yes, an extended Cox model can handle time dependent covariates (and coefficients) with ease, and with no change to the underlying model. Mind you that the data set needs to reflect this time dependency. For example: subject time1 time2 event var1 var2 1 0 15 0 25 1.3 1 15 46 0 25 1.5 1 46 ...

2

Fit the mean and the harmonics of the seasonal cycle to the time series of x and y. These provide the intercept terms. Then, subtract them from x and y to create anomalies. Use these anomalies x' and y' to compute seasonally varying regression slope coefficients: Fit the array product between the x' and y' with the mean and leading harmonics to the seasonal ...

2

Whether or not all observations are uncensored does not affect the interpretation of a hazard ratio. The hazard ratio is an instantaneous event rate, roughly speaking the probability of having an event within a small interval of time around time $t$ divided by the probability of not having the event before time $t$. Hazard ratios are ratios of such ...

2

Here I will assume that your state space model is the general linear Gaussian one and that $$y_{t} = Z_{t}\alpha_{t} + \epsilon_{t}, \;\;\;\;\;\; \epsilon_{t} \sim N(0, H_{t}),$$ and $$\alpha_{t + 1} = T_{t}\alpha_{t} + R_{t}\eta_{t}, \;\;\;\;\;\ \eta_{t} \sim N(0, Q_{t}),\;\;\;\;\;\; \forall t = 1, \ldots, n.$$ where $\alpha_{t}$ is our unknown state ...

2

The interpretation is essentially the same as with non-timevarying covariates. The model is $h(t|Z(t)) = h_0(t) \exp(\beta Z(t))$, so $\exp(\beta)$ measures the hazard ratio of having a "current" value of $Z$ that is one unit larger. This effect is modeled as being time-invariant. Given the extreme hazard ratios in your model, your predictors likely have a ...

2

Some assumptions need to be made to extrapolate (far) beyond the range of the data you have. These assumptions could either be parametric models or something like repeating the hazard of the last year (or last 2 years) over and over. The latter approach is quite a strong assumption (more or less extrapolation with an exponential distribution based on the ...

2

I removed classification from your title and text because classification has absolutely nothing to do with this problem. You are interested in prediction/modeling of probabilities. Once you stack the dataset tall and thin as suggested by @DJohnson, you have many options. An extremely flexible approach is called pooled logistic regression or repeated ...

Only top voted, non community-wiki answers of a minimum length are eligible