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

Get residuals from anova #118

Open
Tracked by #279
jankaWIS opened this issue Aug 17, 2020 · 1 comment
Open
Tracked by #279

Get residuals from anova #118

jankaWIS opened this issue Aug 17, 2020 · 1 comment
Assignees
Labels
feature request 🚧 New feature or request

Comments

@jankaWIS
Copy link

jankaWIS commented Aug 17, 2020

Hi, recently I have been playing with statsmodels and pinguin and I have not been able to figure out how to get residuals from pinguin. What I mean is (taking your example):

df = pg.read_dataset('anova2')
# Pinguin
df.anova(dv="Yield", between=["Blend", "Crop"]).round(3)
# statsmodels
model = ols( 'Yield ~ C(Blend) + C(Crop) + C(Blend):C(Crop)', df).fit()
aov_table = anova_lm(model, typ=2)
res = model.resid 
pg.qqplot(res, dist='norm')

If I would like to plot the residuals, how can I do that without calling model.resid?

Thanks.
image

@raphaelvallat raphaelvallat self-assigned this Aug 17, 2020
@raphaelvallat raphaelvallat added the question 🙋 Further information is requested label Aug 17, 2020
@raphaelvallat
Copy link
Owner

raphaelvallat commented Aug 17, 2020

Hi @jankaWIS,

Thanks for opening the issue. Pingouin does not currently return the residuals for ANOVA models (it does only in the linear_regression function). I don't think it should be too hard to implement though. I'm jammed up right now but can take a look at that within the next couple of months. Or, if you'd like to submit a pull request, please feel free to do so!

Best,
Raphael

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

No branches or pull requests

2 participants