Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anova fails on terms with inestimable parameters #15

Open
hturner opened this issue Dec 14, 2021 · 0 comments
Open

anova fails on terms with inestimable parameters #15

hturner opened this issue Dec 14, 2021 · 0 comments

Comments

@hturner
Copy link
Owner

hturner commented Dec 14, 2021

Potential fixes

# correction to anova.BTm to allow for NA coefficients
ok <- !is.na(coef(object))
ind <- varseq[ok] == nvars
trystat <- try(t(coef(object)[ok][ind]) %*% 
                 chol2inv(chol(object$varFix[ind, ind])) %*% 
                 coef(object)[ok][ind], silent = TRUE)

# similar in anova.BTmlist
ok <- !is.na(coef(object[[bigger]]))
ind <- object[[bigger]]$assign[ok] %in% which(term.ind)
stat[i] <- t(coef(object[[bigger]])[ok][ind]) %*% 
             chol2inv(chol(vcov(object[[bigger]], 
                                dispersion = dispersion)[ind, ind])) %*% 
             coef(object[[bigger]])[ok][ind]

Should names of vcov match names of coef?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant