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
Stata Version and MEOLOGIT Model ConvergenceBasic question here, but when collaborating on analysis with a colleague with a different version of…
stack or reshape?Dear All, I have this dataset Code: * Example generated by -dataex-. To install: ssc install datae…
Counting year and company-wise string observationsHi everyone, I have a dataset of governance data, listing each company's directors and whether they…
Help on using coded variables to run the mincer wage equation?Hi, I'm trying to run the mincer wage equation using ols regression with a random effect model. In …
How to perform impulse response function (IRF) and forecast error variance decomposition (FEVD) based on panel VECM?Hi all, I am currently working on a panel error correction model (PVECM), and trying to perform IRF…
Subscribe to:
Post Comments (Atom)
0 Response to Command works in command window, not in do file
Post a Comment