Announcement

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

  • vce(cluster) with lsdvc

    Hello..i am stata 13 user. I want to integrate vce (cluster) with xtlsdvc Log_sales varietyofproducts LogGDP searchvolume Log_firmage sqrt_avg_rev_len sqrt_numberofreviews SQRT_comfort_neg_perc SQRT_safety_neg_perc SQRT_exterior_neg_perc yr2009 yr2010 yr2011 yr2012 yr2013 yr2014 yr2015 yr2016, initial(ab) bias(1) vcov(1000) as in my case dataset has both heteroskedasticity and serial correlation.
    kindly share me the command for it and guide me on how to integrate them.Thank you.

  • #2
    Welcome to Statalist. It's worth consulting the Statalist FAQ as you construct your posts. The easier your question is to answer the quicker you'll get help!
    Three bits of advice:
    1. It's always a good start to give folks some background on the command. In this case it's available via ssc install xtlsdvc.
    2. And a bit more clear information about what you're trying to do. Are you just trying to add the vce(cluster) syntax, or do you have a more specific issue in mind.
    3. Then share the actual code you attempted, either with some example data provided with stata or with some data from your dataset. This way we can test our solutions in your specific context (btw, I usually end up answering my own questions at this point)
    4. Then to share what resources you've consulted. For example I checked the documentation (help xtlsdvs) and found that "xtlsdvc shares the features of all estimation commands; see help estcom." which makes me expect that vce()works just like it does with the regress command (i.e. "vce(vcetype) vcetype may be ols, robust, cluster clustvar, bootstrap, jackknife, hc2, or hc3"
    With all that in mind, I think the following is a summary of what you are trying to do:
    Code:
    xtlsdvc Log_sales varietyofproducts LogGDP searchvolume Log_firmage sqrt_avg_rev_len sqrt_numberofreviews SQRT_comfort_neg_perc SQRT_safety_neg_perc SQRT_exterior_neg_perc yr2009 yr2010 yr2011 yr2012 yr2013 yr2014 yr2015 yr2016, initial(ab) bias(1) vcov(1000) vce(cluster id)


    Where
    id is individual identifier in your dataset.

    Having said this, I confess I don't completely follow the xtlsdvc documentation, and wasn't able to actually create a working answer using xtlsdvc. Based on the help file I would expect the following commands to run without errors:
    Code:
    webuse abdata // help xtlsdvc doesn't provide an example dataset, but the command seems to reference the data from help xtabond
    // tsset year // from help xtlsdvc " xtlsdvc is for use with time-series data.  You must tsset your data before using xtlsdvc; see help tsset." this doesn't seem to fit with some of the later notation, which seem to reference a panel
    xtset id year
    xtlsdvc n w k ys yr1980-yr1984, initial(ah) // from help  xtlsdvc 
    xtlsdvc n w k ys yr1980-yr1984, initial(ah) vce(cluster id) // my expected answer to your question
    Running the above I get the following results:

    Code:
    . xtlsdvc n w k ys yr1980-yr1984, initial(ah)
    Bias correction initialized by Anderson and Hsiao estimator
    note: Bias correction up to order O(1/T)
    
    LSDVC dynamic regression
    (SE not computed)
    ------------------------------------------------------------------------------
               n |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
               n |
             L1. |   .5668785          .        .       .            .           .
                 |
               w |  -.4812559          .        .       .            .           .
               k |   .3428152          .        .       .            .           .
              ys |   .2944881          .        .       .            .           .
          yr1980 |  -.0196758          .        .       .            .           .
          yr1981 |  -.0390341          .        .       .            .           .
          yr1982 |   -.006438          .        .       .            .           .
          yr1983 |   .0366877          .        .       .            .           .
          yr1984 |    .068508          .        .       .            .           .
    ------------------------------------------------------------------------------
    
    . xtlsdvc n w k ys yr1980-yr1984, initial(ah) vce(cluster id)
    option vce() not allowed
    r(198);
    Neither of these are what I'd expect based on the documentation.

    Perhaps someone with more experience with this command could step in. Or with a better understanding of what you are trying to do someone could suggest an alternative solution.

    Comment


    • #3
      Thank you Morris

      Comment


      • #4
        My simple question is Can we do the heteroskedasticity and serial correlation correction while using, XTLSDVc

        Comment

        Working...
        X