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

lm interface with X as a vector instead of a matrix to enable a simple interface for simple linear regression #565

Open
ajinkya-k opened this issue Oct 22, 2024 · 1 comment

Comments

@ajinkya-k
Copy link

Hello!

I have been playing around with GLM.jl and I had a question/request.

I am not very comfortable with Julia yet and tried to run lm(vector_X, vector_Y) thinking it might work but got an error fit(::Type{LinearModel}, ::Vector{Float64}, ::Vector{Float64}, ::Nothing)

So my question is: Do you think it would be worth adding a vector on vector lm method, i.e. fit(::Type{LinearModel}, ::Vector{Float64}, ::Vector{Float64}, ::Nothing) for simple linear regression when there is a single covariate? Such a method would need to automatically add an intercept column and run the regression? I know that one could always use the formula interface but I was just curious if you think such a method should be added. Feel free to ignore this request if you feel this will not have more general utility.

@ajinkya-k
Copy link
Author

ajinkya-k commented Dec 2, 2024

I know this is out of scope for the next release but I'm happy to attempt and submit a PR for this. Please let me know if that's fine

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

No branches or pull requests

2 participants