Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
DE SOUZA Eric <[email protected]> |

To |
"[email protected]" <[email protected]> |

Subject |
RE: st: RE: RE: xtivreg2 -- Instruments dropped |

Date |
Sun, 16 Jan 2011 15:37:38 +0100 |

So the space before the comma was the reason I couldn't get it to run this time. I saw the error message but then had to move on something else. Eric Eric de Souza College of Europe Brugge (Bruges), Belgium http://www.coleurope.eu -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Schaffer, Mark E Sent: 16 January 2011 15:30 To: [email protected] Subject: RE: st: RE: RE: xtivreg2 -- Instruments dropped Ivan, I used your corrected dataset, and made some progress in tracking down the problem, but there are still aspects I don't understand. 1. Easy part: to identify your versions of xtivreg2, ivreg2, xtivreg, etc., you use the -which- command. It's best to use the -all- option with it, in case there are multiple versions lurking on your machine. For example, . which xtivreg, all C:\Program Files\Stata11\ado\updates\x\xtivreg.ado *! version 1.5.9 11nov2009 C:\Program Files\Stata11\ado\base\x\xtivreg.ado *! version 1.5.7 17jun2009 NB: The dulpicate versions above aren't a problem for an official program like -xtivreg-. When you update your Stata and a do file gets updated, the update goes in the updates folder and the original stays in the base folder. 2. I can't run your example, using either -xtivreg2- or official -xtivreg-. The reason is a bug, or perhaps "inflexibility", in the parsing done by -xtivreg2- and -xtivreg-. It is very simple: if you use a space between the end of an -if- statement and the comma, both -xtivreg2- and -xtivreg- complain in a very uninformative way: First, -xtivreg2-: . xi: xtivreg2 xrdr_ln revtr_ln mktbook_mm ebitdar_ln /// > taxcred (L.utsa = L.govr_r) i.year /// > if xrdr_count >= 6 , fe cluster(state_sic) i.year _Iyear_1976-2006 (naturally coded; _Iyear_1976 omitted) 6 invalid name r(198); end of do-file r(198); Now official -xtivreg-: . xi: xtivreg xrdr_ln revtr_ln mktbook_mm ebitdar_ln /// > taxcred (L.utsa = L.govr_r) i.year /// > if xrdr_count >= 6 , fe cluster(state_sic) i.year _Iyear_1976-2006 (naturally coded; _Iyear_1976 omitted) 6 invalid name r(198); end of do-file r(198); But delete the spaces between 6 and the comma, and it works: . xi: xtivreg2 xrdr_ln revtr_ln mktbook_mm ebitdar_ln /// > taxcred (L.utsa = L.govr_r) i.year /// > if xrdr_count >= 6, fe cluster(state_sic) i.year _Iyear_1976-2006 (naturally coded; _Iyear_1976 omitted) Warning - singleton groups detected. 295 observation(s) not used. Warning - collinearities detected Vars dropped: _Iyear_2006 FIXED EFFECTS ESTIMATION ------------------------ Number of groups = 3198 Obs per group: min = 2 avg = 8.5 max = 30 IV (2SLS) estimation -------------------- Estimates efficient for homoskedasticity only Statistics robust to heteroskedasticity and clustering on state_sic Number of clusters (state_sic) = 1471 Number of obs = 27044 F( 34, 1470) = 3.85 Prob > F = 0.0000 Total (centered) SS = 251.0415486 Centered R2 = 0.2476 Total (uncentered) SS = 251.0415486 Uncentered R2 = 0.2476 Residual SS = 188.8924922 Root MSE = .089 ------------------------------------------------------------------------------ | Robust xrdr_ln | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------- -------------+------ utsa | L1. | .0174583 .0902999 0.19 0.847 -.1595263 .1944429 | revtr_ln | .1265504 .0205411 6.16 0.000 .0862907 .1668102 mktbook_mm | .0149745 .3796314 0.04 0.969 -.7290894 .7590385 ebitdar_ln | .0408917 .0159209 2.57 0.010 .0096873 .0720961 taxcred | -.1079932 .5174864 -0.21 0.835 -1.122248 .9062615 _Iyear_1977 | -.0313348 .0448701 -0.70 0.485 -.1192785 .056609 ... <output edited for brevity> ... _Iyear_2005 | -.0105457 .0033898 -3.11 0.002 -.0171896 -.0039017 ------------------------------------------------------------------------------ Underidentification test (Kleibergen-Paap rk LM statistic): 46.831 Chi-sq(1) P-val = 0.0000 ------------------------------------------------------------------------------ Weak identification test (Cragg-Donald Wald F statistic): 202.397 (Kleibergen-Paap rk Wald F statistic): 53.412 Stock-Yogo weak ID test critical values: 10% maximal IV size 16.38 15% maximal IV size 8.96 20% maximal IV size 6.66 25% maximal IV size 5.53 Source: Stock-Yogo (2005). Reproduced by permission. NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors. ------------------------------------------------------------------------------ Hansen J statistic (overidentification test of all instruments): 0.000 (equation exactly identified) ------------------------------------------------------------------------------ Instrumented: L.utsa Included instruments: revtr_ln mktbook_mm ebitdar_ln taxcred _Iyear_1977 ... <output edited for brevity> ... _Iyear_2002 _Iyear_2003 _Iyear_2004 _Iyear_2005 Excluded instruments: L.govr_r Dropped collinear: _Iyear_2006 ------------------------------------------------------------------------------ 3. I still don't understand what you mean when you say > IP: I meant instruments -- in the sense that I used different > instruments in various specifications, and each one was dropped. I'm pretty sure you don't mean that -xtivreg2- drops every excluded instrument but still reports a coefficient for an endogenous regressor! But then, what do you mean? But maybe it doesn't matter if simply eliminating the spaces between 6 and the comma solves your problem. Best wishes, Mark > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Ivan Png > Sent: 16 January 2011 03:25 > To: [email protected] > Subject: Re: st: RE: RE: xtivreg2 -- Instruments dropped > > Sorry, Mark. I've updated the data-set. > > On Sat, Jan 15, 2011 at 10:29 PM, Schaffer, Mark E > <[email protected]> wrote: > > Ivan, > > > > I had the same problem as Eric. And there must be > something else wrong, since there's only one instrument listed > (L.govr_r) and you refer to "instruments". > > > > IP: I meant instruments -- in the sense that I used different > instruments in various specifications, and each one was dropped. > > > Did xtivreg2 report collinearities among your instruments > as a reason for dropping some? Did xtivreg? If so, were the dropped > variables the same? > > IP; Neither reported collinearities. > > > You might also want to compare the first-stage regressions > of xtivreg2 and xtivreg. > > > > Oh, and tell us which versions of xtivreg2, xtivreg and > Stata you are using. > > IP: Stata/IC 10.1. Sorry, please advise how to identify version of > xtivreg2 and xtivreg > > > > --Mark > > > >> -----Original Message----- > >> From: [email protected] > >> [mailto:[email protected]] On Behalf Of > DE SOUZA > >> Eric > >> Sent: 15 January 2011 12:02 > >> To: [email protected] > >> Subject: st: RE: xtivreg2 -- Instruments dropped > >> > >> Check the instruction you have posted: > >> govr_r does not exist > >> > >> > >> > >> Eric de Souza > >> College of Europe > >> Brugge (Bruges), Belgium > >> http://www.coleurope.eu > >> > >> > >> -----Original Message----- > >> From: [email protected] > >> [mailto:[email protected]] On Behalf Of Ivan Png > >> Sent: 15 January 2011 12:43 > >> To: [email protected] > >> Subject: st: xtivreg2 -- Instruments dropped > >> > >> Dear Stata-list: > >> > >> I'm having difficulty with xtivreg2 > >> > >> Each time, the system drops the instruments for the > variable L.utsa. > >> utsa is a state-time variable that varies across states > and times. I > >> checked the instruments: they are state- and time-varying. > I don't > >> understand why the system drops the instruments. (I tried xtivreg > >> and it works, but I would like to use xtivreg2 so that I can get > >> cluster standard errors and the diagnostics for weak instruments). > >> > >> > >> Please help. Many thanks! > >> > >> Data-set: > >> http://www.comp.nus.edu.sg/~ipng/research/company_wrkg.dta > >> > >> > >> Code: > >> . xtset gvkey year > >> > >> . xi: xtivreg2 xrdr_ln revtr_ln mktbook_mm ebitdar_ln taxcred /// > >> (L.utsa = L.govr_r) i.year trend_AL - trend_WY /// > >> if xrdr_count >= 6 , fe cluster(state_sic) > >> > >> > >> > >> > >> -- > >> Ivan Png > >> National U of Singapore > >> > >> > >> > >> > >> -- > >> Skype: ipng00 > >> T: +65 6516 6807 > >> > >> > >> > >> -- > >> Skype: ipng00 > >> T: +65 6516 6807 > >> > >> * > >> * For searches and help try: > >> * http://www.stata.com/help.cgi?search > >> * http://www.stata.com/support/statalist/faq > >> * http://www.ats.ucla.edu/stat/stata/ > >> > >> * > >> * For searches and help try: > >> * http://www.stata.com/help.cgi?search > >> * http://www.stata.com/support/statalist/faq > >> * http://www.ats.ucla.edu/stat/stata/ > >> > > > > > > -- > > Heriot-Watt University is a Scottish charity registered > under charity > > number SC000278. > > > > > > * > > * For searches and help try: > > * http://www.stata.com/help.cgi?search > > * http://www.stata.com/support/statalist/faq > > * http://www.ats.ucla.edu/stat/stata/ > > > > > > -- > Skype: ipng00 > T: +65 6516 6807 > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > -- Heriot-Watt University is a Scottish charity registered under charity number SC000278. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**RE: st: RE: RE: xtivreg2 -- Instruments dropped***From:*"Schaffer, Mark E" <[email protected]>

**References**:**st: xtivreg2 -- Instruments dropped***From:*Ivan Png <[email protected]>

**st: RE: xtivreg2 -- Instruments dropped***From:*DE SOUZA Eric <[email protected]>

**st: RE: RE: xtivreg2 -- Instruments dropped***From:*"Schaffer, Mark E" <[email protected]>

**Re: st: RE: RE: xtivreg2 -- Instruments dropped***From:*Ivan Png <[email protected]>

**RE: st: RE: RE: xtivreg2 -- Instruments dropped***From:*"Schaffer, Mark E" <[email protected]>

- Prev by Date:
**RE: st: RE: RE: xtivreg2 -- Instruments dropped** - Next by Date:
**Re: st: How to generate conditional random numbers?** - Previous by thread:
**RE: st: RE: RE: xtivreg2 -- Instruments dropped** - Next by thread:
**RE: st: RE: RE: xtivreg2 -- Instruments dropped** - Index(es):