Displaying 1 result from an estimated 1 matches for "xprimexinv".
2004 Mar 19
2
using "unstack" inside my function: that old scope problem again
...E <- function (tmodel,groupVar) {
myres1 <- resid(tmodel)
resUnstacked <- unstack(myres1, form = myres1 ~ groupVar));
E <- as.matrix(resUnstacked)
SIGMA <- (1/nrow(E))*(t(E) %*% E)
OMEGA <- diag(x=1, nrow=nrow(E), ncol=nrow(E)) %x% SIGMA
X <- model.matrix(tmodel)
XPRIMEXINV <- solve(t(X) %*% X)
PCSECOVB <- XPRIMEXINV %*% (t(X) %*% OMEGA %*% X ) %*% XPRIMEXINV
}
The error is:
PCSE(eld.ols1,dat2$STATEID)
Error in eval(expr, envir, enclos) : Object "groupVar" not found
Here's what I don't understand the most.
If I hack this so that the &qu...