about formula in ancova
2
0
Entering edit mode
De-Jian ZHAO ▴ 240
@de-jian-zhao-2012
Last seen 9.6 years ago
Dear list members, I have a question about the formula in ancova(), which is embedded in the HH package.There are several examples in the ancova() help file which can be accessed by type "?ancova" in R console after loading HH package.Some codes are as follows: hotdog <- read.table(hh("datasets/hotdog.dat"), header=TRUE) ## y ~ x + a or y ~ a + x ## constant slope, different intercepts ancova(Sodium ~ Calories + Type, data=hotdog) ancova(Sodium ~ Type + Calories, data=hotdog) After running the codes,I found I got different results when choosing different formula,i.e."ancova(Sodium ~ Calories + Type, data=hotdog)" and "ancova(Sodium ~ Type + Calories, data=hotdog) " produced different results. The same thing also happens to the following example codes: ## y ~ x * a or y ~ a * x ## different slopes, and different intercepts ancova(Sodium ~ Calories * Type, data=hotdog) ancova(Sodium ~ Type * Calories, data=hotdog) Hence,I am confused about the difference between the formula "y ~ x + a" and "y ~ a + x",likewise "y ~ x * a" and "y ~ a * x". I thought the order of variables in the formula is arbitrary,however,here it seems the order matters. Can someone explain the formula for me? And how should we choose the formula, or arrange the order of variables in the formula, when processing our own data? Many thanks! Dejian ----- Dejian Zhao, PhD student Group of Evolutionary Ecology State Key Laboratory of Integrated Pest Management Institute of Zoology, Chinese Academy of Sciences 1 Beichen West Road, Chaoyang District, Beijing, P.R.China Postal code: 100101 Tel (office): +86-10-64807217 Fax: +86-10-64807099 Email: zhaodj at ioz.ac.cn
• 1.7k views
ADD COMMENT
0
Entering edit mode
De-Jian ZHAO ▴ 240
@de-jian-zhao-2012
Last seen 9.6 years ago
To provide more details about the confusing results mentioned in my previous email. Some parameters (eg. Sum Sq, Mean Sq, F value, Pr) about the two variables seem to depend on the order in the formula, and the variation of probability (Pr) directly changes the significance. As to my own data, changing the variables order in the formula leads to changes from significance to non-significance for one variable. Maybe this is a trivial question for a major in math. But as a major in biology, I expect someone to explain the formula and give some guidelines in writing a formula. Many thanks again. *Results of the first set of codes:* > ancova(Sodium ~ Calories + Type, data=hotdog) Analysis of Variance Table Response: Sodium Df Sum Sq Mean Sq F value Pr(>F) Calories 1 106270 106270 34.654 3.281e-07 *** Type 2 227386 113693 37.074 1.336e-10 *** Residuals 50 153331 3067 --- Signif. codes: 0 ¡®***¡¯ 0.001 ¡®**¡¯ 0.01 ¡®*¡¯ 0.05 ¡®.¡¯ 0.1 ¡® ¡¯ 1 > ancova(Sodium ~ Type + Calories, data=hotdog) Analysis of Variance Table Response: Sodium Df Sum Sq Mean Sq F value Pr(>F) Type 2 31739 15869 5.1749 0.009065 ** Calories 1 301917 301917 98.4526 2.089e-13 *** Residuals 50 153331 3067 --- Signif. codes: 0 ¡®***¡¯ 0.001 ¡®**¡¯ 0.01 ¡®*¡¯ 0.05 ¡®.¡¯ 0.1 ¡® ¡¯ 1 *Results of the second set of codes:* > ancova(Sodium ~ Calories * Type, data=hotdog) Analysis of Variance Table Response: Sodium Df Sum Sq Mean Sq F value Pr(>F) Calories 1 106270 106270 35.6885 2.747e-07 *** Type 2 227386 113693 38.1815 1.195e-10 *** Calories:Type 2 10402 5201 1.7466 0.1853 Residuals 48 142930 2978 --- Signif. codes: 0 ¡®***¡¯ 0.001 ¡®**¡¯ 0.01 ¡®*¡¯ 0.05 ¡®.¡¯ 0.1 ¡® ¡¯ 1 > ancova(Sodium ~ Type * Calories, data=hotdog) Analysis of Variance Table Response: Sodium Df Sum Sq Mean Sq F value Pr(>F) Type 2 31739 15869 5.3294 0.008124 ** Calories 1 301917 301917 101.3927 2.019e-13 *** Type:Calories 2 10402 5201 1.7466 0.185267 Residuals 48 142930 2978 --- Signif. codes: 0 ¡®***¡¯ 0.001 ¡®**¡¯ 0.01 ¡®*¡¯ 0.05 ¡®.¡¯ 0.1 ¡® ¡¯ 1 Dejian Zhao wrote: > Dear list members, > > I have a question about the formula in ancova(), which is embedded in > the HH package.There are several examples in the ancova() help file > which can be accessed by type "?ancova" in R console after loading HH > package.Some codes are as follows: > > hotdog <- read.table(hh("datasets/hotdog.dat"), header=TRUE) > ## y ~ x + a or y ~ a + x ## constant slope, different intercepts > ancova(Sodium ~ Calories + Type, data=hotdog) > ancova(Sodium ~ Type + Calories, data=hotdog) > > After running the codes,I found I got different results when choosing > different formula,i.e."ancova(Sodium ~ Calories + Type, data=hotdog)" > and "ancova(Sodium ~ Type + Calories, data=hotdog) " produced different > results. > > The same thing also happens to the following example codes: > ## y ~ x * a or y ~ a * x ## different slopes, and different intercepts > ancova(Sodium ~ Calories * Type, data=hotdog) > ancova(Sodium ~ Type * Calories, data=hotdog) > > Hence,I am confused about the difference between the formula "y ~ x + a" > and "y ~ a + x",likewise "y ~ x * a" and "y ~ a * x". I thought the > order of variables in the formula is arbitrary,however,here it seems the > order matters. > > Can someone explain the formula for me? And how should we choose the > formula, or arrange the order of variables in the formula, when > processing our own data? > > Many thanks! > Dejian > > ----- > Dejian Zhao, PhD student > Group of Evolutionary Ecology > State Key Laboratory of Integrated Pest Management > Institute of Zoology, Chinese Academy of Sciences > 1 Beichen West Road, Chaoyang District, Beijing, P.R.China > Postal code: 100101 > Tel (office): +86-10-64807217 > Fax: +86-10-64807099 > Email: zhaodj@ioz.ac.cn [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
2010/3/14 Dejian Zhao <zhaodj@ioz.ac.cn> > To provide more details about the confusing results mentioned in my > previous email. Some parameters (eg. Sum Sq, Mean Sq, F value, Pr) about the > two variables seem to depend on the order in the formula, and the variation > of probability (Pr) directly changes the significance. As to my own data, > changing the variables order in the formula leads to changes from > significance to non-significance for one variable. > Yes, this is correct, and indeed is part of the point of the example. The sequential sum of squares depends on the sequence. The ANOVA table for ancova(Sodium ~ Calories + Type, data=hotdog) allows you to test for the effect of Type conditional on Calories already in the model. ancova(Sodium ~ Type + Calories, data=hotdog) allows you to test for the effect of Calories conditional on Type already in the model. The Graph, the Residual Sum of Squares, the residuals, and the predicted values depend on the entire model. But the individual rows of the ANOVA table depend on the order in which the variables were brought into the model. Look up "sequential sum of squares" in any intermediate statistics text. I will recommend mine http://springeronline.com/0-387-40270-5 Rich [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
R produces sequential sums of squares, not "Type III" or partial SS. The sequential SS are adjusted for the other variables in the order in which they are entered in the model. The partial SS are adjusted for all other variables in the model. The SAS manual explains this more fully under PROC REG (sequential and partial) and PROC GLM (sequential and Type III) and probably has the most concise explanations. --Naomi At 09:38 AM 3/14/2010, Dejian Zhao wrote: >To provide more details about the confusing results mentioned in my >previous email. Some parameters (eg. Sum Sq, Mean Sq, F value, Pr) about >the two variables seem to depend on the order in the formula, and the >variation of probability (Pr) directly changes the significance. As to >my own data, changing the variables order in the formula leads to >changes from significance to non-significance for one variable. > >Maybe this is a trivial question for a major in math. But as a major in >biology, I expect someone to explain the formula and give some >guidelines in writing a formula. Many thanks again. > >*Results of the first set of codes:* > > ancova(Sodium ~ Calories + Type, data=hotdog) >Analysis of Variance Table > >Response: Sodium >Df Sum Sq Mean Sq F value Pr(>F) >Calories 1 106270 106270 34.654 3.281e-07 *** >Type 2 227386 113693 37.074 1.336e-10 *** >Residuals 50 153331 3067 >--- >Signif. codes: 0 ??***?? 0.001 ??**?? 0.01 ??*?? 0.05 ??.?? 0.1 ?? ?? 1 > > > ancova(Sodium ~ Type + Calories, data=hotdog) >Analysis of Variance Table > >Response: Sodium >Df Sum Sq Mean Sq F value Pr(>F) >Type 2 31739 15869 5.1749 0.009065 ** >Calories 1 301917 301917 98.4526 2.089e-13 *** >Residuals 50 153331 3067 >--- >Signif. codes: 0 ??***?? 0.001 ??**?? 0.01 ??*?? 0.05 ??.?? 0.1 ?? ?? 1 > > >*Results of the second set of codes:* > > ancova(Sodium ~ Calories * Type, data=hotdog) >Analysis of Variance Table > >Response: Sodium >Df Sum Sq Mean Sq F value Pr(>F) >Calories 1 106270 106270 35.6885 2.747e-07 *** >Type 2 227386 113693 38.1815 1.195e-10 *** >Calories:Type 2 10402 5201 1.7466 0.1853 >Residuals 48 142930 2978 >--- >Signif. codes: 0 ??***?? 0.001 ??**?? 0.01 ??*?? 0.05 ??.?? 0.1 ?? ?? 1 > > > ancova(Sodium ~ Type * Calories, data=hotdog) >Analysis of Variance Table > >Response: Sodium >Df Sum Sq Mean Sq F value Pr(>F) >Type 2 31739 15869 5.3294 0.008124 ** >Calories 1 301917 301917 101.3927 2.019e-13 *** >Type:Calories 2 10402 5201 1.7466 0.185267 >Residuals 48 142930 2978 >--- >Signif. codes: 0 ??***?? 0.001 ??**?? 0.01 ??*?? 0.05 ??.?? 0.1 ?? ?? 1 > > >Dejian Zhao wrote: > > Dear list members, > > > > I have a question about the formula in ancova(), which is embedded in > > the HH package.There are several examples in the ancova() help file > > which can be accessed by type "?ancova" in R console after loading HH > > package.Some codes are as follows: > > > > hotdog <- read.table(hh("datasets/hotdog.dat"), header=TRUE) > > ## y ~ x + a or y ~ a + x ## constant slope, different intercepts > > ancova(Sodium ~ Calories + Type, data=hotdog) > > ancova(Sodium ~ Type + Calories, data=hotdog) > > > > After running the codes,I found I got different results when choosing > > different formula,i.e."ancova(Sodium ~ Calories + Type, data=hotdog)" > > and "ancova(Sodium ~ Type + Calories, data=hotdog) " produced different > > results. > > > > The same thing also happens to the following example codes: > > ## y ~ x * a or y ~ a * x ## different slopes, and different intercepts > > ancova(Sodium ~ Calories * Type, data=hotdog) > > ancova(Sodium ~ Type * Calories, data=hotdog) > > > > Hence,I am confused about the difference between the formula "y ~ x + a" > > and "y ~ a + x",likewise "y ~ x * a" and "y ~ a * x". I thought the > > order of variables in the formula is arbitrary,however,here it seems the > > order matters. > > > > Can someone explain the formula for me? And how should we choose the > > formula, or arrange the order of variables in the formula, when > > processing our own data? > > > > Many thanks! > > Dejian > > > > ----- > > Dejian Zhao, PhD student > > Group of Evolutionary Ecology > > State Key Laboratory of Integrated Pest Management > > Institute of Zoology, Chinese Academy of Sciences > > 1 Beichen West Road, Chaoyang District, Beijing, P.R.China > > Postal code: 100101 > > Tel (office): +86-10-64807217 > > Fax: +86-10-64807099 > > Email: zhaodj at ioz.ac.cn > > [[alternative HTML version deleted]] > >_______________________________________________ >Bioconductor mailing list >Bioconductor at stat.math.ethz.ch >https://stat.ethz.ch/mailman/listinfo/bioconductor >Search the archives: >http://news.gmane.org/gmane.science.biology.informatics.conductor Naomi S. Altman 814-865-3791 (voice) Associate Professor Dept. of Statistics 814-863-7114 (fax) Penn State University 814-865-1348 (Statistics) University Park, PA 16802-2111
ADD REPLY
0
Entering edit mode
Good morning, I'd add that given an object of class lm in R, there is a package called "car" (from CRAN, not BioC) that can produce type III sums of squares. Hope that helps, JP Naomi Altman wrote: > R produces sequential sums of squares, not "Type III" or partial SS. > The sequential SS are adjusted for the other variables in the order in > which they are entered in the model. The partial SS are adjusted for > all other variables in the model. > > The SAS manual explains this more fully under PROC REG (sequential and > partial) and PROC GLM (sequential and Type III) and probably has the > most concise explanations. > > --Naomi > > At 09:38 AM 3/14/2010, Dejian Zhao wrote: >> To provide more details about the confusing results mentioned in my >> previous email. Some parameters (eg. Sum Sq, Mean Sq, F value, Pr) about >> the two variables seem to depend on the order in the formula, and the >> variation of probability (Pr) directly changes the significance. As to >> my own data, changing the variables order in the formula leads to >> changes from significance to non-significance for one variable. >> >> Maybe this is a trivial question for a major in math. But as a major in >> biology, I expect someone to explain the formula and give some >> guidelines in writing a formula. Many thanks again. >> >> *Results of the first set of codes:* >> > ancova(Sodium ~ Calories + Type, data=hotdog) >> Analysis of Variance Table >> >> Response: Sodium >> Df Sum Sq Mean Sq F value Pr(>F) >> Calories 1 106270 106270 34.654 3.281e-07 *** >> Type 2 227386 113693 37.074 1.336e-10 *** >> Residuals 50 153331 3067 >> --- >> Signif. codes: 0 ??***?? 0.001 ??**?? 0.01 ??*?? 0.05 ??.?? 0.1 ?? ?? 1 >> >> > ancova(Sodium ~ Type + Calories, data=hotdog) >> Analysis of Variance Table >> >> Response: Sodium >> Df Sum Sq Mean Sq F value Pr(>F) >> Type 2 31739 15869 5.1749 0.009065 ** >> Calories 1 301917 301917 98.4526 2.089e-13 *** >> Residuals 50 153331 3067 >> --- >> Signif. codes: 0 ??***?? 0.001 ??**?? 0.01 ??*?? 0.05 ??.?? 0.1 ?? ?? 1 >> >> >> *Results of the second set of codes:* >> > ancova(Sodium ~ Calories * Type, data=hotdog) >> Analysis of Variance Table >> >> Response: Sodium >> Df Sum Sq Mean Sq F value Pr(>F) >> Calories 1 106270 106270 35.6885 2.747e-07 *** >> Type 2 227386 113693 38.1815 1.195e-10 *** >> Calories:Type 2 10402 5201 1.7466 0.1853 >> Residuals 48 142930 2978 >> --- >> Signif. codes: 0 ??***?? 0.001 ??**?? 0.01 ??*?? 0.05 ??.?? 0.1 ?? ?? 1 >> >> > ancova(Sodium ~ Type * Calories, data=hotdog) >> Analysis of Variance Table >> >> Response: Sodium >> Df Sum Sq Mean Sq F value Pr(>F) >> Type 2 31739 15869 5.3294 0.008124 ** >> Calories 1 301917 301917 101.3927 2.019e-13 *** >> Type:Calories 2 10402 5201 1.7466 0.185267 >> Residuals 48 142930 2978 >> --- >> Signif. codes: 0 ??***?? 0.001 ??**?? 0.01 ??*?? 0.05 ??.?? 0.1 ?? ?? 1 >> >> >> Dejian Zhao wrote: >> > Dear list members, >> > >> > I have a question about the formula in ancova(), which is embedded in >> > the HH package.There are several examples in the ancova() help file >> > which can be accessed by type "?ancova" in R console after loading HH >> > package.Some codes are as follows: >> > >> > hotdog <- read.table(hh("datasets/hotdog.dat"), header=TRUE) >> > ## y ~ x + a or y ~ a + x ## constant slope, different intercepts >> > ancova(Sodium ~ Calories + Type, data=hotdog) >> > ancova(Sodium ~ Type + Calories, data=hotdog) >> > >> > After running the codes,I found I got different results when choosing >> > different formula,i.e."ancova(Sodium ~ Calories + Type, data=hotdog)" >> > and "ancova(Sodium ~ Type + Calories, data=hotdog) " produced >> different >> > results. >> > >> > The same thing also happens to the following example codes: >> > ## y ~ x * a or y ~ a * x ## different slopes, and different >> intercepts >> > ancova(Sodium ~ Calories * Type, data=hotdog) >> > ancova(Sodium ~ Type * Calories, data=hotdog) >> > >> > Hence,I am confused about the difference between the formula "y ~ x >> + a" >> > and "y ~ a + x",likewise "y ~ x * a" and "y ~ a * x". I thought the >> > order of variables in the formula is arbitrary,however,here it >> seems the >> > order matters. >> > >> > Can someone explain the formula for me? And how should we choose the >> > formula, or arrange the order of variables in the formula, when >> > processing our own data? >> > >> > Many thanks! >> > Dejian >> > >> > ----- >> > Dejian Zhao, PhD student >> > Group of Evolutionary Ecology >> > State Key Laboratory of Integrated Pest Management >> > Institute of Zoology, Chinese Academy of Sciences >> > 1 Beichen West Road, Chaoyang District, Beijing, P.R.China >> > Postal code: 100101 >> > Tel (office): +86-10-64807217 >> > Fax: +86-10-64807099 >> > Email: zhaodj at ioz.ac.cn >> >> [[alternative HTML version deleted]] >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at stat.math.ethz.ch >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: >> http://news.gmane.org/gmane.science.biology.informatics.conductor > > Naomi S. Altman 814-865-3791 (voice) > Associate Professor > Dept. of Statistics 814-863-7114 (fax) > Penn State University 814-865-1348 (Statistics) > University Park, PA 16802-2111 > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > -- ============================= Juan Pedro Steibel Assistant Professor Statistical Genetics and Genomics Department of Animal Science & Department of Fisheries and Wildlife Michigan State University 1205-I Anthony Hall East Lansing, MI 48824 USA Phone: 1-517-353-5102 E-mail: steibelj at msu.edu
ADD REPLY
0
Entering edit mode
How can we easily find out the kind of sums of squares produced by some package and function? It seems that it is not easy to switch from one kind to another. Thanks. Dejian Juan Pedro Steibel wrote: > Good morning, > I'd add that given an object of class lm in R, there is a package > called "car" (from CRAN, not BioC) that can produce type III sums of > squares. > > Hope that helps, > JP > > > Naomi Altman wrote: >> R produces sequential sums of squares, not "Type III" or partial SS. >> The sequential SS are adjusted for the other variables in the order >> in which they are entered in the model. The partial SS are adjusted >> for all other variables in the model. >> >> The SAS manual explains this more fully under PROC REG (sequential >> and partial) and PROC GLM (sequential and Type III) and probably has >> the most concise explanations. >> >> --Naomi >> >> At 09:38 AM 3/14/2010, Dejian Zhao wrote: >>> To provide more details about the confusing results mentioned in my >>> previous email. Some parameters (eg. Sum Sq, Mean Sq, F value, Pr) >>> about >>> the two variables seem to depend on the order in the formula, and the >>> variation of probability (Pr) directly changes the significance. As to >>> my own data, changing the variables order in the formula leads to >>> changes from significance to non-significance for one variable. >>> >>> Maybe this is a trivial question for a major in math. But as a major in >>> biology, I expect someone to explain the formula and give some >>> guidelines in writing a formula. Many thanks again. >>> >>> *Results of the first set of codes:* >>> > ancova(Sodium ~ Calories + Type, data=hotdog) >>> Analysis of Variance Table >>> >>> Response: Sodium >>> Df Sum Sq Mean Sq F value Pr(>F) >>> Calories 1 106270 106270 34.654 3.281e-07 *** >>> Type 2 227386 113693 37.074 1.336e-10 *** >>> Residuals 50 153331 3067 >>> --- >>> Signif. codes: 0 ??***?? 0.001 ??**?? 0.01 ??*?? 0.05 ??.?? 0.1 ?? ?? 1 >>> >>> > ancova(Sodium ~ Type + Calories, data=hotdog) >>> Analysis of Variance Table >>> >>> Response: Sodium >>> Df Sum Sq Mean Sq F value Pr(>F) >>> Type 2 31739 15869 5.1749 0.009065 ** >>> Calories 1 301917 301917 98.4526 2.089e-13 *** >>> Residuals 50 153331 3067 >>> --- >>> Signif. codes: 0 ??***?? 0.001 ??**?? 0.01 ??*?? 0.05 ??.?? 0.1 ?? ?? 1 >>> >>> >>> *Results of the second set of codes:* >>> > ancova(Sodium ~ Calories * Type, data=hotdog) >>> Analysis of Variance Table >>> >>> Response: Sodium >>> Df Sum Sq Mean Sq F value Pr(>F) >>> Calories 1 106270 106270 35.6885 2.747e-07 *** >>> Type 2 227386 113693 38.1815 1.195e-10 *** >>> Calories:Type 2 10402 5201 1.7466 0.1853 >>> Residuals 48 142930 2978 >>> --- >>> Signif. codes: 0 ??***?? 0.001 ??**?? 0.01 ??*?? 0.05 ??.?? 0.1 ?? ?? 1 >>> >>> > ancova(Sodium ~ Type * Calories, data=hotdog) >>> Analysis of Variance Table >>> >>> Response: Sodium >>> Df Sum Sq Mean Sq F value Pr(>F) >>> Type 2 31739 15869 5.3294 0.008124 ** >>> Calories 1 301917 301917 101.3927 2.019e-13 *** >>> Type:Calories 2 10402 5201 1.7466 0.185267 >>> Residuals 48 142930 2978 >>> --- >>> Signif. codes: 0 ??***?? 0.001 ??**?? 0.01 ??*?? 0.05 ??.?? 0.1 ?? ?? 1 >>> >>> >>> Dejian Zhao wrote: >>> > Dear list members, >>> > >>> > I have a question about the formula in ancova(), which is embedded in >>> > the HH package.There are several examples in the ancova() help file >>> > which can be accessed by type "?ancova" in R console after loading HH >>> > package.Some codes are as follows: >>> > >>> > hotdog <- read.table(hh("datasets/hotdog.dat"), header=TRUE) >>> > ## y ~ x + a or y ~ a + x ## constant slope, different intercepts >>> > ancova(Sodium ~ Calories + Type, data=hotdog) >>> > ancova(Sodium ~ Type + Calories, data=hotdog) >>> > >>> > After running the codes,I found I got different results when choosing >>> > different formula,i.e."ancova(Sodium ~ Calories + Type, data=hotdog)" >>> > and "ancova(Sodium ~ Type + Calories, data=hotdog) " produced >>> different >>> > results. >>> > >>> > The same thing also happens to the following example codes: >>> > ## y ~ x * a or y ~ a * x ## different slopes, and different >>> intercepts >>> > ancova(Sodium ~ Calories * Type, data=hotdog) >>> > ancova(Sodium ~ Type * Calories, data=hotdog) >>> > >>> > Hence,I am confused about the difference between the formula "y ~ >>> x + a" >>> > and "y ~ a + x",likewise "y ~ x * a" and "y ~ a * x". I thought the >>> > order of variables in the formula is arbitrary,however,here it >>> seems the >>> > order matters. >>> > >>> > Can someone explain the formula for me? And how should we choose the >>> > formula, or arrange the order of variables in the formula, when >>> > processing our own data? >>> > >>> > Many thanks! >>> > Dejian >>> > >>> > ----- >>> > Dejian Zhao, PhD student >>> > Group of Evolutionary Ecology >>> > State Key Laboratory of Integrated Pest Management >>> > Institute of Zoology, Chinese Academy of Sciences >>> > 1 Beichen West Road, Chaoyang District, Beijing, P.R.China >>> > Postal code: 100101 >>> > Tel (office): +86-10-64807217 >>> > Fax: +86-10-64807099 >>> > Email: zhaodj at ioz.ac.cn >>> >>> [[alternative HTML version deleted]] >>> >>> _______________________________________________ >>> Bioconductor mailing list >>> Bioconductor at stat.math.ethz.ch >>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>> Search the archives: >>> http://news.gmane.org/gmane.science.biology.informatics.conductor >> >> Naomi S. Altman 814-865-3791 (voice) >> Associate Professor >> Dept. of Statistics 814-863-7114 (fax) >> Penn State University 814-865-1348 (Statistics) >> University Park, PA 16802-2111 >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at stat.math.ethz.ch >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: >> http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD REPLY
0
Entering edit mode
De-Jian ZHAO ▴ 240
@de-jian-zhao-2012
Last seen 9.6 years ago
Thank you for your explanation, Richard. But I want to confirm whether I understand you correctly. Take "ancova(Sodium ~ Calories + Type, data=hotdog)" for example. Calories is the covariate in the formula, right ? If Calories is the covariate, the result of that command shows Type is significant (as below), then how to do post hoc test on Type? Type has three levels, ie. Beef, Meat, and Poultry. The ancova() result does not carry out multiple comparison between them. Thank you very much. > ancova(Sodium ~ Calories + Type, data=hotdog) Analysis of Variance Table Response: Sodium Df Sum Sq Mean Sq F value Pr(>F) Calories 1 106270 106270 34.654 3.281e-07 *** Type 2 227386 113693 37.074 1.336e-10 *** Residuals 50 153331 3067 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0. RICHARD M. HEIBERGER wrote: > > 2010/3/14 Dejian Zhao <zhaodj@ioz.ac.cn <mailto:zhaodj@ioz.ac.cn="">> > > To provide more details about the confusing results mentioned in > my previous email. Some parameters (eg. Sum Sq, Mean Sq, F value, > Pr) about the two variables seem to depend on the order in the > formula, and the variation of probability (Pr) directly changes > the significance. As to my own data, changing the variables order > in the formula leads to changes from significance to > non-significance for one variable. > > > Yes, this is correct, and indeed is part of the point of the example. > > The sequential sum of squares depends on the sequence. > The ANOVA table for > ancova(Sodium ~ Calories + Type, data=hotdog) > allows you to test for the effect of Type conditional on Calories > already in the model. > > ancova(Sodium ~ Type + Calories, data=hotdog) > allows you to test for the effect of Calories conditional on Type > already in the model. > > The Graph, the Residual Sum of Squares, the residuals, and the > predicted values depend on the > entire model. But the individual rows of the ANOVA table depend on > the order in which > the variables were brought into the model. > > Look up "sequential sum of squares" in any intermediate statistics text. > I will recommend mine http://springeronline.com/0-387-40270-5 > > Rich [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
On Mon, Mar 15, 2010 at 8:37 AM, Dejian Zhao <zhaodj@ioz.ac.cn> wrote: > Thank you for your explanation, Richard. > But I want to confirm whether I understand you correctly. > Take "ancova(Sodium ~ Calories + Type, data=hotdog)" for example. > Calories is the covariate in the formula, right ? > > If Calories is the covariate, the result of that command shows Type is > significant (as below), then how to do post hoc test on Type? Type has three > levels, ie. Beef, Meat, and Poultry. The ancova() result does not carry out > multiple comparison between them. > > Thank you very much. > Please see the maiz example in ?MMC in the HH package. maiz is the last example in the help file. Keep going all the way to the end of the help file. See also the demo("MMC.WoodEnergy-aov", "HH") These examples show how to use glht in the presence of interactions and covariates. Rich [[alternative HTML version deleted]]
ADD REPLY

Login before adding your answer.

Traffic: 604 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6