I have built a hierarchical multinomial model, estimated in MLwiN, submitted in Stata via the runmlwin command. I would like to calculate som confidence intervals, but when I run the command below, an error message appears, saying "Unable to invert xtx.". Is there some mistake in my model causing this error message to appear?
Thankful for advice,
Merete Forseth
runmlwin iscore cons hybridnum _Itempcat* hybridtempint* rain temprainint*, ////
level3(id_farm: cons) ////
level2(flock_id: cons) ////
level1(idvar) ////
discrete(dist(multinomial) link(mlogit) denom(cons) basecategory(0)) ////
nopause igls rrr maxiterations(50)
runmlwin iscore cons hybridnum _Itempcat* hybridtempint* rain temprainint*, ////
level3(id_farm: cons) ////
level2(flock_id: cons) ////
level1(idvar) ////
discrete(dist(multinomial) link(mlogit) denom(cons) basecategory(0)) ////
mcmc(burnin(1) chain(10) on) rrr initsprevious nopause
Error "Unable to invert xtx."
Re: Error "Unable to invert xtx."
The error message "Unable to invert xtx" typically suggests that there is an issue with the matrix inversion process, which can occur for several reasons:
Multicollinearity: This is the most common cause. When predictors in your model are highly correlated, the
𝑋
′
𝑋
X
′
X matrix becomes nearly singular, making it difficult or impossible to invert. You might want to check the correlations between your predictors and remove or combine those that are highly correlated.
Sparse Data: If some of your predictors have little to no variation or if there are categories in your multinomial outcome that have very few observations, this can lead to issues in model estimation. Consider aggregating some categories or checking the distribution of your data.
Model Specification: Double-check your model specification to ensure that it is correctly specified and that all necessary variables and interactions are included. Errors in specifying the model can also lead to issues with matrix inversion.
Initialization: Sometimes, the initial values provided to the MCMC chain can affect the convergence. You might want to try different initial values or more burn-in iterations to help with the estimation process.
Multicollinearity: This is the most common cause. When predictors in your model are highly correlated, the
𝑋
′
𝑋
X
′
X matrix becomes nearly singular, making it difficult or impossible to invert. You might want to check the correlations between your predictors and remove or combine those that are highly correlated.
Sparse Data: If some of your predictors have little to no variation or if there are categories in your multinomial outcome that have very few observations, this can lead to issues in model estimation. Consider aggregating some categories or checking the distribution of your data.
Model Specification: Double-check your model specification to ensure that it is correctly specified and that all necessary variables and interactions are included. Errors in specifying the model can also lead to issues with matrix inversion.
Initialization: Sometimes, the initial values provided to the MCMC chain can affect the convergence. You might want to try different initial values or more burn-in iterations to help with the estimation process.
Re: Error "Unable to invert xtx."
The error message "Unable to invert xtx" typically indicates a problem with the model specification, which leads to issues with matrix inversion during the estimation process.
You can do this by running a collinearity diagnostics test (e.g., vif in Stata) or by manually inspecting correlations between variables. If high multicollinearity is present, consider removing or combining some of the correlated variables.
You can do this by running a collinearity diagnostics test (e.g., vif in Stata) or by manually inspecting correlations between variables. If high multicollinearity is present, consider removing or combining some of the correlated variables.