lingyanmeng
lingyanmeng

Reputation: 13

R codes in Augmented backward elimination variable selection

I have a data set with 357 patients. there are about 10-15 potential variables to be selected in the final model. some of the variables are highly correlated. so I decided to use augmented backward elimination variable selection method.

fit1<-glm(EWL_8Percent~Maternal.Age+local+DM_all+HTN_all+Gestational.Age+Type.of.delivery+Maternal.IV.Fluid.therapy+D0.Weight+Gender+Primiparity+resus+Phototherapy+EBF_D3+Maternal.confidence,family=binomial,data=data_term)

abe.fit<-abe(fit1,data=data_term,include=NULL,active=NULL,tau=0.05,exp.beta=FALSE,exact=TRUE,criterion="alpha",alpha=0.2,type.test="F",verbose=TRUE,type.factor="factor")

however, I consistently can't work it out.below is the error message

Error in abe(fit1, data = data_term, include = NULL, active = NULL, tau = 0.05,  : 
  the model should be fitted with: x=T

Any help is much appreciated. thank you

Upvotes: 0

Views: 196

Answers (1)

urmelf
urmelf

Reputation: 41

In case someone is still looking for the answer: You have to fit lm() with the option "x = T" and "y =T" and apply abe() afterwards.

Upvotes: 1

Related Questions