Announcement

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

  • xtivreg2 identify residuals to drop singleton groups

    Please i have singleton groups , i need to know these singleton groups so i can drop them from the main model and have same number of observations in the main and 2SLS model

    in order to do this i should i identify residuals in the xtivreg2

    i run this model but it give me that option resid not allowed


    xtset id year
    ssc install xtivreg2, replace
    tab year , generate(yr)

    xtivreg2 EQUITY FSIZE OP_CF SD_OCF TAX BM LEV MA DPP RPP PSIZE DR Gov_score Sustain_Perf Sust_Commit yr2-yr19 (CSO = Instrumental), fe first robust endog(CSO) resid

    predict resid, residuals


    Ho wan i identify residual in xtivreg2 model
    HTML Code:
      . xtivreg2 EQUITY   FSIZE OP_CF SD_OCF TAX   BM LEV MA DPP RPP PSIZE   DR  Gov_score Sustain_Perf Sust_Commit   yr2-yr19 (CSO = Instrumen
    > tal),  fe first robust endog(CSO) resid
    Warning - singleton groups detected.  7 observation(s) not used.
    option resid not allowed
    r(198);
    
    end of do-file
    
    r(198);

  • #2
    You need to stop reposting the same problem. I've provided the solution earlier.

    Comment


    • #3
      Thanks professor i really appreciate the effort and solutions you provide for me . I hope you can assist me on this .Thanks

      here is the solution you provide when
      after xtivreg2, you should be able to

      predict uhat, residuals

      or, you could try

      list id year if !e(sample)


      Actually when i try to use the first solutions it provide me

      xtset id year
      ssc install xtivreg2, replace
      tab year , generate(yr)

      . xtivreg2 EQUITY FSIZE OP_CF SD_OCF TAX BM LEV MA DPP RPP PSIZE DR Gov_score Sustain_Perf Sust_Commit yr2-yr19 (CSO = Instrumen
      > tal), fe first robust endog(CSO) resid
      Warning - singleton groups detected. 7 observation(s) not used.
      option resid not allowed
      r(198);

      end of do-file

      r(198);



      When i try to usethe second solutions. so until now i did not solve the problem

      HTML Code:
      7687. |     ROL   2021 |
      7688. |     ROL   2022 |
      7689. |     ROP   2004 |
      7690. |     ROP   2005 |
            |----------------|
      7691. |     ROP   2006 |
      7692. |     ROP   2007 |
      7693. |     ROP   2008 |
      7694. |     ROP   2009 |
      7695. |     ROP   2010 |
            |----------------|
      7696. |     ROP   2011 |
      7697. |     ROP   2012 |
      7698. |     ROP   2013 |
      7699. |     ROP   2014 |
      7700. |     ROP   2015 |
            |----------------|
      7701. |     ROP   2016 |
      7702. |     ROP   2017 |
      7703. |     ROP   2018 |
      7704. |     ROP   2019 |
      7705. |     ROP   2020 |
            |----------------|
      7706. |     ROP   2021 |
      7707. |     ROP   2022 |
      7708. |    ROST   2004 |
      7709. |    ROST   2005 |
      7710. |    ROST   2006 |
            |----------------|
      7711. |    ROST   2007 |
      7712. |    ROST   2008 |
      7713. |    ROST   2009 |
      7714. |    ROST   2010 |
      7715. |    ROST   2011 |
            |----------------|
      7716. |    ROST   2012 |
      7717. |    ROST   2013 |
      7718. |    ROST   2014 |
      7719. |    ROST   2015 |
      7720. |    ROST   2016 |
            |----------------|
      7721. |    ROST   2017 |
      7722. |    ROST   2018 |
      7723. |    ROST   2019 |
      7724. |    ROST   2020 |
      7725. |    ROST   2021 |
            |----------------|
      7726. |    ROST   2022 |
      7727. |     RSG   2004 |
      7728. |     RSG   2005 |
      7729. |     RSG   2006 |
      7730. |     RSG   2007 |
            |----------------|
      7731. |     RSG   2008 |
      7732. |     RSG   2009 |
      7733. |     RSG   2010 |
      7734. |     RSG   2011 |
      7735. |     RSG   2012 |
            |----------------|
      7736. |     RSG   2013 |
      7737. |     RSG   2014 |
      7738. |     RSG   2015 |
      7739. |     RSG   2016 |
      7740. |     RSG   2017 |
            |----------------|
      7741. |     RSG   2018 |
      7742. |     RSG   2019 |
      7743. |     RSG   2020 |
      7744. |     RSG   2021 |
      7745. |     RSG   2022 |
            |----------------|
      7746. |     RTX   2004 |
      7747. |     RTX   2005 |
      7748. |     RTX   2006 |
      7749. |     RTX   2007 |
      7750. |     RTX   2008 |
            |----------------|
      7751. |     RTX   2009 |
      7752. |     RTX   2010 |
      7753. |     RTX   2011 |
      7754. |     RTX   2012 |
      7755. |     RTX   2013 |
            |----------------|
      7756. |     RTX   2014 |
      7757. |     RTX   2015 |
      7758. |     RTX   2016 |
      7759. |     RTX   2017 |
      7760. |     RTX   2018 |
            |----------------|
      7761. |     RTX   2019 |
      7762. |     RTX   2020 |
      7763. |     RTX   2021 |
      7764. |     RTX   2022 |
      7765. |       S   2004 |
            |----------------|
      7766. |       S   2005 |
      7767. |       S   2006 |
      7768. |       S   2007 |
      7769. |       S   2008 |
      7770. |       S   2009 |
            |----------------|
      7771. |       S   2010 |
      7772. |       S   2011 |
      7773. |       S   2012 |
      7774. |       S   2013 |
      7775. |       S   2014 |
            |----------------|
      7776. |       S   2015 |
      7777. |       S   2016 |
      7778. |       S   2017 |
      7779. |       S   2018 |
      7780. |       S   2019 |
            |----------------|
      7781. |       S   2020 |
      7782. |       S   2021 |
      7783. |       S   2022 |
      7784. |    SBAC   2004 |
      7785. |    SBAC   2005 |
            |----------------|
      7786. |    SBAC   2006 |
      7787. |    SBAC   2007 |
      7788. |    SBAC   2008 |
      7789. |    SBAC   2009 |
      7790. |    SBAC   2010 |
            |----------------|
      7791. |    SBAC   2011 |
      7792. |    SBAC   2012 |
      7793. |    SBAC   2013 |
      7794. |    SBAC   2014 |
      7795. |    SBAC   2015 |
            |----------------|
      7796. |    SBAC   2016 |
      7797. |    SBAC   2017 |
      7798. |    SBAC   2018 |
      7799. |    SBAC   2019 |
      7800. |    SBAC   2020 |
            |----------------|
      7801. |    SBAC   2021 |
      7802. |    SBAC   2022 |
      7803. |    SBNY   2004 |
      7804. |    SBNY   2005 |
      7805. |    SBNY   2006 |
            |----------------|
      7806. |    SBNY   2007 |
      7807. |    SBNY   2008 |
      7808. |    SBNY   2009 |
      7809. |    SBNY   2010 |
      7810. |    SBNY   2011 |
            |----------------|
      7811. |    SBNY   2012 |
      7812. |    SBNY   2013 |
      7813. |    SBNY   2014 |
      7814. |    SBNY   2015 |
      7815. |    SBNY   2016 |
            |----------------|
      7816. |    SBNY   2017 |
      7817. |    SBNY   2018 |
      7818. |    SBNY   2019 |
      7819. |    SBNY   2020 |
      7820. |    SBNY   2021 |
            |----------------|
      7821. |    SBNY   2022 |
      7822. |    SBUX   2004 |
      7823. |    SBUX   2005 |
      7824. |    SBUX   2006 |
      7825. |    SBUX   2007 |
            |----------------|
      7826. |    SBUX   2008 |
      7827. |    SBUX   2009 |
      7828. |    SBUX   2010 |
      7829. |    SBUX   2011 |
      7830. |    SBUX   2012 |
            |----------------|
      7831. |    SBUX   2013 |
      7832. |    SBUX   2014 |
      7833. |    SBUX   2015 |
      7834. |    SBUX   2016 |
      7835. |    SBUX   2017 |
            |----------------|

      Comment


      • #4
        after xtivreg2, you should be able to
        predict uhat, residuals

        or, you could try

        list id year if !e(sample)

        Comment

        Working...
        X