JPF
2011-Aug-21 17:42 UTC
[R] pooled hazard model with aftreg and time-dependent variables
Dear R-users, I have two samples with individuals that are in more than one of the samples and individuals that are only in one sample. I have been trying to do a pooled hazard model, stacking one sample below the other, with aftreg and time-dependent covariates. The idea behind is to see aggregate effects of covariates, but need to control for ther effects of same individuals in both samples and the samples themselves. I created two variables for this purpose: a variable representing individuals, as a factor, and a variable for each sample, and included them in the model. I provide an example below. If I include the factor sample the analysis works. If I include both sample + individual like this:>> weibullaft<-aftreg(Surv(sta,time,S) ~ TDC1 + TIC1 + sample + individual, >> dist="weibull", >> data.frame=Data, id=ID), it appears an error with aftreg saying: Error in solve.default(fit$hessian) : Lapack routine dgesv: system is exactly singular With phreg the error is: fail in [dsytrf]; info = 14 1 - I am probably doing something wrong. Any suggestion to control for individuals too would be highly appreciated. 2 - Is including factor(sample) enough to control for the samples? Data S sta time TDC1 total_time TIC1 ID sample individual A 1 0 1 48.50 1 1 1 1 1 B 0 0 1 65.96 2 1 2 1 2 B 1 1 2 65.08 2 1 2 1 2 C 0 0 1 0.00 2 4 3 1 3 C 1 1 2 0.00 2 4 3 1 3 D 0 0 1 72.74 2 5 4 1 4 D 1 1 2 72.52 2 5 4 1 4 E 0 0 1 61.84 2 3 5 1 5 E 0 1 2 60.56 2 3 5 1 5 F 0 0 1 35.04 4 2 6 1 6 F 0 1 2 36.97 4 2 6 1 6 F 0 2 3 37.92 4 2 6 1 6 F 1 3 4 39.01 4 2 6 1 6 G 0 0 1 15.96 2 4 7 2 7 G 1 1 2 15.08 2 4 7 2 7 H 0 0 1 33.04 2 2 8 2 8 H 0 1 2 39.97 2 2 8 2 8 D 0 0 1 75-34 2 5 9 2 4 D 0 1 2 76.99 2 5 9 2 4 E 0 0 1 70.45 2 3 10 2 5 E 1 1 2 45.01 2 3 10 2 5 F 0 0 1 35.04 4 2 11 2 6 F 1 1 2 36.97 4 2 11 2 6 time - time to event sta - starting time TDC - time dependent covariates TIC - time independent covariate total_time - total time at risk ID - ID Individual - as.factor code for individual Sample - as.factor code for sample thanks, J -- View this message in context: http://r.789695.n4.nabble.com/pooled-hazard-model-with-aftreg-and-time-dependent-variables-tp3758805p3758805.html Sent from the R help mailing list archive at Nabble.com.
JPF
2011-Aug-22 15:16 UTC
[R] pooled hazard model with aftreg and time-dependent variables
In STATA, multiple observations correspond to the same individual, the cluster( ) option can be employed to request that the analysis be clustered by individual. Any suggestion with aftreg? Thanks, J -- View this message in context: http://r.789695.n4.nabble.com/pooled-hazard-model-with-aftreg-and-time-dependent-variables-tp3758805p3760440.html Sent from the R help mailing list archive at Nabble.com.
JPF
2011-Aug-25 02:45 UTC
[R] pooled hazard model with aftreg and time-dependent variables
This is for coxph: The cluster term is used to compute a robust variance for the model. The term + cluster(id) where each value of id is unique is equivalent to specifying the robust=T argument, and produces an approximate jackknife estimate of the variance. If the id variable were not unique, but instead identifies clusters of correlated observations, then the variance estimate is based on a grouped jackknife. How could be done using aftreg? and/or phreg? -- View this message in context: http://r.789695.n4.nabble.com/pooled-hazard-model-with-aftreg-and-time-dependent-variables-tp3758805p3767222.html Sent from the R help mailing list archive at Nabble.com.
Göran Broström
2011-Aug-26 19:24 UTC
[R] pooled hazard model with aftreg and time-dependent variables
On Thu, Aug 25, 2011 at 4:45 AM, JPF <xpfenech at gmail.com> wrote:> This is for coxph: > > The cluster term is used to compute a robust variance for the model. The > term + cluster(id) where each value of id is unique is equivalent to > specifying the robust=T argument, and produces an approximate jackknife > estimate of the variance. If the id variable were not unique, but instead > identifies clusters of correlated observations, then the variance estimate > is based on a grouped jackknife. > > How could be done using aftreg? and/or phreg?No, G?ran> > -- > View this message in context: http://r.789695.n4.nabble.com/pooled-hazard-model-with-aftreg-and-time-dependent-variables-tp3758805p3767222.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. >-- G?ran Brostr?m
Reasonably Related Threads
- eha aftreg performance
- survreg vs. aftreg (eha) - the relationship between fitted coefficients?
- "Non-finite finite-difference value" error in eha's aftreg
- Extract p-value from aftreg object
- aftreg vs survreg loglogistic aft model (different intercept term)