Here comes the corrected code of my function, sorry for not posting it in the
earlier message.

 fitlms <- function(y,infl,formel=NULL){
        if(is.null(formel)){
          var.names <- names(infl)
          dcv <- length(var.names)
          formel <- paste("y~",paste(rep("I(",dcv), var.names,
 rep("^2)",dcv),sep="",collapse="+"),"+",paste(var.names,collapse="*"),sep="")
          formel <- as.formula(formel)
        }
        erg <- lm(formel) #<- Here I omit now the data=infl statement.
        erg <- step(erg)
        return(erg)}

This does work if "formel" is a formula-object, one should check for it, to
secure things...

Cheers, Winfried

---------------------------------------------------------------------
E-Mail: Winfried Theis <[EMAIL PROTECTED]>
Date: 29-Jan-03

Dipl.-Math. Winfried Theis
SFB 475, Fachbereich Statistik, Universit"at Dortmund, 44221 Dortmund
Tel.: +49-231-755-5903 FAX: +49-231-755-4387
----------------------------------------------------------------------

______________________________________________
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to