Announcement

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

  • Count model with data panel ( poisson)

    Hi, I'm new here (and new to stata/statistical analysis) i need help with a count model with data panel.

    i have some panel from a count of a financial transactions per transactional channel of 500 customers of a financial institution , i try to evaluate the impact of diferent socioeconomics variebles in the demand of each channel.
    As my dataset contains many many 0 (there are no transactions in a channel i for a client j), I understood that maybe a poisson panel model were appropriate in my case, to account for 0 and overdispersion
    So I tried to estimate
    xtpoisson txn_canal multicanal genero edad activos pasivos tarjetas
    i try to estimate marginals effects but i can't use " margins"
    Why my independent variables is "not found in the list of covariates"
    what can i do?
    Thanks you for your help!!

  • #2
    At the very minimum post the exact commands you executed, and the exact error messages that Stata returned.

    You might also want to check -dataex- and provide a minimal data example that generates the problem.

    Comment


    • #3
      And when you are posting your commands and Stata output, use appropriate formatting, see the sharp sign (#) at the formatting line of your post , it will give you properly formatted output and commands.

      Comment


      • #4
        Originally posted by Joro Kolev View Post
        At the very minimum post the exact commands you executed, and the exact error messages that Stata returned.

        You might also want to check -dataex- and provide a minimal data example that generates the problem.
        sorry i`m new in this , the exact comand is:



        xtpoisson txn_canal multicanal genero edad activos pasivos tarjetas

        Fitting Poisson model:

        Iteration 0: log likelihood = -475048.27
        Iteration 1: log likelihood = -470630.91
        Iteration 2: log likelihood = -470602.32
        Iteration 3: log likelihood = -470602.31

        Fitting full model:

        Iteration 0: log likelihood = -320820.94
        Iteration 1: log likelihood = -320805.85
        Iteration 2: log likelihood = -320805.56
        Iteration 3: log likelihood = -320805.56

        Random-effects Poisson regression Number of obs = 2,821
        Group variable: num_doc_org Number of groups = 403

        Random effects u_i ~ Gamma Obs per group:
        min = 7
        avg = 7.0
        max = 7

        Wald chi2(6) = 132.32
        Log likelihood = -320805.56 Prob > chi2 = 0.0000

        ------------------------------------------------------------------------------
        txn_canal | Coef. Std. Err. z P>|z| [95% Conf. Interval]
        -------------+----------------------------------------------------------------
        multicanal | 1.759168 .4919221 3.58 0.000 .7950184 2.723318
        genero | .3843714 .1109466 3.46 0.001 .16692 .6018228
        edad | -.0100879 .0039324 -2.57 0.010 -.0177953 -.0023805
        activos | .4855768 .114347 4.25 0.000 .2614607 .7096929
        pasivos | .4166244 .1179023 3.53 0.000 .1855401 .6477086
        tarjetas | .4183876 .0625 6.69 0.000 .2958898 .5408853
        _cons | 2.616826 .2714788 9.64 0.000 2.084737 3.148914
        -------------+----------------------------------------------------------------
        /lnalpha | .1811987 .0612294 .0611913 .3012061
        -------------+----------------------------------------------------------------
        alpha | 1.198653 .0733928 1.063102 1.351488
        ------------------------------------------------------------------------------
        LR test of alpha=0: chibar2(01) = 3.0e+05 Prob >= chibar2 = 0.000

        margins genero edad activos pasivos tarjetas
        factor 'genero' not found in list of covariates
        r(322);
        Last edited by Kevin Hoyos; 10 Jan 2019, 17:38.

        Comment


        • #5
          These variables sound to me like continuous variables.

          Is not what you need:

          Code:
          margins, dydx(*)
          Like in

          Code:
          . webuse ships, clear
          
          . xtset ship
                 panel variable:  ship (balanced)
          
          . xtpoisson accident service, nolog
          
          Random-effects Poisson regression               Number of obs     =         34
          Group variable: ship                            Number of groups  =          5
          
          Random effects u_i ~ Gamma                      Obs per group:
                                                                        min =          6
                                                                        avg =        6.8
                                                                        max =          7
          
                                                          Wald chi2(1)      =      20.18
          Log likelihood  = -137.36653                    Prob > chi2       =     0.0000
          
          ------------------------------------------------------------------------------
              accident |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
               service |   .0000208   4.63e-06     4.49   0.000     .0000117    .0000299
                 _cons |   2.038602    .404576     5.04   0.000     1.245647    2.831556
          -------------+----------------------------------------------------------------
              /lnalpha |  -.2464067    .589829                      -1.40245    .9096369
          -------------+----------------------------------------------------------------
                 alpha |   .7816043   .4610129                      .2459935    2.483421
          ------------------------------------------------------------------------------
          LR test of alpha=0: chibar2(01) = 132.29               Prob >= chibar2 = 0.000
          
          . margins, dydx(*)
          
          Average marginal effects                        Number of obs     =         34
          Model VCE    : OIM
          
          Expression   : Linear prediction, predict()
          dy/dx w.r.t. : service
          
          ------------------------------------------------------------------------------
                       |            Delta-method
                       |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
               service |   .0000208   4.63e-06     4.49   0.000     .0000117    .0000299
          ------------------------------------------------------------------------------
          
          .

          Comment


          • #6
            Originally posted by Joro Kolev View Post
            These variables sound to me like continuous variables.

            Is not what you need:

            Code:
            margins, dydx(*)
            Like in

            Code:
            . webuse ships, clear
            
            . xtset ship
            panel variable: ship (balanced)
            
            . xtpoisson accident service, nolog
            
            Random-effects Poisson regression Number of obs = 34
            Group variable: ship Number of groups = 5
            
            Random effects u_i ~ Gamma Obs per group:
            min = 6
            avg = 6.8
            max = 7
            
            Wald chi2(1) = 20.18
            Log likelihood = -137.36653 Prob > chi2 = 0.0000
            
            ------------------------------------------------------------------------------
            accident | Coef. Std. Err. z P>|z| [95% Conf. Interval]
            -------------+----------------------------------------------------------------
            service | .0000208 4.63e-06 4.49 0.000 .0000117 .0000299
            _cons | 2.038602 .404576 5.04 0.000 1.245647 2.831556
            -------------+----------------------------------------------------------------
            /lnalpha | -.2464067 .589829 -1.40245 .9096369
            -------------+----------------------------------------------------------------
            alpha | .7816043 .4610129 .2459935 2.483421
            ------------------------------------------------------------------------------
            LR test of alpha=0: chibar2(01) = 132.29 Prob >= chibar2 = 0.000
            
            . margins, dydx(*)
            
            Average marginal effects Number of obs = 34
            Model VCE : OIM
            
            Expression : Linear prediction, predict()
            dy/dx w.r.t. : service
            
            ------------------------------------------------------------------------------
            | Delta-method
            | dy/dx Std. Err. z P>|z| [95% Conf. Interval]
            -------------+----------------------------------------------------------------
            service | .0000208 4.63e-06 4.49 0.000 .0000117 .0000299
            ------------------------------------------------------------------------------
            
            .

            if they are continuous variables .
            Thanks very much you for your help, was very helpful!

            Comment

            Working...
            X