# OLS, Fixed effects or Random effects Model?

I am a little bit confused about type of model to apply because my type of data.

I am interesting in get regression parameters for time (dependent variable) with independent variables= sex + age+ var3+var4 (maybe patient) my data have multiple measures by patient.

My first idea was apply ols, but now I am reading about models with fixed effect and random effects (xtreg in stata) and maybe I thought that I should use a fixed effect model, one example of my data is below, data is unbalanced:

Time, Var3 and Var4 are continous.

Any suggestion I would appreciate

• In your data above, the same patient different values for sex. How is that possible. Also, are they at different ages at different time points? – dbwilson Jul 12 '18 at 20:23
• Do you plan on using age as a categorical variable or a continuous (or at least linear) variable? – dbwilson Jul 12 '18 at 20:24
• Sorry for my mistake, I fix the error. – Rodrigo B Jul 12 '18 at 20:27
• Age as categorical. – Rodrigo B Jul 12 '18 at 20:28
• I'd recommend a linear mixed effects model. In Stata something like this: mixed time i.sex i.age || patient: – COOLSerdash Jul 12 '18 at 20:30

When comparing which model to use, there are two things to consider:

1. Does this model fit the data better than the other?
2. Does this model test a hypothesis that I would like to test?

Ye olde Regression, Fixed Effect and Random Effects are models increasing in complexity. You should expect more complicated models to fit better, but if the difference between the complex and simple is minute, stick to the simple (ockham's razor after all). If not, this means that whatever you added to your model is providing an important effect on the data. That itself is knowledge that can come in handy. So in summary, always start simple, and as you add bells and whistles, if you have a big increase in accuracy, then not that whatever you added was important, and if nothing happened, then whatever you added is not important.