?=================================================================== ? LM test for groupwise heteroskedasticity = ? = ? User must define the data matrix with the following line: = ? = ? NAMELIST ; X = ... $ = ? = ? User's dependent variable is Y. Change the following line = ? = ? CREATE ; Y = the dependent variable $ = ?=================================================================== SAMPLE; All $ (The pooled sample has N = TG observations.) CALC; s2 = ESS(X,y) / N ; LMStat = 0 $ CALC; T = N / G ; First = 1 ; Last = T $ PROCEDURE SAMPLE ; First - Last $ CALC ; S2i = ESS(X,Y)/N ; LMStat = LMStat + (T / 2) * (s2i / s2 - 1)^2 ; First = First + T ; Last = Last + T $ ENDPROCEDURE EXECUTE; N = G $ (This says execute the procedure G times.) CALC ; LMSTAT $