Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to "solve" logistic regression that R can #449

Open
xiaodaigh opened this issue Oct 4, 2021 · 1 comment
Open

Failed to "solve" logistic regression that R can #449

xiaodaigh opened this issue Oct 4, 2021 · 1 comment

Comments

@xiaodaigh
Copy link
Contributor

xiaodaigh commented Oct 4, 2021

plsdel.zip

Unzip the above and then do this

using CSV, DataFrames
df = CSV.read("plsdel.csv", DataFrame)

x_terms = sum(Term(Symbol("x$i")) for i in 1:569)

formula = Term(:y)~ConstantTerm(-1) + x_terms

using GLM
m = glm(formula, df, Binomial())

this fails with this error

ERROR: PosDefException: matrix is not positive definite; Cholesky factorization failed.

However, R's glm can handle it e.g.

using RCall
@rput df
R"""
glm(y~-1+., data = df, family=binomial)
"""
@nalimilan
Copy link
Member

See also #426.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants