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
Lognormal regression & Trucated normal regression in hurdle modelI want to estimate the effect of socio-economic status on private tuition expenditure (cross section…
Out-of-sample prediction with threshold regressionHi, I'd like to do out-of-sample prediction after estimating a threshold model. I follow the exampl…
Matching with identifiersHi everyone: Below is a sample of a dataset that I have been working on. HH ID Relationship to …
appropriate filterDear community, It is my first time using STAT and I am stuck with an assignment. It says: "In Stat…
Instrumental Variable (2SLS) First stage different sample compared to Second Stage?Dear all, I have a question with regard to Instrumental variable regression. My sample is identifi…
Subscribe to:
Post Comments (Atom)
0 Response to Command works in command window, not in do file
Post a Comment