Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: 2 obvious

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115231] Re: 2 obvious
  • From: Darren Glosemeyer <darreng at wolfram.com>
  • Date: Tue, 4 Jan 2011 18:50:01 -0500 (EST)

On 12/23/2010 2:55 AM, Francisco Gutierrez wrote:
> Dear Group:
> Ok, here comes a really silly question. After v. 7, the statistical capacities of Mathematica have been substantially boosted. However, I haven't been able to interpret the simple command LogitModelFit. THe problem is that the documentation only offers examples with two independent variables. I have not managed to find how can n more independent variables can be inserted so that the command works. Can somebody send me a simple and clear example?
>
> Let this be a pretext to thank all the incredibly useful help the members of this list have generously provided to me and others. Happy holidays,
> Fg
>
>
>
>

Hi Francisco,

The data argument is like for other fitting functions. The independent 
(predictor) variables are the first n-1 elements in each data point and 
the last element in the data point is a dependent (response) variable.

Here is a list of 5 data points each having two predictors and one response.

In[1]:= data = {{10, 4, 0.26}, {8, 3, 0.04}, {2, 0, 0.17}, {4, 8, 0.09}, 
{9, 4, 0.83}};

This treats the predictors as x and y in the fitting

In[2]:= lm = LogitModelFit[data, {x, y}, {x, y}];


and here we get the fitted function and a table of parameter information 
for the fitting.

In[3]:= lm[{"BestFit", "ParameterTable"}]

                            1
Out[3]= {-------------------------------------,
               2.384 - 0.236963 x + 0.0664776 y
          1 + E

 >        Estimate     Standard Error   z\[Hyphen]Statistic   
P\[Hyphen]Value}

      1   -2.384       3.41536          -0.698022             0.485163

      x   0.236963     0.388785         0.609496              0.542196

      y   -0.0664776   0.529535         -0.125539             0.900097



I hope this helps.

Darren Glosemeyer
Wolfram Research


  • Prev by Date: Re: Mathematica daily WTF
  • Next by Date: Re: How does Plot work?
  • Previous by thread: Re: Mathematica daily WTF (programming everything
  • Next by thread: Re: 2 obvious