goptions reset=all; title "AR(1)"; Data AR_1; do t = 1 to 512; e= normal(123); Y = .8*Y + 2*e ; if Y=. then Y=0; X = -.8*X + 2*e; if X=. then X=0; drop e; output; end; proc spectra P S adjmean out=arspec; Var Y X; weight 1 2 3 4 5 6 7 6 5 4 3 2 1; data arspec; set arspec; Ytheory = 4/(2*3.14159*(1.64 - 1.6*cos(freq))); Xtheory = 4/(2*3.14159*(1.64 + 1.6*cos(freq))); label S_01 = "Y (.8)"; label S_02 = "X (-.8)"; proc gplot; plot (S_01 Ytheory)*freq/overlay; symbol1 v=dot i=none c=red h=.6; symbol2 v=none i=join c=black w=3; plot (S_02 Xtheory)*freq/overlay; run;