Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: testing coefficients using parmby command

From   David Ashcraft <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: testing coefficients using parmby command
Date   Fri, 27 Jul 2012 05:14:56 -0700 (PDT)

Thanks Roger. Do you have any example that I can follow? What you have said makes complete sense but it is a little overwhelming for me to implement. 


----- Original Message -----
From: Roger B. Newson <[email protected]>
To: [email protected]
Sent: Friday, July 27, 2012 1:22:38 PM
Subject: Re: st: testing coefficients using  parmby command

To do this, you have to use -parmest- inside a loop, instead of using 
-parmby-. You need to loop over the values of -id-. In each iteration of 
the loop, you nee to execute your command for the current -id- group, 
use -test- to extract the test statistics for the current -id- group, 
and then use -parmest- for each -id- group, storing the test statistics 
in the -idnum()- or -idstr)_- options of -parmest-, and storing the 
results for the current -id- group in a -tempfile-. After doung this, 
you can concatenate the resultssets created, using -append- or maybe 
-dsconcat-, and then you will have a combined resultsset in memory, 
complete with test statistics.

I hope this helps.

Best wishes


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
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: [email protected]
Web page:
Departmental Web page:

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

On 26/07/2012 12:34, David Ashcraft wrote:
> I am using parmby command to regress a number of equations by id as per below:
> parmby "regr y x1 ,robust",by(id) label saving(myparms3,replace)
> Now I want to test for each id:
> test _cons=0
> test X1=1
> test (_cons=0)(X1=1)
> and store these results on myparms3 file.
> At the moment when I run the last three commands, it simply give me the result of last regression.
> Any help will be highly appreciated.
> Regards
> David
> *
> *   For searches and help try:
> *
> *
> *
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index