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

Assignment 10: Task 3 GLM error #869

Open
sagniksom opened this issue Nov 20, 2024 · 1 comment
Open

Assignment 10: Task 3 GLM error #869

sagniksom opened this issue Nov 20, 2024 · 1 comment

Comments

@sagniksom
Copy link

Hi, I am having an issue with the GLM initialization.

Here is my code:

le_model = sm.GLM(y=world_data_2014.child_mortality, x=sm.add_constant(world_data_2014.income), family=sm.families.Gaussian(link=sm.families.links.log()))

le_results = le_model.fit()


# do not change the code below()
print(le_results.summary())

and I get this error:

TypeError Traceback (most recent call last)
in <cell line: 1>()
----> 1 le_model = sm.GLM(y=world_data_2014.child_mortality, x=sm.add_constant(world_data_2014.income), family=sm.families.Gaussian(link=sm.families.links.log()))
2
3 le_results = le_model.fit()
4
5

TypeError: GLM.init() missing 2 required positional arguments: 'endog' and 'exog'

Any suggestions?

@RayNele
Copy link

RayNele commented Nov 20, 2024

I'm guessing the y= and x= in the lines y=world_data_2014.child_mortality andx=sm.add_constant(world_data_2014.income) respectively is breaking the GLM function.

https://www.statsmodels.org/stable/glm.html

you can try endog= and exog = or just not put that there at all.

let me know if this works

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