Announcement

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

  • Mean difference test

    hello there ,
    I have an unbalanced panel data of banks comprising of 21 public,42 foreign and 21 private banks from the year 2005 to 2018..I have created dummies for each group as welI .I have three questions
    How can i calculate mean profitability for each group considering i have one panel sheet
    How can i calculate mean profitability for each group by year?
    How can i test the difference in mean of these groups.
    Iam using stata 14 version
    Please help
    Thanks in advance

  • #2
    for exact code, please show example data using -dataex- (see the FAQ); my guess is that -egen- with various options and "by" will do what you want; see
    Code:
    help egen

    Comment


    • #3
      Also look at ttest.

      Comment


      • #4
        Rich Goldstein sir,
        My data is as follows
        input int(bankcode Year) byte(PUBLICDUMMY PRIVATEDUMMY FOREIGNDUMMY) double Returnonassets_x000D_
        1 2005 0 0 1 2.87
        1 2006 0 0 1 3.43
        1 2007 0 0 1 3.42
        1 2008 0 0 1 3.84
        1 2009 0 0 1 4.75
        1 2010 0 0 1 5.58
        1 2011 0 0 1 4.53
        1 2012 0 0 1 7.05
        1 2013 0 0 1 5.03
        1 2014 0 0 1 4.22
        1 2015 0 0 1 5.13
        1 2016 0 0 1 3.07
        1 2017 0 0 1 3.48
        1 2018 0 0 1 4.17
        2 2005 0 0 1 -2.57
        2 2006 0 0 1 .35
        2 2007 0 0 1 .23
        2 2008 0 0 1 3.96
        2 2009 0 0 1 2.4
        2 2010 0 0 1 1.13
        2 2011 0 0 1 1.12
        2 2012 0 0 1 1.87
        2 2013 0 0 1 1.4
        2 2014 0 0 1 .56
        2 2015 0 0 1 .57
        2 2016 0 0 1 .67
        2 2017 0 0 1 .54
        2 2018 0 0 1 .6
        3 2005 1 0 0 1.33
        3 2006 1 0 0 1.42
        3 2007 1 0 0 1.26
        3 2008 1 0 0 1.32
        3 2009 1 0 0 .9
        3 2010 1 0 0 1.16
        3 2011 1 0 0 1.11
        3 2012 1 0 0 1.02
        3 2013 1 0 0 .64
        3 2014 1 0 0 .57
        3 2015 1 0 0 .29
        3 2016 1 0 0 -.33
        3 2017 1 0 0 -.13
        3 2018 1 0 0 -1.96
        4 2005 0 0 1 .55
        4 2006 0 0 1 1.45
        4 2007 0 0 1 1.28
        5 2009 0 0 1 -7.92
        5 2010 0 0 1 -4.24
        5 2011 0 0 1 1.67
        5 2012 0 0 1 .2
        5 2013 0 0 1 -3.23
        5 2014 0 0 1 -3.46
        5 2015 0 0 1 -2.22
        5 2016 0 0 1 -.64
        5 2017 0 0 1 .96
        5 2018 0 0 1 1.27
        6 2005 1 0 0 1.59
        6 2006 1 0 0 1.38
        6 2007 1 0 0 1.31
        6 2008 1 0 0 1.16
        6 2009 1 0 0 1.09
        6 2010 1 0 0 1.39
        6 2011 1 0 0 1.36
        6 2012 1 0 0 1.19
        6 2013 1 0 0 .99
        6 2014 1 0 0 .29
        6 2015 1 0 0 .38
        6 2016 1 0 0 .28
        6 2017 1 0 0 .08
        6 2018 1 0 0 -1.46
        7 2012 0 0 1 .05
        7 2013 0 0 1 .1
        7 2014 0 0 1 .94
        7 2015 0 0 1 1.11
        7 2016 0 0 1 .85
        7 2017 0 0 1 .67
        7 2018 0 0 1 .89

        Comment


        • #5
          Phil Bromiley, Can we apply anova on panel data.I have created categorical variable for my types of banks

          Comment


          • #6
            your data sample (#4) has no entries for Private but here is one strategy; first, note that if you just want to compare the means you don't need to calculate them; just
            Code:
            gen byte group=0 if PU==1
            replace group=1 if PR==1
            replace group=2 if F==1
            xtset bankcode Year
            xtreg Re i.group
            if you had the third group I could show the test statement to get the comparisons ignoring the reference group; see
            Code:
            help test
            if you really think you need to calculate the means in your first two questions in #1:
            Code:
            bys group: even double meanprofit=mean(Re)
            bye group Year: even double meanprofityr=mean(Re)
            added: I don't think that I fully understand what you want so I'm not sure the above is fully responsive

            Comment

            Working...
            X