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

The problem of binomial distribution modeling #1

Open
sue-shine opened this issue Jun 12, 2021 · 0 comments
Open

The problem of binomial distribution modeling #1

sue-shine opened this issue Jun 12, 2021 · 0 comments

Comments

@sue-shine
Copy link

sue-shine commented Jun 12, 2021

Hi, excuse me. I have met some problems in learning spatio-temporal modeling by INLA.
My data includes year, the total number of trials(N), number of successes, number of failures, rate of success, longitude, latitude, and independent variable (water). as shown in the following figure.

屏幕截图 2021-06-12 124111

I want to predict the rate of success in each region, Here is my code, but occured an error.

## Formula
myformula <- cbind(success,failure) ~ -1+Intercept+water
  f(spatial.field,
    model = myspde,
    group = spatial.field.group,
    control.group = list(model = "ar1",
                         hyper = myrho_hyper))

myoutput<-inla(myformula,
               data=inla.stack.data(mystack,spde=myspde,
                                    family="binomial(link=logit)"),
               control.predictor = list(A=inla.stack.A(mystack),
                                        compute=TRUE))

##Error in inla(myformula, data = inla.stack.data(mystack, spde = myspde, :
dim(y...orig)[2] == 1 is not TRUE
In addition, I'm confused that you just use count as the dependent variable, does that satisfy the binomial distribution?
Looking forward to your reply. Thank you!
sincerely,
Sue

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