Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: regression coefficient by group


From   "Roger B. Newson" <r.newson@imperial.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: regression coefficient by group
Date   Mon, 05 Dec 2011 20:56:15 +0000

And, if you want to recover confidence limits and P-values as well as just the regression coefficients, then you might use -parmby- instead of -statsby-. The -parmby- command is part of the -parmest- package, which you can download from SSC. It creates an output dataset (or resultsset) with 1 observation per parameter per by-group and data on parameter names, estimates, confidence limits, P-values and other parameter attributes.

Best wishes

Roger


Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: r.newson@imperial.ac.uk
Web page: http://www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/popgenetics/reph/

Opinions expressed are those of the author, not of the institution.

On 05/12/2011 18:18, Rui Zeng wrote:
Dear Statalisters,

  I want to collapse my dataset by a group variable and retain the regression coefficient of the independent variables. In other  words, I'd like to be able to do something like:

by group: egen regression coefficients =regress(var1 var2 var3 var4)
collapse corr12, by(group)


I know I can do:
by group: regress var1 var2 var3 var4
but I want to save the results and do further analysis on them rather than just displaying them.


thanks!
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index