问题
I've Googled around quite a bit and can't find documentation on this. I'm trying to estimate a feasible generalized least squares (FGLS) model on cross-sectional time series data in R. For example:
library(nlme)
foo <- gls(Y ~ factor(panel_ID) + X1 + X2, data = myData,
correlation=corARMA(p=1), method='ML', na.action=na.pass)
When I run this (my data frame is quite large, which is why I don't include it here), I get the following error:
# Error in array(c(X, y), c(N, ncol(X) + 1), list(row.names(dataMod), c(colnames(X), :
# length of 'dimnames' [1] not equal to array extent</code>
Is anyone familiar enough with the internal workings of gls
or the nlme
package in general to tell me what I'm doing wrong here? Or suggest another way to go about this (I've also tried the plm
package)?
来源:https://stackoverflow.com/questions/9592415/what-is-a-dimnames-error-when-estimating-gls