I have a logistic model that I've built with the nls function in R. I want to use Bayesian model averaging for variable selection, but I can't find a package for that in R. Are there any suitable packages? If not, is it possible to make a not too complicated script for it?
Data example:
y<-sample(c(1,0),100,replace=T)
var1<-sample(c(1,0),100,replace=T)
var2<-sample(c(1,0),100,replace=T)
var3<-sample(c(1,0),100,replace=T)
The model:
Sw<- function(y1, N1,N2,N3) {
SA <- nls(y1~exp(c+(a1*N1)+(a2*N2)+(a3*N3))/(1+exp(c+(a1*N1)+(a2*N2)+(a3*N3)))
,start=list(a1=-0.2,a2=-0.2,a3=-0.2,c=0.2))
SA
}
model <- Sw(y, var1,var2,var3)
How would I do Bayesian model averaging on this? I have 190 observations, where about 70 are 1s and 120 are 0s. I have 13 variables in total.