       Re: LinearModelFit regression estimated variance error

• To: mathgroup at smc.vnet.net
• Subject: [mg102350] Re: LinearModelFit regression estimated variance error
• From: pfalloon <pfalloon at gmail.com>
• Date: Thu, 6 Aug 2009 06:32:04 -0400 (EDT)
• References: <h5bk3b\$hje\$1@smc.vnet.net>

```On Aug 5, 7:40 pm, Parita <parita.pa... at gmail.com> wrote:
> Hi
>
> I want to run linear regression in Mathematica and am using
> LinearModelFit for the same. Following is the code that I am using.
> data1 contains the 10 columns. The first 9 columns contains the data
> through which I want to run regression and the last column contains
> the response value.
>
> model = LinearModelFit [data1, {a, b, c, d, e, f, g, h, i}, {a, b, c,
> d, e, f, g, h, i}];
> Print[model["BestFit"]];
>
> However, I am getting the following two errors -
> FittedModel::varzero: The estimated variance is zero. Properties
> requiring division by the variance or standard error will not be
> computed.
>
> FittedModel::varnum: The estimated variance -8.76512*10^-32 is not a
> positive number. Properties requiring division by the variance or
> standard error will not be computed.
>
> I am getting the coefficients for the regression model bu the standard
> error, p-values and R-squared are indeterminate. Any ideas what this
> error means and how can I go around it?
>

It's hard to know without seeing the data. Is it possible to reproduce
the problem on a reduced dataset that you could include in the post?

The error message seems to suggest one of the estimated variances is
negative (possibly because it's zero and becomes negative due to
rounding errors?). Have you tried using the function LeastSquares to
see if the problem occurs there?

Cheers,
Peter.

```

• Prev by Date: Re: LinearModelFit regression estimated variance error
• Next by Date: Re: solving for a second function
• Previous by thread: Re: LinearModelFit regression estimated variance error
• Next by thread: Re: Mathematica syntax in W|A