Where does problems analytically arise in logistic regression on singular data matrix?

If you do linear regression without regularization on close-to-singular data matrix X (or it does not have enough data), the problem arises even in closed-form solution w=(XTX)−1XTy when you do (XTX)−1. If you do logistic regression, your gradient would look like: ∂L(w)∂w=X(y−logit(wTX)) and I don’t see any particular reason why it should diverge if X … Read more

Can we do a chi-squared test of independence on nominal(output) and ratio(input) data?

I have a data set with Age and Survival Status column. I have categorized the ages into Age Groups namely: 30-47 years old, 48-65 years old and 66-83 years old and have aggregated the Survival Status for the ages which fall in the same group. Survival Status can have the value as True or False … Read more

Covariates in a case control study

I am doing a retrospective analysis on a study has has cases and controls. I am looking to see if there is an association with death, using exact logistic regression. I am confused on whether I need to include covariates in the model that are associated with the outcome (death) or the independent variable of … Read more

Define model and interpret multinomial regression

Question What should my (multinomial logistic regression) model look like for analysis of the data described, and how can I interpret it and report it in an acceptable way for journals that typically expect a P value. Background I’m a grad student. I have taken the only stats course available in my department, so I … Read more

Rare events modelling – value of coefficients

I am running a logit regression on a dataset with only 2 independent categorical variables, country and device type. Both of these variables can take several values. The dependant variable is binary. The event occurs approximately 0.2% of the time. For certain countries, the coefficients are significant, but I do not have any positive event … Read more

How to perform a power analysis for the following binomial Glmm?

H0: There is no effect of treatment (Road vs control) on rat occupancy H1: Road has an effect on rat occupancy Mod1 <- glmer(Rat.Present ~ Treatment * Set.distance + (1|Site/Trap.Night), data = df.sub1, family = binomial) summary(Mod1) Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) [‘glmerMod’] Family: binomial ( logit ) Formula: Rat.Present … Read more

How to define Y and X variables in Firth’s penalized logistic regression

I’m using Firth’s penalized logistic regression in R with logistf package. Should the Y variable be defined as factor (L$Y = factor(L$Y) before running a model or not? Because the outcomes of the model were different when the Y variable was and was not defined as factor before running and the stpPlr package cannot run … Read more

Derive log-likelihood of Bernoulli logistic regression

I have a problem where I am supposed to derive the log-likelihood for the parameters of a logistic regression. This problem should be rather straightforward arithmetically, but no matter how I go about it, I cannot get the desired result. See the below picture for a full problem description: As the calculations are rather long, … Read more

Multinomial logistic regression – how does binary regression and log-linear models (softmax) fit together

Following the wikipedia article on multinomial logistic regression i do not fully understand why how to get from the “independent binary regressions” to the “log-linear model”. At school we discussed what wikipedia calls the approach of “independent binary regressions”. With the probabilities \begin{aligned}\Pr(Y_{i}=1)&={\frac {e^{{\boldsymbol {\beta }}_{1}\cdot \mathbf {X} _{i}}}{1+\sum _{k=1}^{K-1}e^{{\boldsymbol {\beta }}_{k}\cdot \mathbf {X} _{i}}}}\\\Pr(Y_{i}=2)&={\frac … Read more

Significance testing of intercept term of random effects model, where h0 p is not 0.5

Suppose subjects do a series of 3-alternative oddity trials (i.e., picking the odd-man-out from 3 samples is “success”). The null hypothesis probability of success is 1/3. I would like to know whether the subjects can pick the odd-man-out significantly more often than predicted by chance. I think the way to go is to construct a … Read more