Statalist


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

RE: st: collapse prob


From   "Martin Weiss" <martin.weiss@uni-tuebingen.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: collapse prob
Date   Tue, 20 May 2008 13:52:20 +0200

True, but I would want Stata to take care of the naming automatically. E.g.,
prepend or append the name of the stat being calculated so that "(mean) gpa"
becomes "mean_gpa" in the output...

Martin Weiss
_________________________________________________________________

Diplom-Kaufmann Martin Weiss
Mohlstrasse 36
Room 415
72074 Tuebingen
Germany

Fon: 0049-7071-2978184

Home: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1130

Publications: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1131

SSRN: http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=669945


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Svend Juul
Sent: Tuesday, May 20, 2008 10:38 AM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: collapse prob


Martin Weiss wrote:

In this example, does your Stata complain about a "name conflict" as
well?

**************
webuse college, clear
collapse (mean) gpa (median) gpa [fw=number], by(year)
**************

In effect, you cannot calculate two statistics for the same variable
without
renaming one of the results. This is mentioned in [D] collapse at the
bottom
of page 48, but rather cursorily. And correct me if I am wrong, but
there is
just no way you could have these statistics renamed in the dialog box.
You
must first find out that you have the problem I am describing, and
second
edit the command line to 

**********
webuse college, clear
collapse (mean) meangpa=gpa (median) mediangpa=gpa [fw=number], by(year)
**********

to make this work. It took me quite some time to find that out...

================================================================

In the dialog box you can type in the variable field:

    meangpa=gpa

Logically, I think it is obvious that two different pieces of
information must have different names.

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:  +45 8942 6090
Home:   +45 8693 7796
Email:  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/



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