claire_123
claire_123

Reputation: 85

Missing strings not appearing in Stata 'count' command

I'm attempting to count the number of observations in a variable with missing values. This would seem to require the following simple code:

count if control_ == "."

The observations in variable control are strings. When I run the above code, I get a "0," but when I browse the data, there are many missing values. I have also tried:

count if control_ == " "

What may be happening?

Upvotes: 0

Views: 515

Answers (1)

Bicep
Bicep

Reputation: 1103

Your code, count if control_ == " " is counting strings that are a single space. Try count if control_ == "" (with no space between the quotation marks).

Upvotes: 1

Related Questions