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

From |
Margaret R Grove <margaret.r.grove@Dartmouth.EDU> |

To |
statalist@hsphsun2.harvard.edu |

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

Date |
Wed, 26 Mar 2008 08:38:52 -0400 |

Herve,

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

Meg

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

Herve

***********************************************************

Professeur/Professor

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

France

Tel: +33 1 39 67 94 42 - Fax: +33 1 39 67 70 86

mail: stolowy at hec dot fr

web: http://www.hec.fr/stolowy

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.Margaret R Grove <margaret.r.grove@Dartmouth.EDU> 5:51 pm 3/25/2008 >>>

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.

Meg

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

________________________________________________________ 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: sj@soci.au.dk _________________________________________________________

*

* 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/

* 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/

*

* 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/

* * 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/

**References**:**Re: st: tab-delimited output of -tabodds***From:*"Svend Juul" <SJ@SOCI.AU.DK>

**Re: st: tab-delimited output of -tabodds***From:*Margaret R Grove <margaret.r.grove@Dartmouth.edu>

**=?UTF-8?Q?R=C3=A9p.=20:=20Re:=20st:=20tab-delimited=20output=20o?==?UTF-8?Q?f=20-tabodds?=***From:*"Herve STOLOWY" <stolowy@hec.fr>

- Prev by Date:
**Re: st: Creating single characters from long strings** - Next by Date:
**AW: st: Creating single characters from long strings** - Previous by thread:
**=?UTF-8?Q?R=C3=A9p.=20:=20Re:=20st:=20tab-delimited=20output=20o?==?UTF-8?Q?f=20-tabodds?=** - Next by thread:
**st: Definition of strata and PSUs when svysetting** - Index(es):

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