--- begin included messge --- Assume that we collect below data : - subjects = 20 males + 20 females, every single individual is independence, and difference events = 1, 2, 3... n covariates = 4 blood types A, B, AB, O
http://r.789695.n4.nabble.com/file/n4245397/CodeCogsEqn.jpeg ?m = hazards rates for male ?n = hazards rates for female Wm = Wn x ?, frailty for males, where ? is the edge ratio of male compare to female Wn = frailty for females X = covariates, blood types effects ? = coefficients of blood types I would like to apply frailty model to get below results:- 1) 1 edge ratio between male and female ? 2) 4 coefficient values of blood types ? Under this situation, shall I use which package (coxme or frailtypack)? will coxme function able to cope with it? --------- end inclusion ------- Could you clarify your question? First, the above is rather hard to read with all the misisng symbols. Now coxme fits the model \lambda_i(t) = \lambda_0(t) exp(X beta + Z b) b ~ N(0, A) beta = fixed effects coef X = covariate matrix for fixed effects b= random effects coefs, Z= covariate matrix for random effects (Bear with the latex-like notation, at least it's simple text for a mailer). There are several possible models of interest for your data: No random effect: coxph(Surv(time, status) ~ bloodtype + sex) Random sex effect: coxme(Surv(time, status) ~ bloodtype + (1|sex)) But does your data set have multiple events per subject? (I'm not sure what you mean by "difference events".) If it does then neither of the above is good, since they do not account for correlation within subject. The simple Cox model is easy to correct by adding "+ cluster(id)" to the model where id is a variable that identifies individual subjects. The random effect model needs to have a per-subject random effect. That leads to two more models fixed sex effect + random subject effect random subject effect, but with different variance for the males & females. What are you trying to do? Terry Therneau ______________________________________________ R-help@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.