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

st: Re: Rép. : Re: st: tab-delimited output of -tabodds

From   Margaret R Grove <margaret.r.grove@Dartmouth.EDU>
Subject   st: Re: Rép. : Re: st: tab-delimited output of -tabodds
Date   Wed, 26 Mar 2008 08:38:52 -0400


My apologies! I think the first three scalars only occur with a single variable for tabodds!


Herve STOLOWY wrote:

Dear Margaret:

I thank you for your reply. I tried your solution. However, I have a problem with the first three scalars which do not show up in the return list. Consequently, when I generate the first three variables (e.g., odds), I only get missing values. Would you have any idea?

Best regards


President of the French Accounting Association (AFC)
HEC Paris
Departement Comptabilite Controle de gestion / Dept of Accounting and Management Control
1, rue de la Liberation
78351 - Jouy-en-Josas
Tel: +33 1 39 67 94 42 - Fax: +33 1 39 67 70 86
mail: stolowy at hec dot fr

Margaret R Grove <margaret.r.grove@Dartmouth.EDU> 5:51 pm 3/25/2008 >>>
Here's a very clunky example of how to get a tab-delimited file of the results of tabodds. Note that if you are doing multiple tabodds commands, using "postfile" with scalars would make this a bit more elegant.

webuse bdesop,clear

tabodds case alcohol [fw=freq]

*** Assign the return codes to variables
gen odds=r(odds)

gen lb_odds=r(lb_odds)

gen ub_odds=r(ub_odds)

gen chi2_hom=r(chi2_hom)

gen p_hom=r(p_hom)

gen df_hom=r(df_hom)

gen chi2_tr=r(chi2_tr)

gen p_trend=r(p_trend)

*** Keep only the first observation

keep if _n==1

*** Fix up p-values for readability

replace p_hom=0.0001 if p_hom<.0001

replace p_trend=0.0001 if p_trend<.0001

*** output the results to a tab-delimited file

outsheet odds lb_odds ub_odds chi2_hom p_hom df_hom chi2_tr p_trend using test.txt, replace

If you don't need all the variables, just use the ones you need.


Svend Juul wrote:

Herve Stolowy wrote:
Do you know a way to get a tab-delimited file after -tabodds-?
I don't think you can. Some tables are nicely formatted, and highlighting the table, right-clicking, and selecting -copy table- generates a tab-separated file. But -tabodds-
is poorly formatted with the first three columns run together,
and it will not work. To see the formatting, you can paste to Excel and take a look.
StataCorp: It would be a good idea to make a cleaning operation,
i.e., check how the tabular output from various commands are
formatted, and make a consistent formatting for those commands
that don't do it right.
________________________________________________________ Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6 DK-8000 Aarhus C, Denmark Phone, work: +45 8942 6090 Phone, home: +45 8693 7796 Fax: +45 8613 1580 E-mail: _________________________________________________________
* For searches and help try:
* * *
* For searches and help try:
* * *

* For searches and help try:
*   For searches and help try:

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