Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: transformations in commands


From   "Brian P. Poi" <[email protected]>
To   [email protected]
Subject   Re: st: transformations in commands
Date   Fri, 2 Jun 2006 12:39:57 -0500 (CDT)

On 6/2/06, Feiveson, Alan H. (JSC-SK311) <[email protected]> wrote:
Hi  - I have been demonstrating the wonders of Stata to users of R and
have been embarrassed by their criticism of  Stata's inability to
transform a variable within the syntax of a command. For example reg y
log(x) won't work. The variable z=log(x) must be generated first. I'm
curious as to whether other statistical software besides R allows this
sort of thing. At any rate, I would strongly urge Stata Corp. to
incorporate this sort flexibility.

One alternative is to use -nl- instead of -regress-:

. nl (mpg = {b0} + {b1}*log(price))

. nl (mpg = {c0} + {c1}/weight)

For models linear in the parameters, -nl- will converge in just a couple of iterations.


-- Brian Poi
-- [email protected]
*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index