Hi, I'm having trouble figuring out why I keep getting the error "type mismatch" with this command:
. replace foundonstreet = 1 if wherefound == "Street"
type mismatch
r(109);
Did you write
generate foundonstreet = "0" ?
That denotes foundonstreet as a string; removing "" will make it numeric.
The error message type mismatch r(109) means that in an expression, you attempted to combine a string and numeric subexpression in a logically impossible way. When you generated the new variable foundonstreet, make sure there are no "" around 0. As Mariya said, that denotes foundonstreet as a string rather than numeric variable.
OK thanks!!