Announcement

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

  • Creating ratio variable from two independent variables for panel data

    Hi all.
    I am using educational attainment data and I have data on female tertiary enrolment(%), male tertiary enrolment(%) and overall tertiary enrolment(%). I want to create a ratio variable of female and male tertiary enrolment rate. How will I generate this tertiary enrolment ratio variable as both independent variables male and female enrolment contains 0 values as well in some cases. I tried to generate the variable in a simple way which is
    gen tertiary ratio = female enrolment/male enrolment. But I don't know whether its a correct way. Help is required.
    ThankYou

  • #2
    your code looks fine as far as it goes; however, if male enrollment is every 0, you will get a missing value and that may not be what you want: e.g., if you want the value to be 1 in that case you would follow the above with
    Code:
    replace tertiary_ratio=1 if male_enrollment==0
    note that since you did not give a data example (please read the FAQ, and since you used illegal variable names (spaces are not allowed), I used underscores; please replace with whatever your real variable names are

    Comment


    • #3
      I don't disagree with Rich Goldstein -- and I doubt he will disagree with this either -- but it seems to me that the existence of zeros means that differences such as

      % male enrolment MINUS % female enrolment

      are likely to be as or more useful here

      Comment


      • #4
        I certainly agree with Nick Cox - and as can be seen by past posts, I am not a fan of ratio variables under virtually any conditions anyway - but there is nothing in #1 about what the research is about or why some function, rather than the actual variables, is wanted so I just gave a rough-and-ready answer to what was asked

        Comment


        • #5
          My research thesis topic is "Implications of Gender on Meritocratization: A Panel Data Study". I am using data from 1820 till 2010. In this thesis I want to study the impact of female and male tertiary enrolment on meritocracy. I cannot create a dummy variable such as gender as my other variables are political regimes, property rights, executive constraints. I ran separate regress commands like first regression only for pure female enrolment impact then for pure male impact and then I wanted to make some comparison and for that I created ratio. I am not sure that instead of ratio how can I combine this male female impact.
          I am sorry I couldn't use dataex command as I had 12 variables which were not properly seen in dataex command so I used only 6 variables to give example of my dataset. Here e_boix_regime is a dummy variable for Democracy, v2clrspect is a proxy for meritocracy and lhcOverall_n is tertiary enrolment rates, lhcFemale_n is female enrolment and same lhcmale is male and last column is the ratio variable.
          Click image for larger version

Name:	image1.PNG
Views:	1
Size:	44.5 KB
ID:	1580442

          I need your suggestions that if ratio is not a good idea then how to compare male and female tertiary enrolment and its impact on meritocracy however I ran regress separately for both but I want to combine it as well. Help required.
          Thanks

          Comment

          Working...
          X