BookmarkSubscribeRSS Feed
SVSzwec
Calcite | Level 5

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.

1 REPLY 1
svh
Lapis Lazuli | Level 10 svh
Lapis Lazuli | Level 10

If you are trying to estimate differences between the two groups across a range of time, then I'm guessing there is a significant interaction between week_number and status_flag. Otherwise, the average difference between the two groups would just be the beta for your status variable. (Of course, this assumes there is even an effect for status_flag...) I'm not sure that just one ESTIMATE statement can get you what you want. Even in this example about fitting a spline model, multiple ESTIMATE statements are used to obtain inferences about differences at regular intervals...

 

https://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_glimmix_sec...

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 657 views
  • 0 likes
  • 2 in conversation