s-news
[Top] [All Lists]

[S] a variable question

To: s-news@wubios.wustl.edu
Subject: [S] a variable question
From: Julian Olden <olden@zoo.utoronto.ca>
Date: Thu, 24 Jun 1999 10:44:53 -0400 (EDT)
Sender: owner-s-news@wubios.wustl.edu

Hi folks, 

I have a small problem that I think someone out there might of already 
run into.

i have a data matrix with 5 columns (i.e. data)

var <- 3
model <- lm(data[,1]~data[,2]+data[,var]

S-plus recognizes that var equals 3 so when the model is built it 
includes the third column of the matrix "data", however, in the output it 
maintains the var name in the final model so when I attempt to remove 
this variable , i.e.

model <- drop1(model,~.-data[,3])

s-plus doesn't recognize the variable data[,3]. Due to the nature of the 
routine that I am writing, I need S-plus to recognize that var = 3 in the 
final model, so that I can refer to that variable as data[,3] later in 
the program. I hope that this is clear. Thanks in advance.

Cheers,
Julian

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Julian D. Olden
University of Toronto, Department of Zoology
25 Harbord Street, Toronto, M5S 3G5
e-mail : olden@zoo.utoronto.ca
web: http://www.zoo.utoronto.ca/zooweb/olden/index.htm
phone: 416-978-0976
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>
  • [S] a variable question, Julian Olden <=