A Cox model does not fit an intercept parameter, see for example this question for some discussion. Therefore, fitting surv ~ variable1 or surv ~ 0 + variable1 will produce exactly the same parameters. coxme calls the default coxph.fit method if you don't have time-dependent covariates, so the behaviour will be the same as the fixed effects-only coxph.
library(survival) data(cancer) fit1 <- coxph(Surv(time, status) ~ celltype, data=veteran) ## Explicitly 'remove' intercept fit2 <- coxph(Surv(time, status) ~ 0+celltype, data=veteran) ## Notice how *only the formula* (call) differs all.equal(fit1, fit2) > "Component “terms”: formulas differ in contents" > "Component “formula”: formulas differ in contents" > "Component “call”: target, current do not match when deparsed"
For your random effect, it is not really accurate to call a categorical/dummy covariate a 'slope' - this is usually the term used for a continuous variable that has a linear effect over its range. However, it turns out this is how coxme was implemented in that it only accepts a single numeric effect besides an intercept in the random effect specification. You are actually trying to fit multiple random intercepts, which might lead to some undesirable side effects.
The first specification, (1 + variable1 | grouping), will fit an overall intercept and a 'slope' which is really just an intercept in the non-reference level of variable1. I'm not going to pretend I know much about the fitting algorithm inside coxme but I would assume that this produces roughly the same result as if you were fitting a separate intercept to each level of variable1 (which the package does not allow directly). Compare this to how removing an intercept from a standard linear model changes the interpretation of categorical predictors from differences vs. reference to the mean in each category.
The second specification, (variable1 | grouping), will fit only a random 'slope', which in your case becomes an intercept for the non-reference level only. This is not only a much less flexible structure, I'm quite sure that this is not what you want if your goal is to "assume a variable effect for each group" (where I'm taking "group" to mean "levels of variable1", because all models will produce separate random effects across all levels of grouping regardless).
variable1categorical (factor) or continuous? $\endgroup$