Hello,
I have been receiving an error when using -estsimp- for a model with
fixed effects and clustered SEs. I am hoping that one of you might be
able to shed some light on why this error is occurring.
*Data*
I have annual data on the FDI choices of 50+ firms for a 10-year period.
Each firm chooses one or more countries in which to do FDI each year.
The total number of countries in each firm's annual choice set is
approximately 60. Thus, for each firm-year, there are roughly 60
records, with the dependent variable equal to one or zero for each record.
*Model*
I am running the model as a logit with firm-year intercepts (similar to
a conditional logit), and after dropping some firm-years, there are
roughly 440 "fixed effects." My matsize is large enough and I can run
the model without problems using the -logit- command. I can also use
-estsimp logit- to estimate the exact same model without any problem. (I
run -logit- first to figure out which intercepts Stata is dropping, and
then exclude those intercepts when I run -estsimp logit-. The number of
obs, log-likelihood etc. are identical in both cases.)
*Error*
An error occurs when I run the model with standard errors clustered by
firm. Although I can estimate the model using -logit-, I receive the
error "matrix not positive definite r(506);" when I use -estsimp logit-.
I traced the error, and it occurs in estsimp._chol (please see below).
The rrror also occurs when I include even a single fixed effect in
combination with clustering, and when I run the model using "estsimp
regress-. Removing all of the fixed effects *or* the "cluster" option
eliminates the error.
There is no intuitive reason I can think of why the simulation shouldn't
work when the error covariance matrix is estimated using clustering and
fixed effects are include, so I'm a bit of a loss. I'd much appreciate
help that you can give me on with this.
Happy holidays, and thanks in advance.
Regards,
Bennet Zelner
begin estsimp._chol ---
- version 6.0
- args V k
- tempname A
- capt matrix `A' = cholesky(`V')
= capt matrix __0000PF = cholesky(__000002)
- if _rc == 506 {
- tempname eye transf varianc vcd tmp
- mat `eye' = I(`k')
= mat __0000PG = I(454)
- mat `transf' = J(1,`k',0)
= mat __0000PH = J(1,454,0)
- local i 1
- while `i' <= `k' {
= while 1 <= 454 {
- scalar `varianc' = `V'[`i',`i']
= scalar __0000PI = __000002[1,1]
- if `varianc' ~= 0 {
= if __0000PI ~= 0 {
- mat `tmp' = `eye'[`i',1...]
= mat __0000PK = __0000PG[1,1...]
- mat `transf' = `transf' \ `tmp'
= mat __0000PH = __0000PH \ __0000PK
- }
[OUTPUT SUPPRESSED--LOOPS THROUGH ALL RHS VARIABLES]
- local i = `i' + 1
= local i = 1 + 1
- }
- mat `transf' = `transf'[2...,1...]
= mat __0000PH = __0000PH[2...,1...]
- mat `vcd' = `transf'*`V'*`transf''
= mat __0000PJ = __0000PH*__000002*__0000PH'
- mat `A' = cholesky(`vcd')
= mat __0000PF = cholesky(__0000PJ)
matrix not positive definite
mat `A' = `transf''*`A'*`transf'
}
------------------------------------------------------------------------------------
end estsimp._chol ---
--------------------------------------------------------------------------------------
end estsimp._simp ---
local newvars `r(newvars)'
_simsig2, s(`sims') g(`genname') `antisim' m(`modname') n(`newvars')
local newvars `r(newvars)'
matrix `sig' = r(Sigma)
scalar `dfsig' = r(dfSigma)
}
----------------------------------------------------------------------------------------------
end estsimp ---
r(506);
--
Prof. Bennet A. Zelner
Duke University
Fuqua School of Business
Box 90120
Durham, NC 27708-0120
bzelner(a)duke.edu
Tel +1 919 660-1093
Fax +1 919 681-6244
--
Clarify mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive: http://lists.gking.harvard.edu/?info=clarify
Professor King,
No matter what I try, I continue getting this error message (obs must be
between 618 and 936) after which the simulations halt.
This message is preceded by:
Note: Clarify is expanding your dataset from 618 observations to 1000
observations in order to accommodate the simulations. This will append
missing values to the bottom of your original dataset.
I've tried with other data sets and I continue to get this message, the
number of obseravtions, naturally varies.
What can I do to correct this?
Thanks,
cp
--
Clarify mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive: http://lists.gking.harvard.edu/?info=clarify