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
K-S test for Pareto distributed data.Hello everyone, for my master's thesis I am working with a survey dataset on wealth distribution wh…
parentheses do not balanceHello, I am trying to do a graph with confidence intervals. I got the following code: twoway (rcap …
Loop to append files using two macrosHi, I'm appending separate country files in to one (US_1.dta, US_2.dta.........GB_1.dta,GB_2.dta). …
What is the meaning of p-value for trends?Hello, I am working on an assignment that asks for the interpretation of a ptrend value in a regres…
Obtaining time series graphsHey guys, sorry if this is long, but I'm entirely new to stata. I also apologise if I don't use the …
Subscribe to:
Post Comments (Atom)
0 Response to Command works in command window, not in do file
Post a Comment