Re: [R] GLM fitting in R and Statistica

From: Greg Snow <Greg.Snow_at_imail.org>
Date: Wed, 09 Apr 2008 14:35:01 -0600

Can you get fitted values out of Statistica? If the 2 models are equivalent, just using different encodings of the categorical variables, then the fitted values will be the same (within roundoff error) even though the coefficient estimates may differ.

So as a first step you should compare the fitted values or predicted values for new points and see if those are close or not.

Also, make sure that Statistica is treating site as a categorical variable (does it show 2 degrees of freedom?), if it is seeing it as a linear variable rather than a categorical, then it would show 1 line and everything would be messed up.

Hope this helps, If not, can you send code/output from both using a sample dataset?

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow_at_imail.org
(801) 408-8111
 
 


> -----Original Message-----
> From: r-help-bounces_at_r-project.org
> [mailto:r-help-bounces_at_r-project.org] On Behalf Of Agnieszka Kloch
> Sent: Wednesday, April 09, 2008 12:09 PM
> To: R help
> Subject: [R] GLM fitting in R and Statistica
>
> Hi,
> I have a problem concerning discrepances between R (which I
> use) and Statistica (which uses my supervisor). I can't say
> what is the origin of these differences but unfortunately my
> supervisor doesn't know that either.
>
> Our response variable is number (or presence/absence) of
> parasites in rodents and explanatory variables are
> presence/absence of several alleles. The rodents were sampled
> in three sites and the sites differ in parasite frequency so
> we decided to include "site" as a factor.
>
> The problem concerns calculations of factor variable. In
> Statistica output there is only one term, just "site", and in
> R there are two contrats "site A", "site B". I realized that
> I can obtain similar results in Statistica clicking on
> "Estimate" button instead of "1LR"
> (what does my supervisor which gives only log-likelihood and
> p of variables but doesn't estimate parameter).
>
> But there is still one problem I can't explain. When we fit
> interaction terms (site x allele1, site x allele2 and so on)
> the results are completely different. I tried several
> different contrasts in R, such as contr.SAS, contr.treatment
> etc but I couldn't get nothing similar to Statistica output.
>
> Have anybody any idea how to deal with that? Or how to
> explain why R results are different (and hopefully better)? I
> tried to argue that I did everything according to Crawley's R
> Book so probably the models are constructed correctly but my
> supervisor wasn't convinced...
>
> Looking forward any suggestions,
>
> Agnieszka
>
> --
> Agnieszka Kloch
> Instytute of Environmental Sciences, Jagielonian University
> ul. Gronostajowa 7, 30-387 Krakow, Poland, tel. (12) 664 51 51
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Received on Wed 09 Apr 2008 - 20:37:56 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 09 Apr 2008 - 21:30:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive