Announcement

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

  • how to calculate monthly income

    i have different income earnings by day, week . and fortnight what should i do to get it all to monthly income variable
    Last edited by KAYDEN MARLI; 21 Sep 2020, 18:35.

  • #2
    One month = 30.42 days = 4.35 weeks = 2.17 fortnights on average.

    If you need specific help with code based on this information, you need to show example data with the -dataex- command. If you are running version 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.
    Last edited by Clyde Schechter; 21 Sep 2020, 18:44.

    Comment


    • #3
      dear clyde thank you very much for the help. i will try it and will let u know

      Comment


      • #4
        income daily weekly Per fortnight Onbetaald Weet niet Total
        24 4 0 1 4 1 1 2 15
        50 127 30 12 23 35 15 6 260
        114 2 6 0 1 0 0 0 9
        150 52 57 5 26 16 2 5 169
        229 0 1 0 2 0 0 0 3
        239 0 0 0 0 0 0 0 1
        250 48 69 29 62 24 3 6 248
        252 2 0 0 0 0 0 0 2
        336 0 0 0 0 0 1 0 1
        350 44 69 40 90 26 5 7 294
        351 0 0 0 1 0 0 0 1
        431 4 0 0 0 1 0 0 5
        450 73 58 44 172 33 9 5 405
        550 84 66 65 270 56 21 17 610
        572 1 0 0 0 1 0 0 2
        624 0 0 0 0 1 0 0 1
        650 48 57 62 368 23 1 7 581
        719 0 0 0 0 3 0 0 3
        750 43 45 83 495 36 2 9 741
        751 0 0 0 3 0 0 0 3
        814 1 0 1 1 2 0 0 5
        850 39 50 60 489 26 1 4 690
        851 0 0 0 5 0 0 0 5
        911 0 0 0 1 0 0 0 1
        950 72 45 64 479 25 5 11 724

        Comment


        • #5
          this is a crosstab of income and the frequency's by day , week etc

          Comment


          • #6
            The example data in #4 is not usable. I specifically asked you to use -dataex- and explained why. Please repost your example data using -dataex- so that it can be put into Stata and worked with. Also, please explain what each variable is/means/signifies.

            Added: Crossed with #5.
            Last edited by Clyde Schechter; 21 Sep 2020, 19:47.

            Comment


            • #7
              dear clyde i have execute dataex this is what i get... in the picture you can see a crosstable of income groups and how they are being paid. want i want to do is just to make daily weekly and fortnight into monthly

              dataex incomegroups payterms

              ----------------------- copy starting from the next line -----------------------
              Code:
              * Example generated by -dataex-. To install: ssc install dataex
              clear
              input double(incomegroups payterms)
              100 4
                . .
               60 4
              997 4
                . .
                . .
                . .
                . .
                . .
                . .
                . .
                . .
                . .
                . .
                . .
                . .
                . .
                . .
                . .
                . .
                . .
                . .
                . .
                . .
              
                . .
              end
              label values payterms paytermslabel
              label def paytermslabel 4 "Monthly", modify

              Click image for larger version

Name:	Publicatie1.jpg
Views:	1
Size:	600.4 KB
ID:	1573882







              Comment


              • #8
                The crosstab is not helpful for developing the code for this. The -dataex- example would be except that it only instantiates monthly payments, so it does not indicate what the numeric codes for daily, weekly, and fortnightly are. (The fact that it is almost entirely missing values also is unhelpful.) Let me assume that the variable payterms has the following coding:
                Code:
                daily = 1
                weekly = 2
                fortnightly = 3
                monthly = 4
                other way = 5
                unpaid = 6
                don't know = 7
                no answer = 8
                There is no apparent way to deal with Other Way, Unpaid, Don't Know, or No Answer, so I will treat those as equivalent to zero monthly income.

                The -dataex- you posted did give me enough of a sense of what your data look like, however to create a toy data set of similar structure. The following code will calculate a monthly equivalent for each incomegroup that is paid daily, weekly, fortnightly, or monthly.

                Code:
                * Example generated by -dataex-. To install: ssc install dataex
                clear
                input int incomegroups float payterms
                117 3
                186 1
                143 2
                144 7
                122 5
                153 5
                145 6
                160 4
                151 6
                142 1
                148 8
                146 4
                183 8
                147 1
                153 4
                165 3
                170 2
                155 3
                160 8
                149 3
                134 1
                163 6
                171 1
                142 4
                160 5
                end
                label values payterms paytermslabel
                label def paytermslabel 1 "Daily", modify
                label def paytermslabel 2 "Weekly", modify
                label def paytermslabel 3 "Fortnightly", modify
                label def paytermslabel 4 "Monthly", modify
                label def paytermslabel 5 "Other", modify
                label def paytermslabel 6 "Unpaid", modify
                label def paytermslabel 7 "Don't Know", modify
                label def paytermslabel 8 "No Answer", modify
                
                recode payterms (1 = 30.42) (2 = 4.35) (3 = 2.17) (4 = 1) (else = .), gen(multiplier)
                
                gen monthly_equivalent = incomegroups * multiplier


                Comment


                • #9
                  dear clyde your help has been very usefull my gratitude is big, my question is i have to perform multiple imputation with the new monthly income will it be problematic .

                  Comment


                  • #10
                    No. In fact, in a situation like this where there is actual exact knowledge of the "missing" monthly income from the daily, weekly, or fortnightly income, this is the right way to go. In fact, it's not imputation at all. It's filling in the exact value. It's no different from a situation where you have information about people's height, and some people reported it in inches and others in centimeters. You can convert from one to the other and create a single variable in a common unit.

                    When you do your multiple imputation, you can treat this calculated monthly income just as you would any other variable.

                    Comment


                    • #11
                      dear clyde im encountering problems as you can see in the second picture you can see the average income and its payingsterm ...in the first picture you can see the monthly equivalent income, which are very extreme high towards teh end .. is there an error in the multiplier calculation
                      Click image for larger version

