0% ont trouvé ce document utile (0 vote)
3 vues3 pages

Analyse de la variance à deux facteurs

Le document présente une analyse de la variance à deux facteurs sur des données de survie de rats en fonction de deux traitements : poison et traitement. Il montre comment vérifier l'interaction entre ces facteurs à l'aide de graphiques et d'analyses statistiques, concluant que l'interaction n'est pas significative mais que les facteurs ont des effets principaux. Un exercice est proposé pour étudier l'effet de la température et d'un type de bactérie sur le développement des oiseaux.

Transféré par

Khouloud Tajddine
Copyright
© All Rights Reserved
Nous prenons très au sérieux les droits relatifs au contenu. Si vous pensez qu’il s’agit de votre contenu, signalez une atteinte au droit d’auteur ici.
Formats disponibles
Téléchargez aux formats PDF, TXT ou lisez en ligne sur Scribd
0% ont trouvé ce document utile (0 vote)
3 vues3 pages

Analyse de la variance à deux facteurs

Le document présente une analyse de la variance à deux facteurs sur des données de survie de rats en fonction de deux traitements : poison et traitement. Il montre comment vérifier l'interaction entre ces facteurs à l'aide de graphiques et d'analyses statistiques, concluant que l'interaction n'est pas significative mais que les facteurs ont des effets principaux. Un exercice est proposé pour étudier l'effet de la température et d'un type de bactérie sur le développement des oiseaux.

Transféré par

Khouloud Tajddine
Copyright
© All Rights Reserved
Nous prenons très au sérieux les droits relatifs au contenu. Si vous pensez qu’il s’agit de votre contenu, signalez une atteinte au droit d’auteur ici.
Formats disponibles
Téléchargez aux formats PDF, TXT ou lisez en ligne sur Scribd

Analyse de la variance à deux facteurs

Un premier exemple:
Téléchargez le fichier [Link] disponible sur
[Link]
A titre d’exemple, considérons un modèle d’analyse de la variance à deux facteurs poison
et treat administrés à une population de 48 rats lors d’une étude de toxicité. La réponse
enregistrée est time le temps de survie en dizaines d’heures.
> load(’[Link]’) lecture des données.
Traçons les données.
> plot(time ∼ treat + poison, rats)
D’après les tracés, il y a indication d’une dissymétrie dans les données et surtout
d’une dépendance de la variance à la moyenne.
On se propose de voir s’il y a présence d’interaction entre les deux facteurs par un
graphique. C’est l’objet des instructions qui suivent.
> regroup<-split(time,paste(poison,treat)) Regroupe les données par niveaux de facteur
> moypargroup<-lapply(regroup,mean) Calcul les moyennes par niveaux de facteurs
> cellmeans<-unlist(moypargroup) Transforme la liste en un vecteur
> matplot(1:4,matrix(cellmeans,4,3),type="l" Tracé du graphique
,axes=F,ylab="Cell means",xlab="Treatment"
,main="Interaction plot")
> axis(1,1:4,c("A","B","C","D")) Affichage de l’axe des abcisses
> axis(2) Affichage de l’axe des ordonnées
> legend(3,0.9,c("I","II","III"),lty=1:3) Légende des courbes
> matplot(1:3,matrix(cellmeans,3,4,byrow=T)
,type="l",axes=F,ylab="Cell means"
,xlab="poison",main="Interaction plot")
> axis(1,1:3,c("I","II","III"))
> axis(2)
> legend(2.4,0.9,c("A","B","C","D"),lty=1:4)
Les courbes obtenues sont elles parallèles (absence d’interaction) ? Le problème est
que ces courbes sont aléatoires et qu’il est difficile de conclure. Heureusment nous dis-
posons d’observations répétées et nous pourrons donc tester l’absence d’interaction entre
les facteurs.
> g<-lm(time ∼ poison*treat)

> anova(g)
Analysis of Variance Table

Response: time
Df Sum Sq Mean Sq F value Pr(>F)
poison 2 1.03301 0.51651 23.2217 3.331e-07 ***
treat 3 0.92121 0.30707 13.8056 3.777e-06 ***
poison:treat 6 0.25014 0.04169 1.8743 0.1123
Residuals 36 0.80073 0.02224
---
Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1

1
On voit que l’interaction n’est pas significative mais que les facteurs
ont un effet principal. Contr^ olons les résidus du modèle linéaire ajusté.
> qqnorm(g$res) QQ-plot
On voit que la ‘‘droite de Henry’’ n’est pas très droite. Il y a donc un
problème. On pourra éventuellement s’en sortir en transformant les données.
> g<-lm(log(time) ∼ poison*treat)
> qqnorm(g$res)
Pas assez. Essayons une autre transformation.
> g<-lm(1/time ∼ poison*treat)
> qqnorm(g$res)
C’est mieux.

> anova(g)
Analysis of Variance Table

Response: 1/time
Df Sum Sq Mean Sq F value Pr(>F)
poison 2 34.877 17.439 72.6347 2.310e-13 ***
treat 3 20.414 6.805 28.3431 1.376e-09 ***
poison:treat 6 1.571 0.262 1.0904 0.3867
Residuals 36 8.643 0.240
---
Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1

Comme il n’y a pas interaction, on peut aussi simplifier le modèle et réexaminer


l’ajustement.

> g<-lm(1/time ~ poison+treat)


