[R] help to setting a multiple (linear) regression model with a 5% significance level (threshold) for the inclusion of the model variables.
Prof Brian Ripley
ripley at stats.ox.ac.uk
Tue Nov 22 18:01:42 CET 2011
On 22/11/2011 16:30, gianni lavaredo wrote:
> Dear Researchers,
>
> someone know the right syntax to chose a 5% signiï¬cance level (threshold)
> for the inclusion of the model variables in a multiple (linear) regression
> in backward way?
>
> I set the formula in this way, but I don't know to choose the 5%
> significance?
>
> lmodelV<-
> step(lm(formula=MyFormula[[1]],data=LR.train),direction="backward")
That is not what step() does. Please do read the help page!
Description:
Select a formula-based model by AIC.
Note, 'by AIC'.
Now, as Frank Harrell says here often, stepwise methods are inadmissible
for prediction, and in addition stepwise F-test methods are always
invalid as they ignore multiple testing. So you won't find such methods
prominently available in R (and all the stepwise methods I am aware of
in R packages use AIC or similar).
The author of step()
> thanks in advance gianni
>
> [[alternative HTML version deleted]]
Please do not send HTML when expressly asked not to.
>
>
>
> ______________________________________________
> R-help at 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.
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list