I am a graduate student and quite new to the concept of linear mixed effects analysis. I have a longitudinal data with repeated measurements, which was collected every three years for more than 20 years. Apart from my (continuous) outcome variable, I have variables that I wanted to look at to estimate their effect on the outcome variable. I did some reading prior to starting my analysis in R (linear mixed models) and defined some variables: age, sex, BMI, smoking pack years etc... as fixed effects. Based on my rather limited understanding, a fixed effect is something that is expected to have a systematic and predictable effect on the data hence I believed the above mentioned variables fitted that category.
Secondly, there are the random effects which I believe are expected to have a random and unpredictable effect on the data. One rather conspicuous candidate for this is the subject ID (coded differently for each subject).
In relation to this, I have difficulties in proceeding further as there are some doubts as what qualifies as what. Here are two of my major questions:
There is a variable called time which is defined in relative to the first time point of data collection, specifically the year. For example, for subject no 1 who has a measurement every three years starting from the baseline year in 1988 (follow-up years 1991 and 1994), the variable is defined as 0,3 and 6 respectively (for 1988,1991 and 1994). Similarly, for other participants some follow up measures are NA (missing). Thus, to reuse the example above, the years where data is available might be 1988 and 1994 and time will then be coded as 0 and 4 respectively. I believe this variable (time) is integral in telling the model to take into account the changing status of certain variables but I am lacking the theoretical standing relating to this. Is this a proper approach? Will the linear mixed model inherently take variability into consideration without telling it to account for time?
Regarding certain variables, e.g. sex and age, is it also proper to simultaneously treat them as random? Or is this totally subjective based on the researcher? In my understanding, the sampled population in the data doesn't completely take this into consideration (the obvious one being that not all men and women are in the dataset - and the same applying to age) which makes me think that this nuanced randomness qualifies them as random effects too.
Please help me in any way, shape or form regarding this. Any suggestion is welcome and I will add details/clarifications to questions posed (if necessary).
Thanks!