Bookmark and Share

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


[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. 
Regards

David


----- Original Message -----
From: Roger B. Newson <[email protected]>
To: [email protected]
Cc: 
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


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: [email protected]
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 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:
> *  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?searchhttp://www.stata.com/support/statalist/faqhttp://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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index