# [SciPy-User] calculate predicted values from regression + confidence intervall

josef.pktd@gmai... josef.pktd@gmai...
Fri Oct 14 17:54:23 CDT 2011

```On Fri, Oct 14, 2011 at 7:51 AM, Johannes Radinger <JRadinger@gmx.at> wrote:
> Hello,
>
> I did a statistical regression analysis (linear regression) in R which
> has following parameters:
>
> Y = X1 + X2
>
> from the R-analysis I can get the intercept and slopes for the independent variables so that I get:
>
> Y = Intercept + slope1*X1 + slope2*X2
>
> Now I want to use that in Scipy to calculate new predicted Y values.
> Generally that is not a problem. I use the new X1 and X2 as input and
> the slopes and intercept are predefined. So I can easily calculate Y new.
>
> Now my question arises:
> How can I calculate a kind of uncertainty (e.g. a confidence intervall) for
> the new Y? What do I have to extract from R and how do I have to use
> the extracted parameters in scipy to calculate such things?
> Is that generally possible?

Better sandbox then nothing:

https://github.com/statsmodels/statsmodels/blob/master/scikits/statsmodels/sandbox/regression/predstd.py#L28

This is my version for scikits.statsmodels.OLS (and maybe WLS)

usage example
https://github.com/statsmodels/statsmodels/blob/master/scikits/statsmodels/examples/tut_ols.py

Josef

>
> Thank you very much
> Johannes
> --
> NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
> Jetzt informieren: http://www.gmx.net/de/go/freephone
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
```

More information about the SciPy-User mailing list