# Cox regression - non-time dependent continuous covariate deemed singular

I have this model I want to run that has no main treatment effect because I subsetted the data just to look at this one treatment (For example I have 1200 points from three treatments: control, shelter and water, and this is only shelter).

stdsheltercox <- coxph(Surv(Time, Event, type = c('right')) ~
st.Area+st.Growth_Rate+st.SLA+st.VLA+st.Thickness+PD10,  data = SMeans)

Warning messages:
1: In coxph(Y ~ X[, assign <= alevels[i]]) :
X matrix deemed to be singular; variable 5
2: In coxph(Y ~ X[, assign <= alevels[i]]) :
X matrix deemed to be singular; variable 5 6
3: In coxph(Y ~ X[, assign <= alevels[i]]) :
X matrix deemed to be singular; variable 5 6 7


It doesn't matter what I do, if I put more than five covariates the following covariates are always deemed singular

I am wondering how I can see the effect of covariates if I have no main treatment for all covariates? I have already run a Pearson's correlation to reduce colinearity - but either way I can't put in over. I read that was because these later variables that are deemed singular have no effect - but that can't be true because if I run them by themselves they work and are significant

You can see what I mean with the plots above

The dataset is below but it exceeded the character limit so I uploaded it to this link: dataset

Here is the Pearson's Correlation Output:

• Could you please say a bit more about how the 5 predictor variables st.Area, st.Growth_Rate, st.SLA, st.VLA, and st.Thickness are related to each other? I wonder if, say, the values of the first 4 always allow you to know the value of st.Thickness. That could produce a singular design matrix, as the warnings seem to indicate. – EdM Oct 11 '18 at 18:29
• Hi EdM, I added the pearson's correlation to the post so you can see their relation (in short there are no significant relationships)- I was doing some research and I think it may actually be due to the number of observations? Not all 404 individuals have trait measurements - what do you think? On another point, is it statistically sound to separate the larger cox model (with all three treatments) and subset it to just the individuals in a certain treatment? The reason I do this is because I want to see the effect of traits on survival within a particular treatment not just effect of treatment – Justin Luong Oct 11 '18 at 21:41
• I am not sure if I answered so - the traits themselves are (linearly) standardized because the beta coefficient was so disparate when not. Area is overall size of the plant, growth rate is the rate it grew between census, SLA is a function of leaf area/leaf mass, VLA is a function of leaf vein length/leaf area, Thickness is leaf thickness – Justin Luong Oct 11 '18 at 21:46

Although you have 404 rows in your data set and 199 rows in the complete-case subset that would be used in the call to coxph() that you show, you only effectively have 6 different datapoints.

There are only 6 different values for st.Area in the subset of rows that coxph() will be able to use. Furthermore, for each of those 6 values for st.Area each of the other variables (st.Growth_Rate, st.SLA, st.VLA, st.Thickness, and st.PD10) has the same value. For example, here's a selection of half a dozen lines:

   st.Area st.Growth_Rate         st.SLA       st.VLA   st.Thickness    st.PD10
-0.9886624  -0.958729795    -1.681975456    1.851280391 1.80896042  1.013256591
-0.9886624  -0.958729795    -1.681975456    1.851280391 1.80896042  1.013256591
-0.9886624  -0.958729795    -1.681975456    1.851280391 1.80896042  1.013256591
-0.9886624  -0.958729795    -1.681975456    1.851280391 1.80896042  1.013256591
-0.9886624  -0.958729795    -1.681975456    1.851280391 1.80896042  1.013256591
-0.9886624  -0.958729795    -1.681975456    1.851280391 1.80896042  1.013256591


So when you try to model with 6 predictors you are functionally overdetermined and coxph() can't give you a 6th independent coefficient. I suspect that a similar problem affects all of your other attempts.

This type of highly repetitious data and the large number of missing values are troubling. Step back a bit to think about your experimental design and what you are trying to accomplish. Perhaps ask a different question that goes back to the hypothesis you are trying to test and how best to analyze your original data (before your standardizations and all that) to test it.

• Hi Ed - thanks - Unfortunately because I wasn't able to take data for species that had died I had to average the trait values and apply it to all individuals of one species - They all have different event ratios though the main purpose was to see if the mean traits of certain species affected time to event (which is not as repetitive) within the treatment – Justin Luong Oct 11 '18 at 22:44