Statalist


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

st: AW: AW: RE: AW: label problem in sts test


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: AW: RE: AW: label problem in sts test
Date   Thu, 29 Oct 2009 15:11:01 +0100

<> 

So we could get the same effect via


*************
clear*
set obs 1
gen myvar=1
la def yesno 0 "no" 1 "yes"
label values myvar yesno

ta my

decode my, gen(new)
la drop yesno
decode my, gen(new2)
*************

where the problem is now more obvious...


HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Martin Weiss
Gesendet: Donnerstag, 29. Oktober 2009 15:05
An: [email protected]
Betreff: st: AW: RE: AW: label problem in sts test


<> 


Ok, point taken. The quote is still there in [D], p. 355 at the top. 

-sts test- tries to -decode- somewhere along the way, and that is where it
chokes on the missing value label...



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Isabelle
Deltour
Gesendet: Donnerstag, 29. Oktober 2009 14:57
An: [email protected]
Betreff: st: RE: AW: label problem in sts test

Hi Martin, 
Thanks for your answer. 
What surprised me is that the documentation says:
"as stated earlier, Stata does not mind if a nonexistent value label is
associated with a variable. When Stata uses such a variable, it simply acts
as if it is not labeled;"
Data management (stata9), p293. 

If I am understanding the sentence above correctly, the behavior discussed
should not happen.(and one solution is to label the variable properly). 
Hope this helps 
Isabelle

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Martin Weiss
Sent: Thursday, October 29, 2009 2:14 PM
To: [email protected]
Subject: st: AW: label problem in sts test


<> 

This problem can be reproduced via


*************
webuse stan3, clear
stset, noshow
sts test posttran
codebook postt
la def yesno 0 "no" 1 "yes"
label values posttran yesno
la drop yesno
sts test posttran
*************

Question: What is surprising about that? Depriving a variable of its -label-
is never a good idea, I would think...

And Isabel already has a remedy available to her, as she mentioned
herself...


HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Isabelle
Deltour
Gesendet: Donnerstag, 29. Oktober 2009 13:57
An: [email protected]
Betreff: st: label problem in sts test

Dear Stata-listers, 

For a survival analysis, I made a dataset where I had assigned a label
To a variable, but, by mistake, the label was not defined. 
I think that this situation produced an error message in the 
command sts test. 


sts test DV 

         failure _d:  diaggrp
   analysis time _t:  (DateOfFup-origin)/365.25
             origin:  time fdato
  exit on or before:  diaggrp==10 20 30 40 50 60 70 80 90 100 110 120
130 140 time mdy(12, 1, 2006)
                 id:  pnr
value label YesNoLbl not found
r(111);

. label list

Is this expected? Have others met this situation?
(Note that I fixed my problem by assigning the label as it should have
been in the first place. )

Thank you for your comments

Isabelle Deltour

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