Announcement

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

  • #16
    Dear Matthew,

    Im very happy when received your reply, i changed my command, no problem with this command. But i dont understand why there are difference results when difference running with the same command.
    You can test this problem with example bellow:
    Setup
    . webuse nlswork
    . qregpd ln_wage tenure union, id(idcode) fix(year) optimize(mcmc) noisy draws(1000) burn(100) arate(.5)

    Comment


    • #17
      Dear Tina Nguyen --

      The differences are probably caused by randomness. Since the MCMC estimation method relies on drawing random variables, it will produce different (yet hopefully similar) results every time you run the command.

      However, if every time before you run the command, you set the seed, you should get the same results every time. Since random numbers aren't really random, this will tell Stata to draw the random numbers in the same way as was done before. So, before running the code, use a command like:

      Code:
      set seed 8675309
      where you can use any number you like after set seed.

      Hope that helps!

      Matt Baker

      Comment


      • #18
        Dear Mr. Matthew,

        Thank you so so much for your help. I solved my difficult problem. You are excellent, thank you again.

        I wish the best things for you.

        Comment


        • #19
          Dear Mr. Matthew, I was wondering, do you have the code for bootstrapping the standard error? I know the 2014 version in Powell personal site works. But that bootstrapping code does not work with this version of the codes.

          Best

          Comment


          • #20
            Originally posted by Matthew J. Baker View Post
            Dear Tina Nguyen --

            The differences are probably caused by randomness. Since the MCMC estimation method relies on drawing random variables, it will produce different (yet hopefully similar) results every time you run the command.

            However, if every time before you run the command, you set the seed, you should get the same results every time. Since random numbers aren't really random, this will tell Stata to draw the random numbers in the same way as was done before. So, before running the code, use a command like:

            Code:
            set seed 8675309
            where you can use any number you like after set seed.

            Hope that helps!

            Matt Baker
            Dear Mr. Matthew,
            I have encounted the same question as Tina, but I still have some problems about how to judge the results provided by different seeds we setted when we adopt MCMC method to estimate our model? That is to say how can I pick a relative good result from different results provided by different seeds we setted when we adopt MCMC method to estimate our model? Is there exist some standards? thank you.

            Comment


            • #21
              Dear Matthew,

              I'm using Stata 13.1. I'm following your example with the qregpd command, but it doesn't produce any result. Instead of that, Stata generates the error: 3499 mm_panels() not found
              I have already installed the moremata package, but I get the same outcome.

              Any suggestions regarding this error?

              Regards,

              Comment


              • #22
                Tina: Are results stable if you set seed in advance of running each command? [NB Please read the forum FAQ about how to use CODE delimiters to show Stata input and output.]

                To this end, I was going to suggest that you try running the following:
                Code:
                webuse nlswork, clear
                which qregpd
                
                set seed 20160512
                local state = c(rngstate)
                di "`state'"
                qregpd ln_wage tenure union, id(idcode) fix(year) ///
                 optimize(mcmc) noisy draws(1000) burn(100) arate(.5)
                local state = c(rngstate)
                di "`state'" 
                qregpd ln_wage tenure union, id(idcode) fix(year) ///
                 optimize(mcmc) noisy draws(1000) burn(100) arate(.5)
                local state = c(rngstate)
                di "`state'"
                
                set rngstate `state'
                qregpd ln_wage tenure union, id(idcode) fix(year) ///
                 optimize(mcmc) noisy draws(1000) burn(100) arate(.5)
                However I got an unexpected error -- see below ... [Matthew: should I have updated a Mata library? My version of qregpd is up to date, as far as I know]

                Code:
                . ssc install moremata, replace
                checking moremata consistency and verifying not already installed...
                all files already exist and are up to date.
                
                . do "C:\Users\jenkinss\AppData\Local\Temp\STD00000000.tmp"
                
                .
                . webuse nlswork, clear
                (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
                
                . which qregpd
                d:\home\stephenj\ado\stbplus\q\qregpd.ado
                *! qregpd 1.0.1 12jan2015
                *! version 1.0.1
                *! authors: David Powell, Travis Smith, Matthew Baker
                
                .
                . set seed 20160512
                
                . local state = c(rngstate)
                
                . di "`state'"
                XAA000000000133a0000aef2724f273200121ff1474a7b21f2f54923ae3f222cc4620c24691ccc8217f7f1a45f87ab6e4589a564170a13b4aab041a062a61d2f6bcc4143c1045e8a314d331f967733014141fcbee519ecdf1
                > 15665a5841a205cbbc19f90cff0c18934543c7ccfc848a1e2ef50d8dc0569b9f518d841b10801eaf79a2dab4096509ddaf78fae6bd0965ca7a2c2fdade83ee9cb1fef6bc134fb25a307e08707b20c8280b0130ed0c54ddf
                > fd77a77fb39c914a1e1a7d6f15a4c4e9477eb0e931a898f23a960c3e1b06acc9afbad8f9e08b25b440c00fe4dcb64f3e891a510d45427a4d09945e27a9029ac905c383f90a89114837737ae1d7d8616250a6d761d3a1516
                > 78e27f52818a9b0add087ee66dcdf6cd51b72baee964d48ea721c821f19e3431bff120ab802e6ad1cbaf8cd99d7d5bc79ee90e81793d6cb48476383f65dbca1fd2e686fc527859162c97c04b7caed7bcc15bfb3d1e7d385
                > 0a4a3412da2e238f8504c9ff53dedcc4d50b66f5a77c0ad647bd25160433909e67146bf58df2c120722abbb19dfd70dcfeee66d3f1bad4fc41a46b95bc774add4d7aea0ff27e3bc843d7084096dcd59145b3fa7ef3df1f8
                > 584cefb82d19a097a018e0257dbbbea7067df26c8b8514ba7931c3a114d79074e6fd546fa9ac281f563259c1ddb82eb25881b4ca90d7e0156b96685178f21973cf860d7a99329de3f6845bbb9223701e5fea12b28e65e6e
                > 74a15115ac2e30b50892199e19ae372dd3d4ffbdc105df779cb16dcd5bf091dacd6a678630324f047e948e539b2ee687bdeec5b00914cbaf267b1474809ef944f7f62c46c62e79a240d17eb7fd548d5385c4a6d83c8cd3c
                > 1200a948dd4dd723fe2b784fb82a18cad28dd9aabacd05d0f0b19ad7c22db9e9c500e2c1557b57c2a4901a6b2668393342213af4ca65c38cdc1a6937b89841b276194a789151b33bdf669dc7e231328b7cf776f75716c1c
                > 06786f53bd8a537ba1922e18ad8e85385a9c19c6e0414a8ff4b1392835be17a09125ebe62885998c66eb994c3005fefe967bfe54ab6382743db8d0460f5ff64733200639937584febac1ce87290233caebabf6a6b0abaa6
                > d0e48ccbd75d0f875b7e027e2e9d1e3dc4c8647fa71c84a7655c064b666feb9c7276e0db546d69cd0656ceb95876ed7d2b1d16bc0dc798902d67450285f45c9faea35febf8c7d7fcc12b05008a544b747306e20f81c1096
                > 04f60ed39ed7d9f2d2518f64144ceb536bd06d3b490dbe41247f75aab47442bb7ee547ad765f04160d2d7a67906337497be6a35c154af6cf59bcc3fa838d63217e69d6758a77828cbeb3797f14a9929e62ddb109fa68840
                > 05a25b926c4ced60af0dedddbc2f87cff81b65efe83682cb231885a19d9fd75f700f02fa9815eff4f9fce44da65b501672c29863e5f67346e8a38567f5ea84acbcbfec0ccfcfc5f58005a7a83a8a3570b38aab594197d27
                > 10858671d710e981d57ad63d352cd1fc71ef808b53fe8487dba2a8498544e6bb254d46695036ac0d0cfc7b62aaf57c34b2e232e5f7e4dde3272fa31d7e640b5f1c580c72db75231a1938a2289e99cd2824275c4ee74f91d
                > 635cdc377496805f9bea422ea7f50fc88372bf4f3e0606b5206fb4afcc8a72bed066cf32d1e6421fec3a68135f39d3b070b795f13bd7ab1251d097c8dec04a2caf5712b39e83989d9c3170ed9d8a4fa5207c04471e8321b
                > 343c8e05aca6ac003d238161b7502b43fe4950de2acc63f68c23561a5631aaf9a750a666bee03335ac561a373f0df3bc224c2e904d703d12b19568e15eada8afcd720ad8704e0e33d2ce47589caa8021cef4533232286fd
                > 025d1a0ffb4a3e1d12a05e38c3be4ebe8bb415a00e1a1a0c69941584bfa9871d9a4df51ebe1fa494cf894a5e718459078d11bf139bc0a25e9d486234c0f42ed711627a768c20e71d77e6ee37145103c607aa690409f063a
                > 9b41235d92e0f5c648a090953c6e7d89e269890125e02781da0fba40f44e680cbced4299717655b08f9e2761ea66276a3bfa36494a3483ad57b69296e9c06018170b90349474cc4379c902dacd9434836fc3475e707e97d
                > dda4c7fad363b242c028908c4a685dfad51649537631edc32d93f826c8afcfa2a6e9443f7542a2f3928b2e814f5cdec03c22172ba4209c8da670fbab611f6840ef89a0cb71b00f7c9831d6ea66df2b4dd5b261ae8c3f325
                > a35986444c2ec9e2570c7feb1d9afba23d0d17f3381b94cf9de6308ac8ecc1d8fa1098d7f54a3929fe94ec64acbbcb7b3bfaf4b491d540bdb3162abfaca6082d5c3b334fa29e0f4d1e7d61f86052572810f7c10058c0f21
                > a3eb96c31880386ce6f2e6056ea99b65a901434ad599b5e0b42c870bee6eac12ffbce017a832edcc373aa767e6322c77fcda474b2dbfa13e9ace7f5e0d75f548e83a4483592af75d18374b4b5321c9ce0c57593f23c2676
                > 4d5f81e22c872a8cd24a00bff344b425ad0fc773108582a4fc129a06996484d1fcce6951bf16245f020f32c7babe023d25a3d0f61b51d483f209a6769aa7ab5e721f47d15d17c231283f45ff8073ce350bdf5188eb4c002
                > 7170c9a64587ce05e18b3b93a142c1e0e3c0ecd44c2e517744fcbee90305e566833122f1bc8aec7ea402b768aa2e4ca2efc68f562f6bc4504c59e209d0e55eb3226ad4f0c19e86ad6ff432ec7b7cfbb3573c8c49c00f1a8
                > 09b9713cae48f0810c57d1bb4586609dabde62ae43d19227dd74dfb8d45c58befdebd8c38ad8c7925d6c4eb39bc2cd693383345af7e7ad015793f1817542f1a5ebffe8abba9c8360558353b3a76f94e9915a2ff7fa10991
                > 371528ceec0988ab6271de5f7683ec6c86dfbb29060d57cc8174bf0607da30e2a2c78f0de8608c7ebb9c9949512cbb02daa4a903b0df0b5514f3b45cf1100b437807578926b368eca909da465d703f4c6cc21953f519924
                > a7d682270c22e3d5be5541c3e7322ecfb954c3ac1ac9a51d9414b94c968e63f6dd740ddb941b88803b07d426375c0b90ae4fd4a46d1c8227837b248885d3f477fb93ab67d33686f7cb60598dbbc41ac5ac147848f7ac5bc
                > 99766540da20b26364ce700c91ed2d4f913c532590ded18bd85cd088ebe43f09e0539b29dde2c9b3abf2417f1c701238b7449eba8a500f3974a558c08754a81ce5ee1a52a784534a934c3ee2481727898146627e1d36fe5
                > 1813ec18f35b0481f5723ea786ee5c55b56c8d0c01adcd48ecd168b2c845fe2c8300020cddb7c18c806d3c5567368953dd147ecc12c6c09af86e3a4490c2f7d453be4af4b6d2e4f2c8e6bac564ef01cd516cf81dedcbd78
                > d3e7d32fcf5af3dcb05ea57c1ba0413c55d32265b9d0ac65ea49b5b559e710016a9836c2696c26ce4e5b7e551d283e4d35fb46b4f93542b358e0fd4a1a7f11e869591c812b5545584bca8bacca216e9f6d186a4568d1c7d
                > 16c16de429dc289dd2ad03b4d7b209ca865a69f7e842e467f1705ca6b10f10c203ef7cde90b66545e41a9b8fc9c250001000001381103
                
                . qregpd ln_wage tenure union, id(idcode) fix(year) ///
                >         optimize(mcmc) noisy draws(1000) burn(100) arate(.5)
                          weightMatrix():  3499  estimateGamma() not found
                                 <istmt>:     -  function returned error
                r(3499);
                
                end of do-file
                
                r(3499);

                Comment


                • #23
                  Dear Matthew,

                  I installed genqreg (moremata and amcmc) on my windows pc (stata 14.1 SE) and everything works. However, when I run it with stata 14 SE for mac (with moremata and amcmc recently installed) I get the following error:

                  momentEvaluator(): 3499 estimateProneness() not found
                  weightMatrix(): - function returned error
                  <istmt>: - function returned error

                  I estimated the following on both computers: genqreg earnings training hsorged black hispanic married wkless13 class_tr ojt_jsa age2225 age2629 age3035 age3644 age4554 f2sms, q(85) optimize(mcmc) noisy draws(10000) burn(3000) arate(.5)

                  Any ideas?

                  Thank you,

                  Elena

                  Comment


                  • #24
                    Dear Mr. Matthew,
                    If I want to run with different quantiles ( 0.25, 0.50, 0.75) in MCMC method of panel quantile, can I use command following? So,

                    qregpd ydassets bookleverage roe profitabilitye lassets fata , id(id) fix(time) optimize(mcmc) noisy draws(1000) burn(100) arate(.5) quantile(0.25)
                    qregpd ydassets bookleverage roe profitabilitye lassets fata , id(id) fix(time) optimize(mcmc) noisy draws(1000) burn(100) arate(.5) quantile(0.50)
                    qregpd ydassets bookleverage roe profitabilitye lassets fata , id(id) fix(time) optimize(mcmc) noisy draws(1000) burn(100) arate(.5) quantile(0.75)

                    Is it correct? Thanks so much,

                    Comment


                    • #25
                      Hello!

                      Firstly, I want to thank the authors for the method itself and its implementation in -qregpd-.

                      Secondly, I have a question regarding the implementation of the instrumental variable approach. Particularly, is the identification of the endogenous regressors achieved through the auxiliary equations (somewhat similar to, say, "2SLS" approach) or somehow differently?

                      The former ("2SLS") kind of approach raises a concern, as according to Xavier d'Haultfoeuille's presentation on "Semi and Nonparametric Models in Econometrics" (available from CREST -- http://www.crest.fr/ckfinder/userfil...antile_reg.pdf ) -- slide 64 -- (1) regressing X on Z, and (2) running a quantile regression of Y on projections of Xhat is only valid under certain condition (which generally doesn't hold).

                      I'd appreciate your comments on the implementation of IV approach in -qregpd-.
                      Last edited by Anton Ivanov; 18 Aug 2016, 09:37.

                      Comment


                      • #26
                        Dear all,

                        I am using the qregpd command and was wondering if you are aware of any straightforward way to graph the results?

                        Thanks,
                        Nicole

                        Comment


                        • #27
                          Dear Professor Jenkins,
                          I have the same problem as Nelsh deng. In fact, everytime the number introduced after " set seed" changes, results change also. So, how can I pick the good seed when using the MCMC optimization method? Is there any method?
                          Many thanks for your efforts.

                          Comment


                          • #28
                            Hi every body,
                            I'm using quantile regression with panel data in my paper and i'm glad with this new package; My question is, is this package capable to take into account dynamics? My model is a quantile dynamic panel model with fixed effects, I have all the theory part done but I don('t know how to treat all these aspect in STATA.
                            Any ideas please?

                            Comment


                            • #29
                              Hello everyone

                              I also need help. I am completing panel quantile regression and I am only getting coefficients of the independent variables only. The pvalues, standard error and confidence intervals are not generated.

                              I used command . qregpd LogEmissions LogGDP LogGDP2 Indu manu Trade Apopn, id(Country) fix(Year) quantile(0.7)

                              Please help, is it the right command???

                              Can somebody help me with the complete stata command for panel quantile regression for a particular quantile...

                              Comment


                              • #30
                                You might want to post with a descriptive title to a new thread rather than appending your question to multiple old threads.

                                Comment

                                Working...
                                X