Hello all,
I'm needing to TAB for every observation (of several
million) and pick out only certain results from the
TAB and assign it for the relevant observation. How
would I do that?
Example:
var1 var2
1 A
2 A
3 A
3 B
tab var1 if var2=A
results:
1 33%
2 33%
3 33%
For each of observation where var2=A, I would like to
assign sum of the squares of the percentages in the
tab results table in a new variable (say var3). So,
final result would look like:
var1 var2 var3
1 A 3267 (=33^2+33^2+33^2)
2 A 3267
3 A 3267
3 B -
How can I do this? Thank you very much in advance,
Tj
____________________________________________________________________________________
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/
*
* 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/