简体   繁体   中英

Manually Weight a Binned Variable in R Logistic Regression

I am looking to do credit scoring using logistic regression in R and I am stumped on this...

If I have a categorical variable "Residence" with factors "Own", "Rent" and "Other" and I want to set the weight of "Other" to zero so that it is neutral in the model what would be the best way to do this in glm in R?

We can do this manually using Fico Model Builder but I'm not sure how to do it in R.

Thanks.

If you want to omit cases with Residence=="Other" then use the subset argument to glm() .

 logmod <- glm(binaryvar ~ covar1 + Residence, data=dat, 
               subset= Residence =="Other", family="binomial")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM