I have 253 observations and each observation had 100 rounded experiment.
What I would like to do is that: I want to run signrank test to test whether the those 100 sequence is random from average.
I want to loop and capture the results in a matrics. From the forum, I summarized the code below:
However it does not work. On the other hand, I cannot capture the Prob(z) and the sign of the test.
Any idea to improve the code?
What I would like to do is that: I want to run signrank test to test whether the those 100 sequence is random from average.
I want to loop and capture the results in a matrics. From the forum, I summarized the code below:
Code:
foreach var in P {
bysort P: signrank Bid = AvgP
matrix signrankf = (r(z))
matrix rownames signrankf = `var'
matrix colnames signrankf = "z-value"
mat2txt, matrix(signrankf) saving(signrankf) append
}
However it does not work. On the other hand, I cannot capture the Prob(z) and the sign of the test.
Any idea to improve the code?

Comment