Henric, thank you very much, you guessed exactly what I want, excuse me for my poor explanations. I tried step with scope argument and all went nice. Before my first posting I read ?step, but I did not understand the meaning and usage of "scope". I said "manual step", but indeed I did not use AIC(model1,model2) but anova(model1,model2). I mail ordered F. Harrell book two weeks ago and today I just received my copy.
Thank again Pietro ----- Original Message ----- From: "Henric Nilsson (Public)" <[EMAIL PROTECTED]> To: "Pietro Bulian" <[EMAIL PROTECTED]> Cc: <[email protected]> Sent: Thursday, February 08, 2007 4:00 PM Subject: Re: [R] step in a model with strata > 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: [EMAIL PROTECTED] >> >> ______________________________________________ >> [email protected] 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. >> >> ______________________________________________ [email protected] 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.
