Re: Multiple regressions

*To*: mathgroup at smc.vnet.net*Subject*: [mg74248] Re: Multiple regressions*From*: Albert <awnl at arcor.net>*Date*: Thu, 15 Mar 2007 19:05:39 -0500 (EST)*Organization*: Arcor*References*: <etb5lk$ke6$1@smc.vnet.net>

Hi, > I have a code that does multiple regressions on a set of data. Depending on= > the size and shape of the data I first do a regression, look at residuals,= > subtract the worst data point and do the regression again. I've written th= > is with a set of If statements so if the size of the data becomes too small= > the next regression won't be done. This works fine for a single data set b= > ut if I put it into a loop through multiple data sets then I run into troub= > le. For example if the first data set goes through 5 regressions and the ne= > xt data set only has enough data to go through 2 it takes the data from the= > first data set for the last 3 which I don't want. How do I clear the data = > after each pass through a data set. I've tried Clear[function1, function2,.= > ..etc.]. I've tried UnSet[values,values]. So the question is once I've gone= > through the loop how do I clear the values so the next data set through it= > is not carried over. basically you seem to be on the right path, but without sharing the information on how you make the definition within your loop it is impossible to help you. Maybe sending some code would enable us to see what the problem might be... A blind shot is the following: Try using ClearAll on the symbols/variables that hold the values you want to get rid of... hth, albert