very late to resurrect this question but I had the same problem and have just found the answer. If you have any zero values in your exposure days data you get the error mentioned above about no valid starting values. Changing the zeros to 0.5 or deleting these rows removes the problem :-)
Valid starting values error for GLM logistic regression
문제
I'm relatively new to R and I'm trying to analyze nesting success data using an updated version of the logistic exposure link function code created by Shaffer 2004 and provided in the R help file ?family.
Here is the code I'm using:
logexp <- function(days = 1)
{
linkfun <- function(mu) qlogis(mu^(1/days))
linkinv <- function(eta) plogis(eta)^days
mu.eta <- function(eta) days * plogis(eta)^(days-1) * binomial()$mu_eta
valideta <- function(eta) TRUE
ink <- paste0("logexp(", days, ")")
structure(list(linkfun = linkfun, linkinv = linkinv,
mu.eta = mu.eta, valideta = valideta, name = link),
class = "link-glm")
}
nestdata=read.table(file.choose(), header=TRUE) `
model=glm(survive~trtmnt,family=bionomial(logexp(days=nestdata$expos)),
data=nestdata)
Every time I try to run it, I receive the following error:
"Error: cannot find valid starting values: please specify some"
I tried adding a start=c(1,0) argument, but this had no effect. Any help would be greatly appreciated!
해결책
제휴하지 않습니다 StackOverflow