![]() If your data are non-uniformly distributed along re_month you might want to try specifying just the number of knots and let ns() pick the knot locations itself. It might not be that hard to switch, but I don't think it's necessary. The major advantage of gamm4 is that you wouldn't have to pick the number of knots yourself. I agree that scaling after logging makes little sense. if you want to try centering the ageXX parameters on the log scale (which might help a bit for interpretation, although since you have no interactions in your model it will only affect the intercept parameter), you can use log(ageXX/mean(ageX)).If your predictors as well as your response are counts, though, it does seem reasonable to log-transform. if you had a priori reason to believe that the underlying relationship was a power-law, $y=a x^b$, then you would want to fit a linear relationship $\log(y) = \log(a) + b \log(x)$ if you thought an exponential relationship $y=\exp(a+bx)$ was more reasonable, then you wouldn't log-transform), or (phenomenologically) to improve the linearity of the relationship. (agreeing with log-transforming your predictors is not necessarily required - this would be done for scientific reasons (e.g.Tl dr the bottom line is that if you have achieved similar results with different optimizers, then you can trust that the numerics of your fit are OK, and you don't need to worry about these warnings. This is on the line between a statistical and a computational question, but I'll take a shot at it. The ns()1.10 variables below are generated by the call to ns(). that is used to construct the spline with knots at 6-month intervals. Re_month is an integer of month from the start of a five year period e.g. vars n mean sd median trimmed mad min max range skew kurtosis se The random-intercept is for repeated measure (60 in most cases) in 138 clusters. Here is are the summary stats for the fixed effects. With the convergence? Is it 'safe' to use the AIC and parameterĮdit at the request of is some additional info, as I'm afraid I can't supply the data. Is it reasonable to ignore the warning if I'm otherwise satisfied Glm models to start with, and it's a bit of leap. Gamm4, but I'd rather do it within glmer, as it develops from ![]() Is there another way to parametrize the spline? I've looked at Model is nearly unidentifiable: very large eigenvalue Different optimiser give similar results, but still getting: In checkConv(attr(opt, "derivs"), opt $par, ctrl = control$checkConv, : I don't think scale is appropriate, as I've already transformed to log scale. I've followed Ben Bolker's trouble shooting article:Īnd don't have singularity problems, mismatched scaled and absolute gradients etc. ![]() I'm afraid I'm unable to share my data, but my 'log(count)' variables are in the range 4 to 12 on log scale, and my ns() spline basis columns are in the range -1 to 1. I'm assuming that, as I'm using a log link function, I should log-transform my count predictors, and a simplified version is: mod <- glmer(incidents ~ (1|org_code) I'm modelling counts of 'incidents' as dependent variable, predicted by counts of observations in demographic categories (lets just use age for this post), with time period as a natural cubic spline of months with knots every 6 months, and a random intercept for organisations/clusters. ![]() Can anyone suggest how I parameterize a Poisson random-intercept model, with a natural cubic spline function? I've been using glmer for a while and am happy with how I'm specifying the main fixed effects and random intercept, but I get scale warnings related to my spline basis.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |