i get this output using coxme model. i'm trying to work with this part, the frailty/RE output, which looks like this.
>fitpm50$frail$'ST_BASELINE/CMSA_MSA'
CA/680 CA/2840 CA/4472 CA/6922 CA/7120 CA/7320
1.129591e-02 1.208329e-02 -3.709842e-02 2.353560e-02 -3.345176e-04 1.359872e-02
I would like to sort this and output this as a data frame. The tricky part here is that I want to sort by the number, removing the CA/. I came up with this:
>sort(as.character(substring(attributes(fitpm50$frail$'ST_BASELINE/CMSA_MSA')$names, 4, 7)
which sort of works, but this returns that 680 is the third biggest value, whereas I want it so that 680 is the smallest. Also this just returns sorted values for the headers, whereas I want the whole output sorted as a data frame.
Thanks