s-news
[Top] [All Lists]

stepwise()

To: s-news@lists.biostat.wustl.edu
Subject: stepwise()
From: impromptu@nifty.com
Date: Fri, 31 May 2002 13:39:25 +0900
S-Plus users
E-mail: s-news@lists.biostat.wustl.edu

Hi, my question is on stepwise().

      set.seed(1245)
        nd <- 18
        xx1 <- runif(nd, min = 0, max = 1)
        xx2 <- runif(nd, min = 0, max = 1)
        xx3 <- runif(nd, min = 0, max = 1)
        xx4 <- runif(nd, min = 0, max = 1)
        yy1 <- xx1 * 3 + xx2 * 2 + rnorm(nd, mean = 1, sd = 5)
        xmat <- matrix(c(xx1, xx2, xx3), nrow = nd)
        step1 <- stepwise(xmat, yy1)
        print(step1$which)

The output by the above program is:

  Error in dim<-: Invalid value for dimension 2: dim=c(3, ..)

   On the other hand, when I replace the 7th line with the statement below

  yy1 <- xx1 * 3 + xx2 * 2 + rnorm(nd, mean = 1, sd = 1)

The result is:

       X1 X2 X3 
1(+1)  T  F  F
2(+2)  T  T  F

I am just wondering why. Is this an unavoidable feature of Efroymson's method?

   *****    Kunio Takezawa, Ph.D. (takezawa@affrc.go.jp)    *****
*****     <http://cse.inada.affrc.go.jp/takezawa/patent-c.html>    *****


<Prev in Thread] Current Thread [Next in Thread>
  • stepwise(), impromptu <=