Mckelvey and Zavoina Pseudo-R^2 for hetglm model in r - r

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!

Related

How to find the best fitted models using the forward ,backward and the stepwise selection in poisson regression using R programming?

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).

When predicting using R ARIMA object, how to declare the time series' history?

Suppose I fit AR(p) model using R arima function from stats package. I fit it using a sample x_1,...,x_n. In theory, when predicting x_{n+1} using this model, it needs an access x_n,...x_{n-p}.
How does the model know which observation I want to predict? What if I wanted to actually predict x_n based on x_{n-1},...,x_{n-p-1} and how my code would differ in this case? Can I make in-sample forecasts, similar to Python's functionality?
If my questions imply that I think about forecasting in a wrong way, please kindly correct my understanding of the subject.

Is there any way to dredge a PGLMM_compare model in R (Phyr and MuMin packages)?

I am doing a comparative analysis, and my response variables are 0 or 1, therefore I need to do a phylogenetically-corrected analysis with a binomial error distribution. I used the PGLMM_compare function from the phyr package (https://rdrr.io/github/daijiang/phyr/man/pglmm_compare.html) to create a full model with all of my variables, but MuMin does not support this output as a 'global model', therefore I cannot dredge it. I am looking for a way to find the best models and possibly perform model averaging from these, however it seems that these packages are not compatible. It would be difficult to create all the models by hand, since I have ~8 explanatory variables. Is there any way of dredging a phylogenetic model with binomial error structure? Thanks in advance.
You would need to implement at least the following methods for dredge and model.avg to work with pglmm_compare:
nobs.pglmm_compare(object, ...)
logLik.pglmm_compare(object, ...)
coef.pglmm_compare(object, ...)
coefTable.pglmm_compare(model, ...)

Is there Hurdle model function for GAMM on R?

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 ?

Predict follow up time using parametric model in r

I am trying to predict follow-up time using several survival models, both parametric and semi-parametric. I achieve it for semi parametric models using predict.coxph function in R using type = "expected" as indicated in help. However, for parametric models, this option doesn't exist for the predict.survreg function. Is there any other option? Maybe using rms package?

Resources