Solved – Which glm algorithm to use when predictors are numerical as well as categorical

generalized linear modelrregression

I just need a direction on which regression algorithm (preferably glm or similar) algorithm to use when the predictor variables are a mix of numerical and categorical variables. The output is numerical for the time being but in future, I need to extend this for categorial output also.

My input columns are in the the format given below:

preNum1 predNum2 ......predCat1 predCat2 ....ResponseVar  

Edit:
I am trying to predict the amount of 'Bilirubin' (here, the response variable), depending on patients' data. We have patients's lab results such as glucose, blood pressure, etc etc as numerical predictor values and the patients' disease history (diabetes,and other diseases) as categorical predictors. I converted all the categorical variables (they are diseases such as diabetes, high BP, etc) into 0 and 1 (0 representing that it is not present, 1 representing it to be present.) After this I applied GLM on this. I am wondering if my approach is correct or not?

Best Answer

When your dependent variable is binary ($1$ vs. $0$, "dead" vs. "alive"), the you might use logistic regression which is a glm with a binomial error distribution and a logit link function. When your dependent variable is ordinal (e.g. "bad"> "good" > "best"), you can use ordinal logistic regression. For a nominal (e.g. transportation: "walk", "car", "bicycle") dependent variable, you can use multinomial logistic regression.

EDIT

Your approach to convert the disease status into a 0,1-variable seems correct. If your outcome is continuous, you could use a GLM with a gaussian error distribution and an identity link function which is equivalent to a simple multiple regression model (OLS).