1

I am using the Rdrobust package to estimate the effect of a national policy on county level outcomes. In my covariates I have included dummies indicating states to control for state level fixed effect. However, when we run the code, I get following error message:

Error in chol.default(ZWZ) :

the leading minor of order 33 is not positive definite.

Where Z is the matrix containing my covaraites and the 33-th variable is the dummy for state 1.

my code is:

out = rdrobust(y, x, covs=z, kernel = "triangular", p=2, bwselect="mserd",
                 cluster= cluster)

I am not sure how to get rid of this error message. More importantly, I am wondering if there is any other way to control for fixed effects (e.g. state-level) in Rdrobust package.

Thanks in advance for your help

Reajul
  • 25
  • 5
  • For help with the error you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. For data modeling questions, you should ask at [stats.se] instead. – MrFlick Oct 25 '20 at 04:13

1 Answers1

2

The recent rdrobust version 1.0.1 should take care of this error. To generate fixed effects from a categorical variable "state" you can do something like:

state.f = factor(state)

state.d = model.matrix(~state.f+0)

out = rdrobust(y, x, covs = state.d)