Hi,
I am trying to drop blank observations (those observations which are missing an email address in the datafile).
When I add the command 'drop if email == ""' to the do-file and run the file, it returns 'invalid name'.
When I type the same command directly into the command window, it drops the unwanted observations successfully.
I am at a loss as to what I am doing wrong, as I am typing (and retyping) the same command, using the same keyboard, each time. I have tried searching here and online, but the keywords I am using seem too common to find anything relevant.
The output is:
drop if email == “”
“” invalid name
r(198);
end of do-file
r(198);
. drop if email == ""
(11 observations deleted)
Many thanks.
Related Posts with Command works in command window, not in do file
RIF regression and decomposition of income inequalityI need help to have the command which is used in this paper of Rios Avila (2019) to have the results…
How to interpret the outcome of command “gllamm”?Dear statalists, I have gotten the outcome of “gllamm”,but I don't know how to illustrate,could you …
Overall title when using a by option with marginsplotI am using marginsplot (in V16.1) with a by option and getting a graph I like, but I can't figure ou…
putexcel for multiple tables extending beyond Excel column ZI recently found myself with need to produce over 1000 cross-tabulations with their respective chi-s…
Looping across sets of variables to generate new variableHi all, This feels like a relatively simple question, so apologies if I have missed a similar answe…
Subscribe to:
Post Comments (Atom)
0 Response to Command works in command window, not in do file
Post a Comment