Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

RE: st: Search Notes


From   "Sarah Edgington" <[email protected]>
To   <[email protected]>
Subject   RE: st: Search Notes
Date   Wed, 31 Oct 2012 14:02:01 -0700

If I run Pedro's two examples I get the same result he does.  
It appears that notes search only works if there is a note for the data set
as a whole (rather than just for specific variables).

When I run the below example, I get no results for the searches before
adding the generic note, but do after.

-Sarah

**begin example code
clear *
input a b c
1 2 3
4 5 6
7 8 9
end

note a: this is a note
note b: Pedro Nakashima

**search doesn't find these notes
notes search Pedro
notes search note

**Add a note to the data set generically
note: add a data note 

**now search works
notes search Pedro
notes search note

**end of example code




-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nick Cox
Sent: Wednesday, October 31, 2012 1:29 PM
To: [email protected]
Subject: Re: st: Search Notes

That looks testable, but not by me at this moment. I am away from my Stata.

Nick

On Wed, Oct 31, 2012 at 8:10 PM, Pedro Nakashima
<[email protected]> wrote:
> Sorry, I was away from my computer, so I inverted the commands..
>
> If we use the official dataset:
>
> use http://www.stata-press.com/data/r12/auto, clear
> note: check reason for missing values in {cmd:rep78}
>
> . note mpg: is the 44 a mistake? Ask Bob.
> . note mpg: what about the two missing values?
> . note mpg: Pedro Nakashima
> . note mpg: Esse é um teste
>
> . notes search Pedro
>
> Stata returns
>
> mpg:
>   3.  Pedro Nakashima
>
> If, however, we type
>
> . clear *
> . input a b c
> . 1 2 3
> . 4 5 6
> . 7 8 9
> . end
>
> . note a: is the 44 a mistake? Ask Bob.
> . note a: what about the two missing values?
> . note b: Pedro Nakashima
> . note b: Esse é um teste
>
>
> . save teste, replace
>
> . notes search Pedro
>
> Stata returns
>
> . notes search Pedro
> Pedro: not found
>
> I don't know what's happening
>
> Once more, thanks for the answer..
>
> 2012/10/31 Nick Cox <[email protected]>:
>> You've got the syntax backwards below. You type -note- or -notes- 
>> first. If you really type -mpg note- it won't work (unless bizarrely 
>> you have defined a program -mpg-).
>>
>> We still need, minimally, an example of what you really typed, and 
>> ideally something that we can test ourselves.
>>
>> As the FAQ advises (see
>> http://www.stata.com/support/faqs/resources/statalist-faq/#stata )
>>
>> "Say exactly what you typed and exactly what Stata typed (or did) in 
>> response. N.B. exactly! If you can, reproduce the error with one of 
>> Stata's provided datasets or a simple concocted dataset that you 
>> include in your posting."
>>
>> Nick
>>
>> On Wed, Oct 31, 2012 at 6:03 PM, Pedro Nakashima 
>> <[email protected]> wrote:
>>> Let's say we are using the example presented by -help notes-with an 
>>> additional note:
>>>          . mpg note: is the 41 to mistake? Ask Bob.
>>>          . mpg note: what about the two missing values?
>>>          . mpg note: Pedro Nakashima When we looked for the last 
>>> one..
>>>          . search notes Nakashima
>>> we can find it ...
>>>          mpg:
>>>            One. Pedro Nakashima
>>> But to another database (previously saved), if we
>>>          . anyvariable note: this is the first note
>>>          . anyvariable note: this is the second note
>>>          . anyvariable note: Pedro Nakashima and also
>>>          . search notes Nakashima
>>> the result is
>>>     not found
>>>
>>> there's nothing in either -help notes- or statalist posts that 
>>> explains this kind of error..
>>>
>>> 2012/10/30 Nick Cox <[email protected]>:
>>>> It is difficult to say what you are doing wrong. You need to show 
>>>> us code in which you create a -note- and then can't find it. Did 
>>>> you forget to -save- the dataset after creating a -note- and are 
>>>> looking for it in a different session?
>>>>
>>>> Nick
>>>>
>>>> On Tue, Oct 30, 2012 at 11:49 PM, Pedro Nakashima 
>>>> <[email protected]> wrote:
>>>>
>>>>> I'm using Stata 12.
>>>>>
>>>>> I'm looking for notes at my dataset with exactly the same syntax 
>>>>> specified in the help for -notes- (-notes search-), but it always 
>>>>> returns "not found" after the execution of the command .
>>>>>
>>>>> The strange thing is that when I write the same notes and then 
>>>>> look for them in the sample dataset (auto.dta), the notes are found.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index