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
|