Announcement

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

  • scatterplot with missing values in a panel

    Dear all,

    I have a panel data

    xtset id year

    scatter y x

    but x contains some N/A values. and therefore I get an error message.

    How can I skip this problem?

  • #2
    N/A suggests to me that x is not a numeric variable but a string variable; Stata does not know N/A, it only knows missing values: either a dot (.) or a dot and a letter (.a, .b, ...., .z). So if you import data into Stata that contains N/A, Stata will think: "hey that variable contains some observations with characters I do not recognize as part of a number, so I will import that entire variable as text". First step would be to see if this is really the problem. Type desc x (where x is the variable name) and look at the storage type. If it is str and a number or strL, then your variable x is a string. If it is supposed to be a number, then you can use destring with the force option to turn that variable in a numeric variable, and all N/As to missing values.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment

    Working...
    X