Announcement

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

  • Generate Line Graph

    Dear all,

    I am struggling with my data and would really appreciate your help. My idea is to design a line graph which shows months on the x-axis and # of births on the y-axis of a specific country.

    The data is as follows:
    country date births
    AUT 2012 ..
    AUT 2013
    AUT 2014
    BEL 2012
    BEL 2013
    BEL 2014

    where births is a floating variable, date a floating variable and country a long variable.

    When I use the following code, I always get the message "type mismatch r(109)" and I suppose that the mismatch must come from the country variable but I have no clue how to fix it.
    Do you have any idea where my mistake is?


    [twoway (line births date if country="BEL")]


    I really appreciate your help!

  • #2
    Please use dataex to give a data example as explained at https://www.statalist.org/forums/help#stata

    Code:
    if country == "BEL"
    would be legal if and only if country were a string variable. A single equals sign is always wrong there. Perhaps country is a numeric variable with value labels. A data example would make this clear to us.

    Comment

    Working...
    X