s-news
[Top] [All Lists]

[S] a question on quadratic terms

To: s-news@wubios.wustl.edu
Subject: [S] a question on quadratic terms
From: "W. Li" <wli@crick.rockefeller.edu>
Date: Thu, 24 Feb 2000 16:26:09 -0500 (EST)
Sender: owner-s-news@wubios.wustl.edu




may i ask a beginner's question:

i want to do logistic regression over all predictors plus
products of these predictors. both predictors and the
outcome are kept in a table a[].  suppose i have two
predictors a[,1] and a[,2],  (a[,3] is the outcome)
then i use

 a <- glm(a[,3] ~ a[,1]+a[,2]+a[,1]:a[,2], family=binomial)

or alternatively

 a <- glm(a[,3] ~ (a[,1]+a[,2])^2, family =binomial)

these are fine.

but what if i have (say) 100 predictors. i thought

 a <- glm(a[,101] ~ a[,c(1:100)]^2, family=binomial)

would do the trick. but it does not! a[,c(1:100)]^2 somehow
remains as a[,c(1:100)]. what happens here?  on the other hand, i 
don't want to type (a[,1]+a[,2] +..... a[,100])^2, the whole line.


thanks for your help
wentian li
wli@linkage.rockefeller.edu


-----------------------------------------------------------------------
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>