Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: RE: RE: lincom intolerant of the variable name "d"


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: RE: RE: lincom intolerant of the variable name "d"
Date   Sun, 27 Jun 2010 11:47:13 +0200

<>

-lincom- internally calls -test-, and -test- is fed

***********
test 1.d - 2.d=0
***********

which leads to the error. On the other hand,

***********
test 1.d = 2.d
***********

i.e. an equivalent formulation, causes no such problems...

HTH
Martin


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Philip Ryan
Sent: Sonntag, 27. Juni 2010 11:25
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: RE: RE: lincom intolerant of the variable name "d"

<<>>

Quite so.  Maybe something is going on in the depths of Stata's new code for
factor variables?  Whatever the underlying cause, it looks like Stata is
misinterpreting the use of "d" in this context and I guess it is up to the
guys at StataCorp to explain/fix.

Many years ago I reported to the List a problem with using the single letter
"e" as a variable name, as Stata sometimes confused this with its syntax for
representing powers of 10 (E+03  etc).  This was fixed, but I have been a
little wary of using single letters as variable names since.

Phil


Philip Ryan
University of Adelaide

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Martin Weiss
Sent: Sunday, 27 June 2010 6:37 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: RE: lincom intolerant of the variable name "d"


<>

I thought the same last night, until I noticed that other operators from -h
tsvarlist- do not cause the same problem. You can try this by inserting
different operators such as "s" "S" "l" "L" for the -local- at the top. The
problem occurs for the lower and uppercase "d" only:


***********
local myletter d

clear*
set obs 1000
gen `myletter'=irecode(runiform(),0, .2,.5,1)
gen y = 1+2*`myletter'+rnormal()
reg y ib3.`myletter'
lincom 1.`myletter' - 2.`myletter'
***********


HTH
Martin

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Philip Ryan
Sent: Sonntag, 27. Juni 2010 02:37
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: lincom intolerant of the variable name "d"

<<>>

Possibly because Stata is interpreting your "d" as the differencing operator
in its time series commands?  See -help tsvarlist-  where Remark #4 states
that although the operator is "D.", lower case is also acceptable.

Phil

Philip Ryan
Professor and Director
Data Management & Analysis Centre
UNiversity orf Adelaide

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Airey, David C
Sent: Sunday, 27 June 2010 5:55 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: lincom intolerant of the variable name "d"

.

After use of anova and margins, I got this error:


. test 1.d = 2.d

 ( 1)  1bn.d - 2.d = 0

           chi2(  1) =   18.46
         Prob > chi2 =    0.0000

. lincom 1.d - 2.d
d-2:  operator invalid
r(198);

And then, changing the variable name "d" to "drug", I got this:

. test 1.drug = 2.drug

 ( 1)  1bn.drug - 2.drug = 0

           chi2(  1) =   18.46
         Prob > chi2 =    0.0000

. lincom 1. drug - 2. drug

 ( 1)  1bn.drug - 2.drug = 0

----------------------------------------------------------------------------
--
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
         (1) |        1.8   .4189935     4.30   0.000     .9787878
2.621212
----------------------------------------------------------------------------
--

Why would the variable name "d" be a problem?

-Dave


*
*   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/

*
*   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/

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index