0

I am modeling Cox regression and some of my independent variables are ordinal data and have trouble with the reffernce groups.

By default the coxph package takes the first group in a variable as a refference group, i.e. in the vaiable female/male the female group is the refference. However, I have an ordinal variable with three levels (1, 2, 3). I do not wish a refference group in this ordinal variable but I want R to give a total estimate for my total variable.

Daniel
  • 97
  • 1
  • 6

1 Answers1

0

What about as.numeric(your123factor) ? then R will treat your variable as continuous.

Cath
  • 23,906
  • 5
  • 52
  • 86
  • My varibales has three levels, but every level covers a count. My variable df$count looks like this: 1. 1, 2. 2, 3. >2. Will as.numeric function violate this? – Daniel Oct 28 '14 at 10:07
  • @Daniel so maybe `as.numeric(substr(df$count,1,1))` ? – Cath Oct 28 '14 at 10:14