[SciPy-user] Multivariate regression?

Vincent vincent.nijs@gmail....
Tue Oct 9 21:30:01 CDT 2007


Interesting. When did this get added to scipy? It is not in version
0.5.3.dev3227.

In [14]: import scipy.stats.models

ImportError: No module named models

Is there any documentation for the module?

Thanks,

Vincent

On Oct 6, 12:34 pm, "Matthew Brett" <matthew.br...@gmail.com> wrote:
> Hi,
>
> > > I study econometrics and statistics, and i wanted to try out my
> > > favourite programming as a scientific tool. Unfortunately, I could not
> > > find a function for ordinary least squares estimation. The
> > > stats.linregress() is insufficient for my needs, and stats.glm() seems
> > > to be for something else (not sure really).
>
> I think you may want the OLS model in scipy.stats.models:
>
> import numpy as N
> import scipy.stats.models as SSM
>
> covariates = N.random.normal(size=(100,3))
> intercept = N.ones((100,1))
> design = N.c_[covariates, intercept]
> data = N.random.normal(size=(100,1))
>
> model = SSM.regression.ols_model(design)
> results = model.fit(data)
>
> results.beta
>
> The models package is still being developed, but it already does the
> basic stuff,
>
> Best,
>
> Matthew
> _______________________________________________
> SciPy-user mailing list
> SciPy-u...@scipy.orghttp://projects.scipy.org/mailman/listinfo/scipy-user



More information about the SciPy-user mailing list