Name:	foto 2.jpg
Views:	1
Size:	191.4 KB
ID:	1574464

                      Comment


                      • #12
                        Please read the Forum FAQ, with particular emphasis on #12 where it is explained how best to show Stata results. Among the reasons for discouraging the use of images of results is what has happened here. in #11 you refer to two pictures. On my setup, there is only one picture, and it is far too small to read. So I have no information at all here. Please repost. And when you do that, please also be sure to include any code used before or after what was shown in #8 to get the results you show.

                        Comment


                        • #13
                          mi describe, detail

                          Style: wide
                          last mi update 08oct2020 17:01:07, 0 seconds ago

                          Obs.: complete 9,528
                          incomplete 44,108 (M = 5 imputations)
                          ---------------------
                          total 53,636

                          Vars.: imputed: 9; inkomenklm(36933; 5*0) Arbeidsstatus(35414; 5*0) EcoStat(20047; 5*0) Bevolkngr(257; 5*257)
                          BurgelijkeSt(16293; 5*0) ISCO88(34557; 5*0) ISICrev4(34559; 5*0) Edlevel(8415; 5*0) multiplier(37118; 5*0)

                          passive: 0

                          regular: 0

                          system: 1; _mi_miss

                          (there are 81 unregistered variables)
                          how do i save and analyse imputed datasets ..i want to tab crosstabs and generate new variabeles within new datasets


                          Comment


                          • #14
                            You save an imputed dataset the same way you save any other data set.

                            As for crosstabs and the like, you can do pretty much anything by just pretending that it was an ordinary data set and prefixing the command with -mi xeq:-. So, if you want a crosstab of each of the imputed datasets on variables X and Y, you can run
                            Code:
                            mi xeq: tab X Y
                            That said, you probably shouldn't be doing that. The imputed versions of the data set are not real data. They may include values of variables that are out of the range of the real data, maybe even values that are not possible in real life. They don't always look like real data, and there is no reason you should want them to or expect them to. The one and only purpose of multiply imputed data sets is for use in regression commands so as to reduce the bias that results from doing regression only on complete observations. If the imputations were properly done and the missing values were missing at random, then there are theorems that say that applying Rubin's rules will reduce that bias. But there is nothing in the theory that says that the data have to be chosen in such a way that the cross tabs or other kinds of analyses performed on the imputed data sets will be representative of what a complete real data set would produce. It only works for regression commands and certain other things that are like regression.

                            As for generating new variables within the data set, there is the -mi passive:- prefix. Again you just put that in front of the -gen- or -egen- command that you would have written in an unimputed data set and Stata will roll that command through each of the imputations. But be careful about doing that. I'm not an expert in this area, but in most situations, it is actually better to generate the new variable in the original, incomplete, data set before imputation is done, and then include it among the variables to be imputed.

                            Finally, this question and response are way off topic from the original thread. If you want to continue this topic, please start a new thread. Keeping threads on topic is important so that people who come here searching for specific information, or browsing topics they are interested in can find what they are looking for and also don't waste their time weeding out threads that are irrelevant and "misbranded."

                            Comment


                            • #15
                              thank u very much

                              Comment

                              Working...
                              X