Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with drop

    I thought that this should be simple. I entered the wrong values for some variables and want to delete them. So I typed:

    drop a - b if countryout == 1
    where a - b are the incorrect variables and countryout is a variable equal to 1 if the case has the wrong variables. I get the message that I cannot use an if statement, but the manual says that this is allowed. What am I doing wrong, please? Thanks.

    Ric Uslaner

  • #2
    You can only drop entire observations (rows) or entire variables (columns). You cannot drop single cells. So the correct syntax would be either drop a-b, which will drop the variables a-b in their entirity or drop if countryout == 1 which will drop entire observations where the variable countryout equals 1. But you cannot combine the two syntaxes. Instead you could replace their values with a missing value (.).
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment

    Working...
    X