On Fri, 11 Oct 2013, valentina colombo wrote:
 Dear  Gretl users,
 I have estimated my system of equations and taken the matrices of the residual sum of
square (from 2 steps). Now, I should make an LM test as follow:
 LM=T(p-tr(RSS1^-1 RRS2))
 Notices that RSS1 and RSS2 are 4x4 matrices.
 1) Question: Is it correct if I write a code in gretl as:
 LM=T(p-tr(RRS2/RRS1)) ? 
No, the two valid ways of finding RSS1^{-1} * RSS2 are
(1) via explicit inversion
inv(RSS1) * RSS2
or (2) "left division", using a backslash
RSS1 \ RSS2
See the chapter on matrices in the Gretl User's Guide.
 2 Question: since I never used to write a code to test but I usually
 test a model by a click, then a question rises. Is it correct that the 
 output of the test is a series with the same value? 
The output of the test (your variable "LM") should be a scalar:
scalar LM = T * (p - tr(RSS1 \ RSS2))
 2) I suppose that I can obtain also the p-value of the test. Can 
 somebody suggest me the code? 
See the help for the pvalue() function. What you'll want here is 
presumably
scalar pv = pvalue(X, df, LM)
where df is the degrees of freedom for the test.
Allin Cottrell