s-news
[Top] [All Lists]

Stepwise regression

To: <s-news@wubios.wustl.edu>
Subject: Stepwise regression
From: "Bert Jacobs" <b.jacobs@pandora.be>
Date: Fri, 16 Sep 2005 20:41:39 +0200
In-reply-to: AAAAAOXvfE/tUWVMujI1J0cWacvEXyAA
Thread-index: AcW60UR+Gh2AFbCESoybpY87wCiM2AABdYZA

Using S-Plus 6.2 for Windows XP

 

I'm trying to fit a simple linear regression model:

 

The issue is the following:

I have a dataframe with several "response variables" (each with 200 observations) who should be checked against a number of possible predictors variables (approx. 50 dummy variables).

Of the 50 dummy variables I know that only 5 – 10 will have significant effect on a response variable, but I don’t know which ones. For another predictor I have the same predictor variables, but again I don’t know in advance witch ones will be significant. It’s my purpose to have at the end an idea (by means of a matrix) witch variables have a significant impact on which response variable). The model should not have predictive power and in the end I’m only interest in a well calculated intercept.

 

In order to figure this out I thought the best way to do it is by using a simple stepwise Regression.

 

Before integrating a loop over the several “response variables”, I’ve tried to fit it on a single response, so:

 

menuStep(formula = DATA~VAR5+VAR2+VAR3+…VAR55),formula.lower = NULL, data = "" na.omit.p = T, direction = "forward", trace.p = T, print.short.p = F, print.long.p = T, print.anova.p = F, print.correlation.p = F)

 

but I got an error if I tried to subscript the model:

 

menuStep(formula = DATA~as.matrix(FINAL[,5:55]),formula.lower = NULL, data = "" na.omit.p = T, direction = "forward", trace.p = T, print.short.p = F, print.long.p = T, print.anova.p = F, print.correlation.p = F)

 

Any ideas why this doesn’t work and is the menustep function the best way to handle my problem.

Comments are well appreciated.

 

Bert

 

 

 

 

<Prev in Thread] Current Thread [Next in Thread>
  • Stepwise regression, Bert Jacobs <=