Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Writing output from byvar and tab to dataset


From   Olalekan Uthman <[email protected]>
To   [email protected]
Subject   st: Writing output from byvar and tab to dataset
Date   Sat, 10 Nov 2007 02:34:13 -0800 (PST)

Dear Statalisters, 

I am trying to write results fom byvar and tab result
to a dataset (e.g):

. webuse hiv

. byvar  cd4: tab  hiv

-> cd4==0 

 1=positive |
       HIV; |
 0=negative |
        HIV |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |          1       33.33       33.33
          1 |          2       66.67      100.00
------------+-----------------------------------
      Total |          3      100.00

-> cd4==1 

 1=positive |
       HIV; |
 0=negative |
        HIV |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |          2       40.00       40.00
          1 |          3       60.00      100.00
------------+-----------------------------------
      Total |          5      100.00

-> cd4==2 

 1=positive |
       HIV; |
 0=negative |
        HIV |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |          3       75.00       75.00
          1 |          1       25.00      100.00
------------+-----------------------------------
      Total |          4      100.00


and write the output to a dataset: 

cd4	hiv0	hiv1	total	
0	1	2	3		
1	2	3	5
2	3	1	4	

Can somebody point me in the correct direction for
doing this?

Thanks.

Olalekan Uthman
Thanks

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index