2
$\begingroup$

I have fitted gam for a generated data with binomial responses. The problem is, many times while running this gam with different bootstrap samples, error occurred.

$\endgroup$
3
  • $\begingroup$ Greetings! What is the exact code you used? It may also help to provide some information about your data in general. Otherwise answers here will be mostly guesswork I'm afraid. $\endgroup$ Mar 7, 2023 at 1:17
  • $\begingroup$ Thanks. Hopefully somebody else will help, but one additional edit I would suggest is that you should 1) include the mgcv and mvtnorm libraries in your code so people can run it 2) your rmvnorm function seems misspelled and misspecified, so I would check that it is written correctly in your question. Looking at your output, it appears mostly that your model did not converge correctly and you will either need to change the way you simulated your data if it is wrong, or you will need to find some alternative estimation with the gam function. $\endgroup$ Mar 7, 2023 at 2:14
  • $\begingroup$ Thanks for the edits. I figured that wouldn't fix the model but at least makes it easier for others to troubleshoot. $\endgroup$ Mar 7, 2023 at 2:35

1 Answer 1

2
$\begingroup$

Without having looked in detail, the fact that you can perfectly predict the response suggests you are seeing a complete separation problem; one or more terms in the model allows you to perfectly separate the data into 0s and 1s. At that point the likelihood function will be flat (so no well defined maximum) and despite the model being perfect, the statistical quantities we would compute for the model break down, as you are seeing, so standard errors are huge (they are based on the curvature of the likelihood function at the maximum — which is essentially 0 as the function is flat), rendering you unable to reject the null hypothesis in each of the wald-like tests in the Summary output.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.