> anova(g)
Analysis of Variance Table

Response: 1/time
Df Sum Sq Mean Sq F value Pr(>F)
poison 2 34.877 17.439 71.708 2.865e-14 ***
treat 3 20.414 6.805 27.982 4.192e-10 ***
Residuals 42 10.214 0.243
---
Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1

Exercice 1
Le fichier [Link] présent sur la m^eme page web est un fichier qui
contient les résultats d’une experience permettant d’étudier l’effet d’une
type de bactérie sur le développement des oiseaux. Pour lire ce fichier, on
efffectuera la commande
> bacteria<-[Link]("[Link]",header=T)
Pour cela, et afin d’éviter tout risque de contagion, les groupes traités furent
séparés dans des chambres différentes mises à des températures différentes.

2
En vous inspirant de l’analyse précédente, étudier l’effet des facteurs température
temp et bactérie bact sur l’indice de développement bill. Vous commenterez
vos graphiques et vos réponses.

Common questions

Alimenté par l’IA

Interaction plots allow for visual assessment of possible interaction effects between factors in an ANOVA model by plotting mean responses for combinations of factor levels. In the case of the poison and treat example, interaction plots were used to depict cell means for each combination of treatment and poison. These plots help identify non-parallel lines, which suggest interactions. However, in this example, the lines appeared somewhat random instead of clearly non-parallel, suggesting no obvious interaction . This plot serves as a heuristic tool for evaluating potential interactions before conducting statistical tests .

The simplification of the ANOVA model was justified by the non-significance of the interaction term (poison:treat; p=0.3867), suggesting it does not significantly contribute to explaining variance in the response variable. By removing the non-significant interaction term, the model was simplified to examine only the main effects of poison and treat. This simplification streamlines analysis and interpretation without sacrificing information, as interaction does not influence the outcome significantly in this context . This approach emphasizes efficiency in model specification when higher complexity is unwarranted by data .

Data transformation is used to satisfy the assumptions of ANOVA, such as normality and homoscedasticity of residuals, which are crucial for the validity of statistical tests. In the rat survival study, initial residuals deviated from normality, evidenced by less straight QQ-plots. Applying transformations, like taking inverse time (1/time), rectified these issues, improving residual normality and variance homogeneity. This ensured that the assumptions underlying the ANOVA tests were met, leading to more reliable conclusions drawn from the statistical analyses .

When a significant main effect but no interaction is found in a two-way ANOVA study, it suggests that the individual factors independently affect the response variable but do not jointly interact to produce an additional effect. In the rat survival study, both poison and treat significantly impact survival time, yet there is no significant interaction between them. This implies that while either factor can alter survival independently, their combination does not exacerbate or mitigate this effect beyond their separate contributions .

An interaction plot visualizes the mean responses for various levels of one factor across the levels of another factor, highlighting the interaction effect in factorial ANOVA designs. In the rat study, interaction plots were used to graph cell means of survival times across different treatment and poison levels. The plots help observe whether lines are parallel or non-parallel; parallel lines indicate no interaction, while non-parallel lines suggest interaction. In this study, the interaction plot did not show clear non-parallelism, suggesting no significant interaction between factors, guiding further analysis with the ANOVA table .

The two-way ANOVA model is used to assess the interaction between the factors poison and treat by considering the response variable 'time,' which represents the survival time in tens of hours of 48 rats. By using an interaction plot and analyzing the variance table, the model tests for possible interactions between poison and treat. The results show that the interaction is not statistically significant (poison:treat; p=0.1123), indicating that the combined effect of both factors does not significantly impact survival time beyond their individual effects .

For the model 1/time ∼ poison + treat, the ANOVA table shows that both poison (F-value = 71.708, p=2.865e-14) and treat (F-value = 27.982, p=4.192e-10) have statistically significant main effects on rat survival times. This implies that both factors contribute individually to changes in survival times of the rats in the study .

Checking model residuals is crucial for verifying the assumptions of normality and homoscedasticity in a two-way ANOVA, ensuring valid conclusions. In the rat survival study, the residuals were examined using QQ-plots after fitting the initial linear model. The examination revealed deviations from normality, indicated by a twisted Henry's line. Transformations, such as log(time) and then 1/time, were applied to correct these issues, ultimately achieving a better model fit with normally distributed residuals . Ensuring properly behaved residuals is essential for accurate hypothesis testing within ANOVA frameworks .

In two-way ANOVA, the significance of individual factors and interaction effects is tested using F-tests, which compare the variance explained by each factor or interaction to the error variance. In the rat survival study, the ANOVA table displays Df (degrees of freedom), Sum Sq (sum of squares), Mean Sq (mean square), F-value, and Pr(>F) for each factor and their interaction. Significant factors or interactions yield high F-values and low p-values. In this study, poison and treat independently have significant effects (p-values of 2.310e-13 and 1.376e-09, respectively), while the interaction poison:treat is not significant (p=0.3867), indicating no significant combined effect beyond the main effects .

Initially, the residuals of the linear model, using the natural log transformation log(time), showed issues with normality as revealed by the QQ-plot, which displayed a lack of a straight Henry's line . A subsequent transformation using 1/time was applied, which led to better alignment of the residuals with normality assumptions, as indicated by an improved QQ-plot . This transformation provided a more suitable model for analysis, as it improved the validity of ANOVA results by correcting residual issues .

Vous aimerez peut-être aussi