data spl3; int=1; input x sp1; cards; 0.500 2.547 1.000 2.026 1.500 1.506 2.000 0.985 2.500 0.465 3.000 -0.044 3.500 -0.535 4.000 -0.995 4.500 -1.417 5.000 -1.791 5.500 -2.105 6.000 -2.352 6.500 -2.521 7.000 -2.601 7.500 -2.585 8.000 -2.461 8.500 -2.225 9.000 -1.886 9.500 -1.459 10.000 -0.960 10.500 -0.402 11.000 0.200 11.500 0.831 12.000 1.477 data sln int slope spline; length level $ 15; length factor $20; infile "mouse_42_spline.sln" expandtabs; input factor $ level $ sol se; output sln; if factor="Anim" then output int; if factor="Week.Anim" then output slope; if factor="spl(Week,3).Anim" then output spline; run; proc iml; use spl3; read all into Z; use sln; read all; use int; read all var {sol} into aint; read all var {level} into Anim; use slope; read all var {sol} into aslope; use spline; read all var {sol} into aspline; GM=aint||aslope||aspline; Zx=Z[{2 3 4.5 6 8 12}*2,]; print Zx; GW=GM*Zx`; week={W2 W3 W4_5 W6 W8 W12}; print GW[rowname=Anim colname=week]; create Gdata from GW[colname=week]; append from GW;; create Anim var {Anim}; append; quit; run; data Gdata; merge Anim Gdata; run;