Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: changing beta coefficients


From   "Scott Merryman" <smerryman@kc.rr.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: changing beta coefficients
Date   Mon, 11 Apr 2005 16:05:11 -0500

Richard,

This has to be wrapped up in a program, right?

Something like this:

program foo, eclass
	tempname bmat
	matrix `bmat' = e(b)
	matrix `bmat'[1,1] = 122
	ereturn repost b = `bmat'
end


. clear

. sysuse auto
(1978 Automobile Data)

. qui reg price mpg weight

. matrix list e(b)

e(b)[1,3]
           mpg      weight       _cons
y1  -49.512221   1.7465592   1946.0687

. foo

. matrix list e(b)

e(b)[1,3]
          mpg     weight      _cons
y1        122  1.7465592  1946.0687


Scott


> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of Richard Williams
> Sent: Monday, April 11, 2005 6:19 AM
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: changing beta coefficients
> 
> At 10:23 AM 4/11/2005 +0200, Peter Haan wrote:
> >dear stata list,
> >
> >I have the following question:
> >
> >Is it possibe to change the estimated vector of beta coefficients by
> hand.
> >I want to predict   with a slightly different beta vector than the
> >estimated,
> >The idea is to replace the estimated vector e(b)  by an artificial e(b*)
> >and then to use the command pred,
> >however, as far as I know I cannot change e(b).
> 
> Yes you can.  Check out -ereturn repost-.  You might, for example, do
> something like
> 
>          tempname bmat
>          matrix `bmat' = e(b)
>          ...Make changes to `bmat'...
>          ereturn repost b = `bmat'
> 
> 
> 
> -------------------------------------------
> Richard Williams, Notre Dame Dept of Sociology
> OFFICE: (574)631-6668, (574)631-6463
> FAX:    (574)288-4373
> HOME:   (574)289-5227
> EMAIL:  Richard.A.Williams.5@ND.Edu
> WWW (personal):    http://www.nd.edu/~rwilliam
> WWW (department):    http://www.nd.edu/~soc
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index