[R] Adding rows to a table with a loop

2011-10-24 Thread MJS
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.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Adding rows to a table with a loop

2011-10-26 Thread MJS
Thanks for the response, and the advice, glmulti looks like it could be quite
a good alternative.

As for the adding to the results table problem from within the loop, this
webpage:

answered a number of my questions.

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

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Extracting a regression equation from 'lars' or 'glmnet'

2011-10-28 Thread MJS
Hi All,
sorry but its probably another beginners question.  I have run my data
through both the 'lars' and 'glmnet' packages in R in an effort to reduce
the number of predictors going into my regression equation.  

Is there a way to view the final (best) equation output from the function? 
Hopefully including variable names and coefficients.

MJS

--
View this message in context: 
http://r.789695.n4.nabble.com/Extracting-a-regression-equation-from-lars-or-glmnet-tp3947772p3947772.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.