Hi all, I can't come over a problem with formula. Suppose I have a coxmod model with the following formula:
> somemod$formula Surv(lebzeit, tot == 1) ~ sex + (alter >= 65) + diff3k + zelltyp_k_c + q_nuc_3k + kar_k80_g80 + stadium and I want to drop the stadium explanatory variable from the model with > update(somemod, ". ~ . - stadium") I get the following messages: Fehler in coxph(formula = Surv(lebzeit, tot == 1) ~ sex + alter >= 65 + : No (non-missing) observations Zusätzlich: Warning messages: 1: In Ops.factor(sex, alter) : + not meaningful for factors 2: In Ops.factor(65, diff3k) : + not meaningful for factors 3: In Ops.factor(65 + diff3k, zelltyp_k_c) : + not meaningful for factors 4: In Ops.factor(65 + diff3k + zelltyp_k_c, q_nuc_3k) : + not meaningful for factors 5: In Ops.factor(65 + diff3k + zelltyp_k_c + q_nuc_3k, kar_k80_g80) : + not meaningful for factors What seems to happen is that "alter >= 65" is not parsed as an entity. It does not look as a problem with the environment to me, as is outlined in http://developer.r-project.org/nonstandard-eval.pdf, rather a parsing problem. By contrast, the following works like a charm: > x <- runif(50) > y <- rnorm(50)+x > regmod <- lm(y ~ x) > update(regmod, " . ~ . + (ifelse(x>.5, 0, x))") Could anybody give me a hint on my wrongdoings? -- Johannes Hüsing There is something fascinating about science. One gets such wholesale returns of conjecture mailto:[EMAIL PROTECTED] from such a trifling investment of fact. http://derwisch.wikidot.com (Mark Twain, "Life on the Mississippi") ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.