[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: Simple syntax question
OK, I have corrected the first two errors, but how to compute
sum11_i_j, sum10_i_j, etc over sumT_i_j in the second loop, i.e. instead
of ..., which should be a scalar of high precision. Thanks.
*INITIALIZE SUMS;
forval i=1/5 {;
local I=`i'+1;
forval j=`I'/`nj' {;
local sum11_`i'_`j'=10;
local sum10_`i'_`j'=20;
local sum01_`i'_`j'=30;
local sum00_`i'_`j'=40;
local sumT_`i'_`j'=100;
};
};
*COMPUTE RELATIVE FREQUENCIES;
forval i=1/5 {;
local I=`i'+1;
forval j=`I'/`nj' {;
local frq11_`i'_`j'=...;
local frq10_`i'_`j'=...;
local frq01_`i'_`j'=...;
local frq00_`i'_`j'=...;
};
};
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/