Hello,
I am trying to code a model that is a little different than others I have done and am not sure I have the code right. My design consists of several sites with each of these sites measured 2 years. Each year, the sites were measured several dates. At each survey what was recorded was the date, the presence/absence of factor a, and the response variable. The presence/absence of factor a can vary with date for each site and year. Dates also vary with site and year. So I have 2 repeated measures: year and date - year would be categorical but would like date to be continuous. I then I have a categorical (or binary) factor measured each date (this is the part I am not sure how to code). The model I am running is given below but I am not sure this is correct. I am using compound symmetry while trying to get the rest of the code correct, but can change that later. So ignoring that part, do I have the model correct or am I missing some other covariance terms.
PROC MIXED;
CLASS YEAR SITE FACTORA;
MODEL S=YEAR|FACTORA|DATE;
RANDOM SITE;
REPEATED / SUBJECT=SITE*YEAR TYPE=CS;
Also, would it be valid to treat year as a random factor and if yes, how would I code that model?
Thank you for your time and any help you can give me.