Hi, This is my first time posting a question, so I'm a bit nervous 🙂 I am a clinician not a statistician, so please excuse any naivete. I am modelling an interrupted time series analysis with 2 breakpoints, using GLM and an impact model with 2 slope changes and 2 level changes, no other covariates included. The dependent variable is a count, Poisson distributed. I found autocorrelation at lag 3 only. I'm using SAS 9.4. I read about using the Newey-West correction for autocorrelation in time series, however I wasn't sure if that was appropriate for a count distribution? All the SAS codes I've seen were applied to continuous DV, so I essentially adapted those codes to my count model - but i'm not sure this is right...more specifically I'm asking: - is newey west correction appropriate for a count model? - if it is, did I code it correctly? (I've essentially taken the newey-west correction i've seen used in a proc model but for a continuous DV and applied it to mine) There are no errors that come up when i run this or anything else weird but the reason I'm asking is that my mentor is doing the same analysis using STATA and is getting VERY different standard errors. So we're trying to figure out if I made a mistake in my code. Thanks very much! Gabriela Explanation of variables: slopech1_2 = slope change from period 1 to 2 jump1_2 = level change from period 1 to 2 (same for periods 2 to 3) time = month1 to 50 of 50 months (monthly measurements) Exposure = exposure variable for each month y= observed variable of interest (rate) proc model data=Trends; label b0="intercept" b1="time" b2="slopech1_2" b3="jump1_2" b4="slopech2_3" b5="jump2_3"; parms b0 = 0.5 b1 = 0.1 b2=0.1 b3=0.1 b4=0.1 b5=0.1; yhat=exp(b0+b1*time+b2*slopech1_2+b3*jump1_2+b4*slopech2_3+b5*jump2_3)*Exposure; y=yhat; lk=exp(-yhat)*(yhat**y)/fact(y); ll=-log(lk); errormodel clots~general(ll); fit clots/gmm kernel=(bart,4,0) vardef=n; run; Attached is a sample of the dataset.
... View more