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

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

Related

Can GLMNet perform Logistic regression?

I am using GLMNet to perform LASSO on Binary Logistic models with cv.GLMNet to test selection consistency and would like to compare its performance with plain GLM Logistic regression. For fairness' sake in comparing the outputs, I would like to use GLMNet to perform this regression, however, I am unable to find any way to do so, barring using GLMnet with alpha = 0 and Lambda = 0 (Ridge without a penalty factor). However, I am unsure about this method, as it seems slightly janky, GLMnet's manual discourages the inputting of single lambda values (for speed reasons) and it provides me no z-values to determine the confidence level of the coefficient. (Essentially, the ideal output would be something similar to just using r's GLM function)
I've read through the entire manual and cant find a method of doing this, is there a way to perform Logistic Regression with GLMNet, without the penalty factor in order to get an output similar to r's GLM?

Logistic Regression in R with the nlstools package or with a glm?

I had a statistic class where a Logistic Regression was set up on some ecotoxicological data (dose-response curve) and the nlstools package was used for this purpose. So far when I came across the Logistic Regression I only used the glm and I am not sure what is the difference between these two approaches. When applying both approaches on the same data there was a clear difference between the fitted curves.
I already tried to look for answers but what I've read so far is that the nlstools package is used for nonlinear Regressions. From what I've read the Logistic Regression is not really a nonlinear Regression but a gerneralized linear model. Why can you use the nlstools package then? And I am a little bit confused how I should classify the Logistic Regression. Thanks for your help!

Ordinal Logistic Regression with mlr?

Is there any way to perform Ordinal Logistic Regression (OLR) with mlr?
One common implementation is the polr function from the MASS library.
See:
https://www.analyticsvidhya.com/blog/2016/02/multinomial-ordinal-logistic-regression/
or
Ordinal Logistic Regression In R
This isn't supported at the moment and won't be added to mlr (though possibly to mlr3 at some point). You can implement your own learner though.

MLR MARS/Earth classifier: flexible discriminant analysis or logistic regression?

I'm trying to learn about MARS/Earth models for classification and am using "classif.earth" in the MLR package in R. My issue is that the MLR documentation says that "classif.earth" performs flexible discriminant analysis using the earth algorithm.
However, when I look at the code:
(https://github.com/mlr-org/mlr/blob/master/R/RLearner_classif_earth.R)
I don't see a call to fda in the mda package, rather it directs earth to fit a glm with a default logit link.
So tell me if I'm wrong, but it seems to me that "classif.earth" is not doing flexible discriminant analysis but rather fitting a logistic regression on the earth model.
The implementation uses MARS to perform the FDA, where the MARS model determines the different groups. You can find more information in this paper; I quote from the abstract:
Linear discriminant analysis is equivalent to multiresponse linear regression [...] to represent the groups.

Is it possible to customize a likelihood function for logit models using speedglm, biglm, and glm packages

I am trying to fit a customized logistic regression/survival analysis function using the optim/maxBFGS functions in R and literally defining the functions by hand.
I was always under the impression that for the packages speedglm, biglm, and glm, the likelihood functions for logit models or whatever distribution were hardlocked. However, I was wondering if I was mistaken or if it was possible to specify my own likelihood functions. The reason being that optim/maxBFGS is a LOT slower to run than speedglm.
The R glm function is set up only to work with likelihoods from the exponential family. The fitting algorithms won't work with any other kind of likelihood, and with any other you're not in fact fitting a glm but some other kind of model.
The glm functions fit using iterated reweighted least squares; the special form of the likelihood function for the exponential families makes Newton's method for solving the max likelihood equations identical to fitting ordinary least squares regression repeatedly until convergence is achieved.
This is a faster process than generic nonlinear optimization; so if the likelihoods you want to use have been customized so that they are no longer from an exponential family, you are no longer fitting a generalized linear model. This means that the IRWLS algorithm isn't applicable, and the fit will be slower, as you are finding.

Resources