eric lee
2008-Oct-17 20:01 UTC
[R] find bayesian information criterion for all variable combinations
Hi, I have data for one dependent variable and multiple independent variables y = b0 + b1*x1 + b2*x2 + ... I want to a list of all models that have some subset of the independents (just x1 x2, and not x3, etc.) and their corresponding BIC values. Is there a pre-existing function that does this? I saw that you can calculate individual BIC values using 'lm' and something like AIC(lm1, k = log(nrow(swiss))) but, nothing for all combinations. Thanks. eric [[alternative HTML version deleted]]
Ben Bolker
2008-Oct-17 20:50 UTC
[R] find bayesian information criterion for all variable combinations
eric lee <ericlee100 <at> gmail.com> writes:> > Hi, > > I have data for one dependent variable and multiple independent variables > y = b0 + b1*x1 + b2*x2 + ... > > I want to a list of all models that have some subset of the independents > (just x1 x2, and not x3, etc.) and their corresponding BIC values. Is there > a pre-existing function that does this? I saw that you can calculate > individual BIC values using 'lm' and something like > > AIC(lm1, k = log(nrow(swiss))) > > but, nothing for all combinations. Thanks. > > ericThere is a useful but rather dangerous package available, not from CRAN, called "dRedging", that will do this. http://www.zbs.bialowieza.pl/users/kamil/r/ USE AT YOUR OWN RISK -- misused, this will lead you into terrible statistical practices. cheers Ben Bolker
Possibly Parallel Threads
- Running "all possible subsets" of a GLM (binomial) model
- how to selection model by BIC
- "deparse" with "nlines" argument produces empty elements (PR#13299)
- question about bayesian model selection for quantile regression
- newbie (me) needs to model distribution as two overlapping gaussians