[SciPy-User] Why scipy supply a different result comparing with matlab when doing multi-linear regression analysis

王友忠 wangyouzh@gmail....
Mon Oct 19 12:36:47 CDT 2009


Thanks very much!

2009/10/20 <josef.pktd@gmail.com>

> 2009/10/19 王友忠 <wangyouzh@gmail.com>:
> > Another question,
> >
> > How can I do hypothesis testing using scipy? i.e. how can I test the
> > hypothesis: ci = 0?
>
> t test:
>
> http://statsmodels.sourceforge.net/generated/scikits.statsmodels.model.LikelihoodModelResults.t.html#scikits.statsmodels.model.LikelihoodModelResults.t
>
> t tests and f tests for more complicated hypothesis
>
> <warning: a bit messy examples>
>
>
> http://bazaar.launchpad.net/~scipystats/statsmodels/trunk/annotate/head%3A/scikits/statsmodels/examples/example_ols_tftest.py<http://bazaar.launchpad.net/%7Escipystats/statsmodels/trunk/annotate/head%3A/scikits/statsmodels/examples/example_ols_tftest.py>
>
> or I think the OLS class in the scipy cookbook should also have it
>
> Josef
>
> >
> > Best Wishes!
> >
> > Fred
> >
> >
> > 2009/10/20 Robert Kern <robert.kern@gmail.com>
> >>
> >> 2009/10/19 王友忠 <wangyouzh@gmail.com>:
> >> > Hello!
> >> >
> >> > The data used in scipy and matlab is as the same.
> >> >
> >> > There is an dependent variable Y and 9 independent variables X, each
> >> > variable has 90100 elements.
> >> >
> >> > Each variable has been standardized.
> >> >
> >> > In scipy, I used: c,resid,rank,sigma = linalg.lstsq(Y,X)
> >>
> >> That's backwards. You need linalg.lstsq(X,Y).
> >>
> >> --
> >> Robert Kern
> >>
> >> "I have come to believe that the whole world is an enigma, a harmless
> >> enigma that is made terrible by our own mad attempt to interpret it as
> >> though it had an underlying truth."
> >>  -- Umberto Eco
> >> _______________________________________________
> >> SciPy-User mailing list
> >> SciPy-User@scipy.org
> >> http://mail.scipy.org/mailman/listinfo/scipy-user
> >
> >
> > _______________________________________________
> > SciPy-User mailing list
> > SciPy-User@scipy.org
> > http://mail.scipy.org/mailman/listinfo/scipy-user
> >
> >
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20091020/aa8681b7/attachment.html 


More information about the SciPy-User mailing list