Skip to main content

I'm doing a retrospective study where I want to analyze whether a certain treatment (surgery A vs. surgery B) has an effect on the health status after the surgery measured with different parameters (blood measures for example which are continuous variables but also measures like certain complications which are categorial). Since it is a retrospective study I couldn't control for the gender distributions within the two conditions (A vs. B). When looking at the data I see that there are many more males in one condition than in the other. So now I think the best will be to predict health status depending on the kind of surgery adjusted for gender (and possibly age too). Since treatment and gender are both categorial variables I wondered how I can both include them in a linear model, do I need to dummy code both? And how would this look like in R for example.?

Another related question is that there are also data on the blood measures from before the surgery so it would be reasonable to also adjust for those differences within the different conditions, correct? Could I do this in the same model? And another questions which comes to mind in this context is whether it would be reasonable to have some multilevel analysis (within and between) effects?

Help is highly appreciated! Thanks!

I'm doing a retrospective study where I want to analyze whether a certain treatment (surgery A vs. surgery B) has an effect on the health status after the surgery measured with different parameters (blood measures for example which are continuous variables but also measures like certain complications which are categorial). Since it is a retrospective study I couldn't control for the gender distributions within the two conditions (A vs. B). When looking at the data I see that there are many more males in one condition than in the other. So now I think the best will be to predict health status depending on the kind of surgery adjusted for gender (and possibly age too). Since treatment and gender are both categorial variables I wondered how I can both include them in a linear model, do I need to dummy code both? And how would this look like in R for example.

Another related question is that there are also data on the blood measures from before the surgery so it would be reasonable to also adjust for those differences within the different conditions, correct? Could I do this in the same model? And another questions which comes to mind in this context is whether it would be reasonable to have some multilevel analysis (within and between) effects?

Help is highly appreciated! Thanks!

I'm doing a retrospective study where I want to analyze whether a certain treatment (surgery A vs. surgery B) has an effect on the health status after the surgery measured with different parameters (blood measures for example which are continuous variables but also measures like certain complications which are categorial). Since it is a retrospective study I couldn't control for the gender distributions within the two conditions (A vs. B). When looking at the data I see that there are many more males in one condition than in the other. So now I think the best will be to predict health status depending on the kind of surgery adjusted for gender (and possibly age too). Since treatment and gender are both categorial variables I wondered how I can both include them in a linear model, do I need to dummy code both? And how would this look like in R for example?

Another related question is that there are also data on the blood measures from before the surgery so it would be reasonable to also adjust for those differences within the different conditions, correct? Could I do this in the same model? And another questions which comes to mind in this context is whether it would be reasonable to have some multilevel analysis (within and between) effects?

Help is highly appreciated!

Source Link

Can I run a linear regression with a categorial independent variable (treatment) and adjust for gender at the same time?

I'm doing a retrospective study where I want to analyze whether a certain treatment (surgery A vs. surgery B) has an effect on the health status after the surgery measured with different parameters (blood measures for example which are continuous variables but also measures like certain complications which are categorial). Since it is a retrospective study I couldn't control for the gender distributions within the two conditions (A vs. B). When looking at the data I see that there are many more males in one condition than in the other. So now I think the best will be to predict health status depending on the kind of surgery adjusted for gender (and possibly age too). Since treatment and gender are both categorial variables I wondered how I can both include them in a linear model, do I need to dummy code both? And how would this look like in R for example.

Another related question is that there are also data on the blood measures from before the surgery so it would be reasonable to also adjust for those differences within the different conditions, correct? Could I do this in the same model? And another questions which comes to mind in this context is whether it would be reasonable to have some multilevel analysis (within and between) effects?

Help is highly appreciated! Thanks!