Dear all,
I have a matrix consisting of two columns: one with the total number of patients and another with the number of cases. There are 60 rows, and I want to compare row 2 with row 1, then row 3 with row 2, and so on, using prtesti.
I did the following:
mkmat totalpacientes totalvedo , matrix(data)
matrix list data
data[60,2]
totalpacie~s totalvedo
r1 27424 587
r2 33583 723
r3 36663 784 ...
forvalues i = 1/60 {
local total`i' = data[`i',1]
local casos`i' = data[`i',2]
local total`i+1' = data[`i'+1,1]
local casos`i+1' = data[`i'+1,2]
di "Comparing month `i' with month `i+1'"
prtesti total`i' casos`i' total`i+1' casos`i+1'
}
I got the error:
'total1' found where integer expected
Where is the mistake in my command?
Thanks for your time
T
I have a matrix consisting of two columns: one with the total number of patients and another with the number of cases. There are 60 rows, and I want to compare row 2 with row 1, then row 3 with row 2, and so on, using prtesti.
I did the following:
mkmat totalpacientes totalvedo , matrix(data)
matrix list data
data[60,2]
totalpacie~s totalvedo
r1 27424 587
r2 33583 723
r3 36663 784 ...
forvalues i = 1/60 {
local total`i' = data[`i',1]
local casos`i' = data[`i',2]
local total`i+1' = data[`i'+1,1]
local casos`i+1' = data[`i'+1,2]
di "Comparing month `i' with month `i+1'"
prtesti total`i' casos`i' total`i+1' casos`i+1'
}
I got the error:
'total1' found where integer expected
Where is the mistake in my command?
Thanks for your time
T
Comment