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

Error in intI(i, n = x@Dim[1], dn[[1]], give.dn = FALSE) : invalid index #8

Open
ironman12-lab opened this issue Mar 25, 2021 · 0 comments

Comments

@ironman12-lab
Copy link

I've been trying to create basic CJS models, before adding more complex covariates from my dataset. I've been using the following link as guidance:

https://jamesepaterson.github.io/jamespatersonblog/2020-04-26_introduction_to_CJS.html

instead of comparing sexes, I am looking at differences between locations.
When I've tried cjs.m2 on my own dataset, I keep receiving this error that does not allow me to continue:

Error in intI(i, n = x@Dim[1], dn[[1]], give.dn = FALSE) :
index larger than maximal 42

How do I address this issue so I can continue analyzing my data. My code is below.

cjs.m1 <- crm(fish)

cjs.m1 <- cjs.hessian(cjs.m1)
cjs.m1

exp(cjs.m1$results$beta$Phi)/(1+exp(cjs.m1$results$beta$Phi))

predict(cjs.m1,
newdata = data.frame(location =c("River1", "River2")),
se = TRUE)

cjs.m1.unequaltime <- crm(fish,
time.intervals = c(1.7, 2.9, 2.5, 6.5, 3.99, 3.4))

predict(cjs.m1.unequaltime)

fish.proc <- process.data(fish,
group = "location")

fish.ddl <- make.design.data(fish.proc)

Phi.dot <- list(formula = ~1) # ~1 is always a constant (or single estimate)
Phi.location <-list (formula = ~location)
p.location <-list(formula = ~location)

cjs.m2 <- crm(fish.proc,
fish.ddl,
model.parameters = list(Phi = Phi.dot,
p = p.location),
accumulate = FALSE)

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