Help using Base SAS procedures

Help with code: repeated measures, unbalanced, nested effects

Not applicable
Posts: 0

Help with code: repeated measures, unbalanced, nested effects

Hi everyone,

I'm fairly new to SAS (and repeated measures analysis and mixed models), so bear with me here:

The dataset I'm working with consists of counts of birds flying into n = 27 study sites, on multiple days, in multiple years (note: only one observation at a given site on a given day). The tricky part is that the data are unbalanced: Not all sites were surveyed in all years, with some sites surveyed in more years than others. Likewise, not all sites were surveyed on the same day, with some sites surveyed on more days than others in a given year. What I’d like to know, is whether there are significant year and day effects on the number of birds observed flying into each site (i.e., I'd like to examine both daily and yearly variation). The model would therefore look something like this:

IBijk = Yeari + Day(Yeari )j + Eijk

where IBijk = the number of incoming birds in year i on day j at site k.

With missing data and unequal time intervals, my options for analysis are either PROC mixed or PROC Glimmix (if I don't want entire observations dropped if one value is missing, which I don't). For PROC mixed, I’m stuck on how to specify a day (i.e., Julian date) and year time period in the repeated statement (i.e., the “repeated-effect”). Right now I have:

PROC mixed DATA = dataset;
CLASS SiteName Year JulDay;
MODEL IB= Year JulDay(Year);
REPEATED /subject= SiteName type=un;

However, I don’t know what to put in the , or if the code above is even appropriate. I've been all through the literature and forums, but can't seem to find an example where there are two within-subject effects (i.e., where measurements on the subject are repeated, and being examined, over both day and year, as above, or something similar), and where one of these effects is nested in the other.

Any help would be greatly appreciated. Please let me know if you need more details.

Ask a Question
Discussion stats
  • 0 replies
  • 1 in conversation