[R] Adding rows to a table with a loop

MJS taranis.1986 at gmail.com
Mon Oct 24 17:58:21 CEST 2011


Hi All,
Its a bit of a beginners question I'm afraid.  
I have a looped stepwise regression (using MASS and StepAIC) to take random
predictors out of the total number.  For this example a random sample of 5
out of a total of 20.  The loop will continue until all combinations of
variables have been run through the loop.  

The output from each loop can be derived from taking the significant (p)
coefficients from the summary command, and coding them '1' (if <0.05) or '0'
(if >0.05), and producing a table of 5 columns for each of the predictors
entered.

The table produced in the loop is much smaller than the input table.  Is
there a way to produce a results table using the original column titles of
the input table which can be matched to the subset predictors table, where
if the variable was not in the subset its row value is 'NA'?

I hope that makes sense.

Cheers In advance,
Matt




--
View this message in context: http://r.789695.n4.nabble.com/Adding-rows-to-a-table-with-a-loop-tp3933634p3933634.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list