[R] R error: system is computationally singular when building GMM model
ligges at statistik.tu-dortmund.de
Sun Jan 13 18:02:43 CET 2013
On 13.01.2013 15:08, zoe chan wrote:
> I built the generalized method of moments model to estimate the sales rank
> in the bookstore using plm package in R.
> The equation is:
> data1.gmm <- pgmm(dynformula(lnsales_rank ~ ln_price + avg_ham_rate +
> avg_spam_rate + num_of_ham+ num_of_spam + ship_code2 +ship_code3
> +ship_code4+ ship_code5+ ship_code6 + ship_ code7, lag = list(0, 0, 0,
> 0,0,0,0,0,0,0,0,0), log =FALSE), data=data, effect = "individual", model =
> "twosteps", transformation = "ld",gmm.inst = ~ ln_price, lag.gmm =2)
> However, error message: Error in solve.default(Reduce("+", A1)) :
> system is computationally singular: reciprocal condition number =
> 6.36689e-23" shown.
> I found that skipping one of the ship_code variables (dummy variable) can
> generate result. But don't know the reason.
> I found some books about using R, but no one can answer me.
The error message says quite a lot: The code tries solve() and fails
since the matrix is numerically singular.
Now go ahead and find out why that happens. Not enough data for all
combinations of your categorical variables in a way that you can still
estimate all the coefficients, I believe,
> Please help. Thanks much.
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help