Announcement

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

  • Filter specific age group in IVS dataset

    I want to investigate if work values distinguish between cohorts.
    I have merged the EVS and WVS to the IVS and now want to focus on a specific age group: keep only birth cohorts 1955 - 1968, since they were between 15-67 years old in the survey period.
    Do you have any ideas on how I can do this?

  • #2
    Please read the Forum FAQ for excellent advice about how to pose a question in a way that maximizes your chances of drawing a timely and helpful response. Among the things you will learn there is to avoid using jargon or unexplained abbreviations. It may be that everybody in your field knows what EVS, WVS and IVS are, but hardly anybody else will. This is a multidisciplinary, international forum. You should assume that the only common knowledge here is some level of statistics and a bit of knowledge about Stata, as well as terms that any college graduate anywhere in the world would know. Anything that doesn't fit that description should be explained.

    In particular, since I have never heard of EVS, WVS, or IVS, I have no idea what kind of data you are starting with. I suspect the reason your question has gone unanswered for 6 hours is that nobody else does either. Do you have a birthdate variable? Or a birth cohort variable? If a birthdate variable, is it a string, or a Stata internal format numeric date variable? Is it a single variable, or do you have separate day, month, and year variables? You can't get directions to get to your destination when you don't say where you are starting out from.

    And, you will also learn in the FAQ that when asking for help with code, the best way to answer the important questions about your data is to show example data using the -dataex- command. If you are running version 18, 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    All of that said, if you have a numeric variable named birth_cohort that contains the year of birth, you can accomplish what you ask for with
    Code:
    keep if inrange(birth_cohort, 1955, 1968)

    Comment

    Working...
    X