I would like to create empty matrixes within mata, whose size is given by a parameter. My program first asks for which tests should be executed and then I create the matrix size accordingly, such that I can save all p-values in one matrix. In particular:
program ...
syntax varlist, POOLED(integer) GROUP_mean(integer) MEDIAN(integer) B(integer) DC(integer)
matrix test = (`pooled'\ `group_mean' \ `median')
local nt = test[1,1]+test[2,1]+test[3,1]
end
mata:
void initialize()
{
st_local("nt")
real matrix pval
pval = J(nt, 1,0)
}
end
However that doesn't seem to work. My suspicion is that J will only take integer numbers as arguments. Is this right or is there other mistakes I am running into?
Thank you.
program ...
syntax varlist, POOLED(integer) GROUP_mean(integer) MEDIAN(integer) B(integer) DC(integer)
matrix test = (`pooled'\ `group_mean' \ `median')
local nt = test[1,1]+test[2,1]+test[3,1]
end
mata:
void initialize()
{
st_local("nt")
real matrix pval
pval = J(nt, 1,0)
}
end
However that doesn't seem to work. My suspicion is that J will only take integer numbers as arguments. Is this right or is there other mistakes I am running into?
Thank you.
Comment