[R] step in a model with strata

Henric Nilsson (Public) nilsson.henric at gmail.com
Thu Feb 8 16:00:42 CET 2007


Den To, 2007-02-08, 10:47 skrev Pietro Bulian:
> Dear experts,
> when I call the step function for a coxph model with n covariates and a
> dicotomous variable included as strata, the first term removed by step is
> always the strata variable. This is not what I want

So, what do you want exactly? (You didn't tell.)

I'm just guessing here, but it sounds like you'd always want the strata
to stay in the model. In that case, use the `scope' argument i.e.
something like `step(fit, scope = list(lower = ~ strata(x)))' if your
fitted model object is called `fit' and your stratification variable is
called `x' -- see ?step.

> and then I do a manual step updating the model minus the least
> significant covariate and testing with anova, until I have minimized
> the model.

So, let me see if I understand this correctly, you have a two-stage
procedure where you first minimize the AIC criterion and then remove
non-significant predictors in a stepwise fashion?

> Is there a package were this can be done?

If you're referring to the procedure above, I'm not aware of any such
package.

> or am I doing something wrong ? (I'm not a statistician).

Well, it depends... If you want some guidance on model selection, see e.g.

@BOOK{R:Harrell:2001,
  AUTHOR = {Frank E. Harrell},
  TITLE = {Regression Modeling Strategies, with Applications to
                  Linear Models, Survival Analysis and Logistic
                  Regression},
  PUBLISHER = {Springer},
  YEAR = 2001,
  NOTE = {ISBN 0-387-95232-2},
  URL = {http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/RmS}
}


HTH,
Henric



>
> Thanks for hints
>
> Pietro Bulian
>
> Clinical and Experimental Hematology Research Unit
> Centro di Riferimento Oncologico, I.R.C.C.S.
> Via Pedemontana, 12
> I-33081 Aviano (PN) - Italy
>
> phone: +39 0434 659 412
> fax: +39 0434 659 409
> e-mail: pbulian at cro.it
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>
>



More information about the R-help mailing list