s-news
[Top] [All Lists]

Re: Extract factors from ANOVA output

To: liao@idminer.com.tw
Subject: Re: Extract factors from ANOVA output
From: Sundar Dorai-Raj <sundar.dorai-raj@pdf.com>
Date: Tue, 19 Aug 2003 08:05:02 -0500
Cc: s-news@lists.biostat.wustl.edu
In-reply-to: <002d01c3663d$795508c0$6501a8c0@idminer.com.tw>
Organization: PDF Solutions, Inc.
References: <002d01c3663d$795508c0$6501a8c0@idminer.com.tw>
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)


liao wrote:
Deal S-Plusers,

I want to base on ANOVA aov() output, and extract the factors with
significant p-values, and then input these factors into regression models
glm() or lm() to do model selection.

My questions are:
1. The aov() output specify the interaction with colons such as factor(A) :
factor(B): factor(C),.. How can I split the interaction to individual
factor(A), factor(B), factor(C) so that program can recognize factor names?


Use unpaste("A:B", sep = ":").

2. The whole process hopes to AUTOMATICALLY do ANOVA first and then input
factors to glm() or lm(), kind of like PROC GLM in SAS. Any recommended
S-PLUS function? Or other suggestions?


"aov" is just a wrapper function for "lm" (see ?aov). That said, why not fit lm (or glm) directly, then use stepAIC in the MASS library for model selection? Or alternatively, you can use stepAIC directly on the aov object. Using coefficient p-values as a method for model selection is very dangerous.

Sundar


<Prev in Thread] Current Thread [Next in Thread>