Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Steve Martin" <stephen.martin@york.ac.uk> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | RE: st: how to convert regression coefficients into variables |
Date | Wed, 30 Mar 2011 10:04:08 +0100 |
Ahh, thanks Nick. saving("`tf`i''") appeared not to work for me so I thought that there was a problem with ("`tf`i''") but I've discovered that I had a typo in tempfile tf`i' so that caused the problem and not the ("`tf`i''"). Once again, thanks Nick. Steve -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox Sent: 30 March 2011 09:46 To: statalist@hsphsun2.harvard.edu Subject: Re: st: how to convert regression coefficients into variables Possibly something along these lines forval i = 1/9 { tempfile tf ... parmest ... saving(`tf') local tflist `tflist' "`tf'" } dsconcat `tflist' Each time round the loop `tf' will be different, but you keep track of them all by putting them in a bag one by one. They don't _have_ to be numbered. You can do it this way if you want forval i = 1/9 { tempfile tf`i' ... parmest ... saving("`tf`i''") local tflist `tflist' "`tf`i''" } dsconcat `tflist' Nick > > > On Wed, Mar 30, 2011 at 9:25 AM, Steve Martin <stephen.martin@york.ac.uk> wrote: >> Yes, thanks Dimitriy! >> >> I've one more query. Following Roger's example, I'm writing the parameters >> from successive estimations to tempfiles using: parmest, saving(`"`tf1'"', >> replace). >> >> I would like to use this in conjunction with a forvalues i=1/9 command. How >> should I specify `"`tf1'"' if I want to replace the 1 in `"`tf1'"' with i? >> >> Steve >> >> >> -----Original Message----- >> From: owner-statalist@hsphsun2.harvard.edu >> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Dimitriy V. >> Masterov >> Sent: 29 March 2011 19:31 >> To: statalist@hsphsun2.harvard.edu >> Subject: Re: st: how to convert regression coefficients into variables >> >> Steve, >> >> Take a look at Roger Newson's package parmest at ssc. >> >> Does that accomplish what you want? >> >> DVM >> >> On Tue, Mar 29, 2011 at 2:26 PM, Steve Martin <stephen.martin@york.ac.uk> >> wrote: >>> I am using -cnsreg- to estimate a constrained regression model in Stata >> 11. >>> >>> >>> I am interested in how the coefficient (call this b2) on one particular >>> regressor changes as I change the constraints (call the values of these b3 >>> and b4) on two of the other regressors. >>> >>> At the moment the results for each regression are written to a >> spreadsheet. >>> >>> However, it would be useful if I could save the values of b2, b3 and b4 >> from >>> each regression (eg by writing to a file) with a view to plotting b2, b3 >> and >>> b4 from the 30 or so regressions I estimate. >>> Is this possible? * * 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/