3
I’m new to RStudio
and I’m having trouble simplifying my code. I’m doing a logistic regression and would like to select only variables with p<0.20. For that, I did the following:
imcbi <- glm(data2$desfechouti ~ data2$imc, family=binomial())
localbi <- glm(data2$desfechouti ~ as.factor (data2$local),
family=binomial())
readmbi <- glm(data2$desfechouti ~ as.factor (data2$readm),
family=binomial())
I spin separately and do it later:
summary(imcbi)
summary(localbi)
summary(readmi)
There is how I assemble the code so that the bivariate analysis is all done together so that I need only after ONE command summary
?
Remembering that I am selecting variables to assemble my logistic regression model.
Using LASSO Logistic Regression to select variables may be an alternative.
– piaHZERA