Announcement

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

  • Type mismatch error

    Hi all,

    I am having a type mismatch error for the following code (final line before the curly brace) when la_seroa is an empty variable. Is there any way for this code to work even if la_seroa is entirely missing?

    forval x=1/$max_sero {
    gen sero`x'_final = ""
    replace sero`x'_final = sero`x'_clean if use_sero`x'== 1
    replace sero`x'_final = la_seroa if use_sero`x'== 2 & num_variant_seroa==`x'
    }

    Thank you!

  • #2
    Monica, please check the type of "la_seroa". "Type mismatch error" appears when, for example, you are trying to assign a numeric value to a string variable.

    Comment

    Working...
    X