diagnostic: link test - nonlinearity test for many model
See original GitHub issuesee Stata ‘r.pdf’ manual
estimate y with exog_test = (fittedvalues, fittedvalues**2)
reject correct specification if fittedvalues**2 is significant
there might be something similar for OLS already, but Stata’s link test works for discrete models, e.g. after Logit.
For example for Logit we have to run a Logit(endog, exog_test).fit(...)
again.
(do we have all information to run model and fit with the same options again?)
if rejected: either some missing non-linearities in the explanatory variables or incorrectly specified link function
edit don’t use fittedvalues, use predict(linear=True)
, fittedvalues should be refactored to return the transformed, expected mean or estimated mean function E(y|x).
Issue Analytics
- State:
- Created 10 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
8. Diagnosing and Correcting Nonlinearity and Other Ills
▻ Discrete explanatory variables divide the data into groups. • A simple incremental F-test for nonlinearity compares the sum of squares accounted for...
Read more >Is there formal test of non-linearity in linear regression?
Fit a non-linear regression (e.g. spline model like GAM) and then compare it to the linear model using AIC or likelihood ratio test....
Read more >[PDF] Nonlinear Model Specification/Diagnostics: Insights ...
PDF | A single statistical test for nonlinearity can indicate whether or not the generating mechanism of a time series is or is...
Read more >Diagnostic Checking in Regression Relationships
These diagnostic tests are not only useful in econometrics but also in many other fields where linear regression is used, which we will...
Read more >A DIAGNOSTIC TEST FOR NONLINEAR SERIAL ...
The simulations indicate that the test has substantial power for many models. In addition, theoretical and empirical results are presented which show that ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
look at https://github.com/statsmodels/statsmodels/blob/master/statsmodels/stats/outliers_influence.py#L102
Essentially we need the same thing for other models than OLS. The call to OLS needs to be replace by a GLM model. The extra keywords that the user used when creating the model like offset, exposure and weights in the GLM case are available in the
_init_kwds
attribute. There should be some examples for the creation of a new GLM model in the statsmodels source, but I don’t remember where.I am trying to contribute to this issue but having trouble figuring out what needs to be done. Is it about a linktest for GLM that takes model as an argument?