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

RE: st: Re: Saving 1 observation

From   "Nick Cox" <>
To   <>
Subject   RE: st: Re: Saving 1 observation
Date   Fri, 30 May 2008 18:32:51 +0100

I think this is a good summary of the situation. I'd support
consideration of the general idea with a small twist. 

Very simply, -save- is such a fundamental command that there should not
be any scope for people to get confused about whether they had indeed
"saved" their data, meaning all of it. Or rather, if something went
wrong, there should not be any scope for users to say that the syntax is
misleading or ambiguous, or that they got confused. 

Thus, if -save- allows -if- or -in- does a partial save count as a
-save-? If you read in a .dta file, change it, -save- some of it and
then want to -exit- what should Stata do? Let you do that or warn you? 

Situations like that make me think that -save- should remain as it is. 

But there might usefully be a new command that was (say) -psave- for a
partial save and that insisted on -if- or -in-. 

It's still treacherous territory, however. For example, someone cleverly

psave if 1

Would that also count as a -save-? 

So, don't be surprised if StataCorp conclude that this might burn or
confuse more people than it helped. 


Sergiy Radyakin

Thank you everyone who responded to my question regarding saving one
observation (or small number of observations) in Stata.

Michael Blasnik suggested using -post- command, which allows creating
native Stata datasets, although without labels (I am adding them later
in a separate loop).

Jeph Herrin noted however, that while -save- does not support if/in,
-outsheet- does, and this could be exploited to solve the problem at

Both suggestions boost performance of my initial program, which is
what I was looking for. But as Nick Cox has noted, the problem appears
to be already long-known and no more efficient solution has been found
so far.

So, as a wish for Stata 11 may I suggest adding if/in to save's
syntax? (Or a special export command for this purpose if if/in could
cause any compatibility issues).

*   For searches and help try:

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