I am trying to do a coxph model with the following code:

coxph.fitR <- coxph(Surv(Survival_test$Recency, Survival_test$Event) ~ Survival_test$Group)

My dataset looks as following: I have a Vector with the times, whether the event occured or not and which Group the individual is associated with. My goal is to find the difference between the two Groups:

structure(list(User = 1:10, Recency = c(30L, 9L, 6L, 77L, 5L, 
3L, 46L, 55L, 64L, 328L), Event = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L), Group = c("A", "B", "A", "B", "B", "B", "A", "B", 
"A", "B")), .Names = c("User", "Recency", "Event", "Group"), class = c("tbl_df", 
"tbl", "data.frame"), row.names = c(NA, -10L), spec = structure(list(
    cols = structure(list(User = structure(list(), class = c("collector_integer", 
    "collector")), Recency = structure(list(), class = c("collector_integer", 
    "collector")), Event = structure(list(), class = c("collector_integer", 
    "collector")), Group = structure(list(), class = c("collector_character", 
    "collector"))), .Names = c("User", "Recency", "Event", "Group"
    )), default = structure(list(), class = c("collector_guess", 
    "collector"))), .Names = c("cols", "default"), class = "col_spec"))

I get the following result and my question: Why do i only get values for the group B and not also for Group A? Or how can i interpret those values?

> coxph.fitR
coxph(formula = Surv(Survival_test$Recency, Survival_test$Event) ~ 

                       coef exp(coef) se(coef)     z    p
Survival_test$GroupB -0.387     0.679    0.717 -0.54 0.59

Likelihood ratio test=0.29  on 1 df, p=0.591
n= 10, number of events= 10 

Excuse me if this is a very obvious question!

  • $\begingroup$ Group A is the reference category. Search this site for "reference category" for many answers. $\endgroup$ – mdewey Aug 9 '17 at 15:14

It's been a while since I've done this, but I believe what is happening is that group A is your baseline model, and so it is showing the difference between group A and B (which is what you originally asked).

i.e. if group A didn't smoke, and group B did and you were measuring survival of lung cancer what it is showing you is the effects of smoking.

  • $\begingroup$ Is this the same case when there is the category listed but with a value NA and Coefficients:(1 not defined because of singularities) ? $\endgroup$ – svnnf Aug 11 '17 at 8:09
  • $\begingroup$ Honestly don't know. My guess with that is that there is only 1 observation in a that category and so you can't draw meaningful results. $\endgroup$ – Beavis Aug 14 '17 at 7:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.