Re: [R] Change sum of squares type for ANOVA

2016-05-20 Thread Michael Dewey

Dear Michael F

What you say is of course true but Michael E (or possibly Simone) seems 
to be using a function glht from an unnamed package. Since we do not 
have the data or the offending output it is hard to be sure though.


Michael D

On 20/05/2016 13:49, Michael Friendly wrote:

Use car::Anova() for type II and type III sums of squares and F-tests.
The sequential type I tests computed by anova() are rarely sensible

On 5/20/2016 3:11 AM, michael.eisenr...@agroscope.admin.ch wrote:

Dear R-list members,

I compared my statistics with my supervisor yesterday. He is using
STATISTICA, I am using R. We both loaded the same data-file and did a
two-way ANOVA with treatment and trial as factors; treatment means
were then compared to the untreated control using Dunnett's test.
Surprisingly, we got different values, especially the F values
differed. In the following Dunnett's test, some treatments were
significant in R, but not in STATISTICA. We checked the basic settings
of the programs and found out, that STATISTICA is using
"sigma-restricted parametrization" and "type VI sum of squares" for
the calculations, but so far, I could not find any information about
the sum of squares type, which is applied in R. Is it possible, that
these settings are the reason for the different values we got? And how
can I change in R these settings?

Here the code I used:
bt_assay_devtime_Model <-
aov(developmenttime~treatment+run+treatment*run, data=bt_assay)
summary(bt_assay_devtime_Model)
postHocs_bt_assay_devtime <- glht(bt_assay_devtime_Model,
linfct=mcp(treatment="Dunnett"), base=1)
summary(postHocs_bt_assay_devtime)
confint(postHocs_bt_assay_devtime)

Thanks a lot for your help!
Simone

Eisenring Michael, Msc.
PhD Student

Federal Department of Economic Affairs, Education and Research
EAER
Institute of Sustainability Sciences ISS
Biosafety

Reckenholzstrasse 191, CH-8046 Z�rich
Tel. +41 44 37 77181
Fax +41 44 37 77201
michael.eisenr...@agroscope.admin.ch

www.agroscope.ch


[[alternative HTML version deleted]]





__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


--
Michael
http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Change sum of squares type for ANOVA

2016-05-20 Thread Fox, John
Dear Michael and Michael,

I took a quick look at the Statistica website, and their definition of "types" 
of sums of squares doesn't appear to be the same as the common definition, 
which originated with SAS. As I read their materials, what they call "Type VI" 
sums of squares would correspond to the "Type III" tests provided by Anova() in 
the car package by setting type=3. 

As well, the reference to "sigma-restricted coding" in the Statistica 
documentation corresponds to contrasts provided by contr.sum() in R. This is 
important for Type III tests because it produces a row-basis for the model 
matrix with orthogonal effects. One way to do this is via 
options(contrasts=c("contr.sum", "contr.poly")). See ?Anova for more 
information.

I hope this helps,
 John

-
John Fox, Professor
McMaster University
Hamilton, Ontario
Canada L8S 4M4
Web: socserv.mcmaster.ca/jfox



> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Michael 
> Friendly
> Sent: May 20, 2016 8:50 AM
> To: michael.eisenr...@agroscope.admin.ch; r-help@r-project.org
> Subject: Re: [R] Change sum of squares type for ANOVA
> 
> Use car::Anova() for type II and type III sums of squares and F-tests.
> The sequential type I tests computed by anova() are rarely sensible
> 
> On 5/20/2016 3:11 AM, michael.eisenr...@agroscope.admin.ch wrote:
> > Dear R-list members,
> >
> > I compared my statistics with my supervisor yesterday. He is using
> STATISTICA, I am using R. We both loaded the same data-file and did a two-way
> ANOVA with treatment and trial as factors; treatment means were then
> compared to the untreated control using Dunnett's test. Surprisingly, we got
> different values, especially the F values differed. In the following 
> Dunnett's test,
> some treatments were significant in R, but not in STATISTICA. We checked the
> basic settings of the programs and found out, that STATISTICA is using "sigma-
> restricted parametrization" and "type VI sum of squares" for the calculations,
> but so far, I could not find any information about the sum of squares type,
> which is applied in R. Is it possible, that these settings are the reason for 
> the
> different values we got? And how can I change in R these settings?
> >
> > Here the code I used:
> > bt_assay_devtime_Model <-
> > aov(developmenttime~treatment+run+treatment*run, data=bt_assay)
> > summary(bt_assay_devtime_Model)
> > postHocs_bt_assay_devtime <- glht(bt_assay_devtime_Model,
> > linfct=mcp(treatment="Dunnett"), base=1)
> > summary(postHocs_bt_assay_devtime)
> > confint(postHocs_bt_assay_devtime)
> >
> > Thanks a lot for your help!
> > Simone
> >
> > Eisenring Michael, Msc.
> > PhD Student
> >
> > Federal Department of Economic Affairs, Education and Research EAER
> > Institute of Sustainability Sciences ISS Biosafety
> >
> > Reckenholzstrasse 191, CH-8046 Z rich
> > Tel. +41 44 37 77181
> > Fax +41 44 37 77201
> > michael.eisenr...@agroscope.admin.ch<mailto:michael.eisenring@agroscop
> > e.admin.ch> www.agroscope.ch<http://www.agroscope.ch/>
> >
> >
> > [[alternative HTML version deleted]]
> >
> >
> >
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Change sum of squares type for ANOVA

2016-05-20 Thread Michael Friendly

Use car::Anova() for type II and type III sums of squares and F-tests.
The sequential type I tests computed by anova() are rarely sensible

On 5/20/2016 3:11 AM, michael.eisenr...@agroscope.admin.ch wrote:

Dear R-list members,

I compared my statistics with my supervisor yesterday. He is using STATISTICA, I am using R. We 
both loaded the same data-file and did a two-way ANOVA with treatment and trial as factors; 
treatment means were then compared to the untreated control using Dunnett's test. Surprisingly, we 
got different values, especially the F values differed. In the following Dunnett's test, some 
treatments were significant in R, but not in STATISTICA. We checked the basic settings of the 
programs and found out, that STATISTICA is using "sigma-restricted parametrization" and 
"type VI sum of squares" for the calculations, but so far, I could not find any 
information about the sum of squares type, which is applied in R. Is it possible, that these 
settings are the reason for the different values we got? And how can I change in R these settings?

Here the code I used:
bt_assay_devtime_Model <- aov(developmenttime~treatment+run+treatment*run, 
data=bt_assay)
summary(bt_assay_devtime_Model)
postHocs_bt_assay_devtime <- glht(bt_assay_devtime_Model, 
linfct=mcp(treatment="Dunnett"), base=1)
summary(postHocs_bt_assay_devtime)
confint(postHocs_bt_assay_devtime)

Thanks a lot for your help!
Simone

Eisenring Michael, Msc.
PhD Student

Federal Department of Economic Affairs, Education and Research
EAER
Institute of Sustainability Sciences ISS
Biosafety

Reckenholzstrasse 191, CH-8046 Z�rich
Tel. +41 44 37 77181
Fax +41 44 37 77201
michael.eisenr...@agroscope.admin.ch
www.agroscope.ch


[[alternative HTML version deleted]]





__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.