# Controlling for multiple, nominal variables in a linear model

Here's my experiment: I'm testing the physiological effects of a treatment on a mice (measuring continuous variables such as total mass, fat mass, bone density, etc). I want to test the significance of this treatment on weight gain parameters.

What I've done so far: in R, I've fitted a logistic glm model, using the binary factor indicating treatment/control group as the response (I eventually want to see what weight measurements are predictive of treatment group-membership). However, I also have repeated measures at (for now) 2 time points (~3 weeks apart) and a sex variable as well. These are (uninteresting) factors effecting weight and weight gain.

My question is, how do I control for factors that I know are significantly effecting weight gain? The problem seems to be that I want to use continuous measurements to predict a classifier (treatment group) but this is probably getting swamped out by trivial attributes that are also effecting these continuous measurements (age and sex). Other than just splitting up the data into subgroups, is there are way to deal with this sort of 'mixed effect' model?

A reference would be greatly appreciated.

Thanks!

If you have a binary dependent variable you should/must use logistic regression by setting the family argument to logit: family=binomial(link="logit")

Controlling works by entering the variables as independent variables, independent of whether or not they are binary/nominal/continuous. However, I don't know how to specify a repeated measures factor with glm as those need a special error structure.

Update: For me it is really difficult to wrap my head around your design as you are reverting the role of independent and dependent variables!

If you want to find out how the treatment affects your measurements of weight gain, you should do it the normal way. That is, you should run a separate regression for each dependent variable and assess if you independent variables are significant. A perhaps better approach is to use multiuvariate testing. However, I have never done so in R. But probably others.

• Thanks for the quick reply. I was already implementing this as a logistic regression problem (which of course you wouldn't know since I forgot to state this). I've also noted the lack of error structure in glm, but I'm not sure if Age should be implemented as an error term, since mice do get bigger as a function of them getting older. – zzk Apr 10 '12 at 21:48
• I think you're right about sticking to keeping the dependent/independent variables where they ought to be. However, my idea was to use the fitted model to predict treatment status using 10fold cross validation. – zzk Apr 10 '12 at 22:15
• Why do you want to predict treatment? You know treatment, it's fixed by design. – guest Apr 11 '12 at 3:24
• because if you can accurately predict treatment group even if the model is blind to it, it means the features you're measuring are more likely to be predictive in future experiments, no? – zzk Apr 12 '12 at 14:57