Announcement

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

  • must have nonnegative integer values

    Hi, I hope you all doing good.

    I am new here, and working on measurement of educational disparities at district level.
    I am using "dstdize" stata command;
    dstdize yschooling pop agegroup gender, by( district ) using(world_pop.dta)

    but I am receiving error message " yschooling must be <= pop"

    here yachooling= years of schooling

    can you please guide me how to resolve this issue?

  • #2
    Well, I don't think the Stata documentation of -dstdize- makes it clear, but this command is intended for calculating adjusted rates, that is, ratios in which the numerator is a subset of the denominator. In that case, necessarily the numerator is less than or equal to the denominator. Your variable, yschooling, does not really fit here, as the number of years of schooling will typically be > 1 per person.

    To be honest, I'm not sure why -dstdize- imposes this restriction, because the exact same calculations are just as useful and important for variables like yschooling that are not rates in that sense of the word. But it does. So you won't be able to use -dstdize- for this. But you can do the calculations yourself. The PDF manuals that are installed with your Stata shows a worked example of how to do this. It is Example 1 in the -dstdize- documentation, and in the current version, it begins on page 558. You can use that as a model to get the results you want.

    By the way, in the future, please provide your posts with a title that describes what is being asked/discussed. The actual content in #1 has nothing to do with "must have nonnegative integer values." People searching for help here need the titles they search on to be relevant. Thank you.

    Comment


    • #3
      Thank you Clyde for your reply.
      I would be careful for writing title in future.

      this command works if I use binary variable like literacy (0=can read, 1=can read); but I am interested to use a discrete variable "years of schooling" and want to apply international network for the demographic evaluation of populations and their health (INDEPTH) age structure for analysis. please suggest me an easy way by using stata.

      Comment


      • #4
        As I suggested in #2
        But you can do the calculations yourself. The PDF manuals that are installed with your Stata shows a worked example of how to do this. It is Example 1 in the -dstdize- documentation, and in the current version, it begins on page 558. You can use that as a model to get the results you want.
        Try it out. If you run into difficulties, post back showing example data (using the -dataex- command), and the code you have tried (between code delimiters) and any output (including error messages) Stata gives you, and then somebody can try to troubleshoot. If you are not familiar with code delimiters, please read FAQ #12, where you will also find instructions for -dataex- if you are not familiar with that.

        Comment


        • #5
          Dear Clyde, as per your suggestion, I have tried to find the way but I am facing a problem. I hope its not a big deal for people like you.

          For district level age wise standardisation of years of schooling I need following data:

          1. standard population distribution (I do have, INDEPTH distribution rates)
          2. Age-group wise total number of years of schooling for each district. where district is categorical variable (36 districts), age-group (20 categories), and yschooling (is years of schooling for each individual of household), so I want to produce a table showing district, agegroup and for total number of years of schooling for each agegroup. I had tried 3 and 4 way tabulation but its not providing me desired results.
          I would be happy If you suggest me, how to move fwd?

          Comment


          • #6
            As I said in #4.

            If you run into difficulties, post back showing example data (using the -dataex- command), and the code you have tried (between code delimiters) and any output (including error messages) Stata gives you, and then somebody can try to troubleshoot.

            Comment

            Working...
            X