I was wondering if it is possible to write an estimate statement that estimates the difference of a class variable over a range of continuous values.
I have continuous time with 265 weeks (roughly corresponding to 5 years) and would ideally like to estimate the difference of the class variable across a 52 week block, essentially have an estimate statement that averages the difference over that year. Is this something that is possible to do?
I've been toying with the estimate statement rather unsuccessfully and so far have only been able to reproduce estimates at specific weeks. I'm not sure what the syntax is to try this over a time window (or if it is even possible).
proc GLIMMIX data=hazard_flag_data order=internal plots=(all);
class status_flag(ref='Negative');
model events_per_week = week_number|status_flag/ solution cl dist=poisson link=log offset=ln_events;
lsmeans status_flag/ ilink cl diff e at week_number=52;
estimate "Hazardous vs Non-Hazardous at 52 weeks" status_flag 1 -1 status_flag *week_number 52 -52 / cl e; status_flag*week_number 52 -52 / cl e;
nloptions maxiter = 1000 tech=nrridg;
run;
If there's a different or better way of doing this then that would also be greatly appreciated.