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: how to convert regression coefficients into variables


From   "Steve Martin" <[email protected]>
To   <[email protected]>
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: [email protected]
[mailto:[email protected]] On Behalf Of Nick Cox
Sent: 30 March 2011 09:46
To: [email protected]
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 <[email protected]>
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: [email protected]
>> [mailto:[email protected]] On Behalf Of Dimitriy V.
>> Masterov
>> Sent: 29 March 2011 19:31
>> To: [email protected]
>> 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 <[email protected]>
>> 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/


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