Announcement

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

  • Asdoc not allowing for nesting 2 models

    Hello everyone,

    I want to nest two models in one table by using asdoc, however it gives me an error "estimation result M1 not found"

    This is my code:

    Code:
    asdoc xtreg log_realHP log_PopulationDensity log_Population Unemployment_rate log_real_consCost logReal_income real_interest i.low_dev i.Year,fe vce(robust) replace cnames(Low dev) add(Low dev Dummy,YES, Year Dummy,YES) dec(3)
    
    asdoc xtreg log_realHP log_PopulationDensity log_Population Unemployment_rate log_real_consCost logReal_income real_interest i.low_dev i.Year,fe vce(robust) append cnames(High dev) save(PanelData_regression) add(High dev Dummy,YES, Year Dummy,YES) dec(3) notes(Note: The variables House price, Population density, Population,Income, Construction Cost are in log) nest
    Thanks everyone for your time and patience and help !

  • #2
    There are several mistakes in your code.
    1. Stata error. vce(robust) is not allowed with fe
    2. You have not added the option nest to the first regression
    3. You have used the save() in the second regression, it should be used in the first one to set the save location. When you use it in the second, it starts a new file.
    4. The add() option uses different text legends in both the model.

    Here is a working example

    Code:
    asdoc xtreg ln_w grade age  ttl_exp   tenure i.race not_smsa south,fe  ///
           replace cnames(Low dev) add(Low dev Dummy,YES, Year Dummy,YES) dec(3) nest
           
    asdoc xtreg ln_w grade age  ttl_exp    i.race not_smsa south, fe  ///
    append cnames(High dev) add(Low dev Dummy,YES, Year Dummy,YES) ///
    dec(3) notes(Note: The variables House price, Population density, Population, Income, Construction Cost are in log)  /// 
    nest
    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	27.8 KB
ID:	1647265



    asdocx is now available
    A more powerful and flexible version of asdoc is now available. I call it asdocx. You may like to check the details here

    https://fintechprofessor.com/asdocx


    Please do remember to cite asdoc. To cite:

    In-text citation
    Tables were created using asdoc, a Stata program written by Shah (2018).

    Bibliography
    Shah, A. (2018). ASDOC: Stata module to create high-quality tables in MS Word from Stata output. Statistical Software Components S458466, Boston College Department of Economics.

    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    FinTechProfessor.com
    https://asdocx.com
    Check out my asdoc program, which sends outputs to MS Word.
    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

    Comment


    • #3
      Originally posted by Attaullah Shah View Post
      There are several mistakes in your code.
      1. Stata error. vce(robust) is not allowed with fe
      2. You have not added the option nest to the first regression
      3. You have used the save() in the second regression, it should be used in the first one to set the save location. When you use it in the second, it starts a new file.
      4. The add() option uses different text legends in both the model.

      Here is a working example

      Code:
      asdoc xtreg ln_w grade age ttl_exp tenure i.race not_smsa south,fe ///
      replace cnames(Low dev) add(Low dev Dummy,YES, Year Dummy,YES) dec(3) nest
      
      asdoc xtreg ln_w grade age ttl_exp i.race not_smsa south, fe ///
      append cnames(High dev) add(Low dev Dummy,YES, Year Dummy,YES) ///
      dec(3) notes(Note: The variables House price, Population density, Population, Income, Construction Cost are in log) ///
      nest
      [ATTACH=CONFIG]n1647265[/ATTACH]


      asdocx is now available
      A more powerful and flexible version of asdoc is now available. I call it asdocx. You may like to check the details here

      https://fintechprofessor.com/asdocx


      Please do remember to cite asdoc. To cite:

      In-text citation
      Tables were created using asdoc, a Stata program written by Shah (2018).

      Bibliography
      Shah, A. (2018). ASDOC: Stata module to create high-quality tables in MS Word from Stata output. Statistical Software Components S458466, Boston College Department of Economics.
      Hello Sir,
      First of all thank you for creating the ASDOC package, I am sure a lot of students are making use of and should be standard included with Stata.
      I have corrected everything what you have said and its working great, the only thing I wanted to ask since I wanted to use robust standard errors which does work when running only xtreg without asdoc. I have seen your youtube video it doesnt seem to work for me or am I making a mistake ?

      And what if I want text on the first column regarding the function add(), since i wanted to add low dev dummy YES and Year dummy YES
      Last edited by Adam Klaas; 29 Jan 2022, 05:29.

      Comment

      Working...
      X