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

Re: st: RE: logistic regression: changing a coefficient

From   Richard Williams <>
Subject   Re: st: RE: logistic regression: changing a coefficient
Date   Tue, 15 Feb 2005 12:20:04 -0500

At 09:03 AM 2/15/2005 -0800, Schonlau, Matthias wrote:
Good point. My example failed to say that I have about 100 explanatory variables. This line
gen xb2 = _b[_cons] + -.35*mpg + _b[weight]*weight
is cumbersome in my case - but I' ll think about whether I can automate it in a loop.

Thanks for your suggestion!
Well, how about something like

. sysuse auto
(1978 Automobile Data)

. qui logit fore mpg weight

. predict xb, xb

. gen xb2 = xb - _b[mpg]*mpg + -.35*mpg

In other words, let -predict- predict the value using the estimated coefficients, then subtract the coefficient*var that you want to change, and then add the different coefficient* var that you want?

Richard Williams, Associate Professor
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: Richard.A.Williams.5@ND.Edu
WWW (personal):
WWW (department):

* For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index