I am working with a dataset that is zero inflated and I found a function that allows me to do a GLMM with the glmmadmb function. But, I realized that my data are not linearly related with the environmental variables I want to test, this is why I am looking for a GAMM instead of a GLMM.
Does anyone know which function can replace glmmadmb for a GAMM ?
Related
I am using regsubsets method for linear regression and came across step() method for selecting columns for logistic regression methods.
I am not sure whether we can use regsubsets or steps for Poisson regression. It will be helpful if there is a method to find the best subsets for Poisson regression in R programming.
From here it looks like
step() (base R: works on glm objects -> includes Poisson regression models)
bestglm package
glmulti package
Possibly others.
Be prepared for the GLM (Poisson etc.) case to be much slower than the analogous problem for Gaussian responses (OLS/lm).
I need to calculate the Mckelvey and Zavoina Pseudo-R^2 for my heteroschedastic probit model. Does anyone know how to construct this formula in R or know a function that directly computes it?
All the R functions I read about for this pseduo-R^2 are applicable only on gml models, but I got to fit the heteroschedastic probit and I used hetglm and not glm.
Thank you in advace!
I am currently running some linear models and lmer (with replicate as a random effect) for continuous data and a glm and glmer (again, replicate as a random effect) for count data.
I was wondering if a lm, lmer, glm and glmer all need the data to be normally distributed and if not, do I need an alternative test?
Also, I have run a glm and looked at the pairwise differences and when reporting it other than P<0.001 I don't know what else I should report! As my glm output doesn't really give me that much. Thanks!
I am using the zoib package in R to build zero-inflated beta regression models. I am looking for a simple way to use the models that zoib produces to calculate a predicted response for a new dataset. By "new dataset" I mean data not used to build the original zoib models.
I know I can just take the zoib model parameters and manually write a function in R to predict with but I want to utilise the fact that zoib models are Bayesian so I can get a posterior distribution of possible response values. My plan is to use the posterior distributions to calculate confidence intervals around each prediction.
Because zoib uses a MCMC approach within RJags I have investigated these two solutions:
manipulating the code within RJags
appending the new data with an "NA" response variable
The first solution I don't know how to implement because zoib runs RJags internally and the zero-inflated model it runs is very complicated. I tried the second solution but it just ignored the rows of data that I appended with "NA" response values.
I emailed the zoib package developers and this was there response.
For now, the zoib function can only output posterior predictive samples for Y given the X in the data set where the zoib regression is applied to, but not for a new set of X's. Your suggestion can be easily incorporated into the new version of the package, which is expected to be out in about a few weeks.
I am trying to impute data before modeling with random forest for example.
I have categorical and continuous features. I would like to use the function kNN (VIM package) to impute my data. But I can't use this function in the preProcess function of caret and the knn imputation of this function does not handle mixed data.
How can I impute mixed data in the preProcess function ?
As of right now, it will only impute continuous predictors (which you can get via dummy variables).
You could write your won custom method to use that function for pre-processing if you like. This example might help.
Once I get through the work for my day job, improving preProcess is the next major task for package development.
Thanks,
Max