[R] results of model comparisons and summary()

R learner qq8855 at bris.ac.uk
Fri Apr 5 15:17:18 CEST 2013


Hello, 
I am running error rate analysis. It is my results below. When I compare
aov1 and aov2, X square = 4.05, p = 0.044, which indicates that adding the
factor "Congruity" improved the fitting of model. However, the following Z
value is less than 1 and p value for Z is 1, which means that "Congruity" is
not significant at all. Therefore, these two parts are not consistent, one
is sig., the other is not.  I cannot figure out why they are so different
and inconsistent? Which p value I should report? Any comments are
appreciated.
 
> options(digits=2)
> data <- read.delim("strooptaskdata2.txt", header=T)
> data <- data[data$condition != "both_incongru",]
> data <- data[data$condition != "syll_incongru",]
> data <- data[data$condition != "syll_congru",]
> data <- data[data$soa == "0",]
> attach(data)
> error <- numeric()
> error[RT==RT] <- 0
> error[RT < 0] <- 1
>  x<-length (RT); x
[1] 2220
> RT[RT<0]<-NA
>  y<-sum(is.na(RT)); y
[1] 9
> perc1<-y/x;perc1
[1] 0.0041
> 
> RT[RT<200]<-NA
> RT[RT>2000]<-NA
> z<-sum(is.na(RT));z
[1] 29
>  perc2<-z/x;perc2
[1] 0.013
> 
> congruity <- numeric()
> congruity[condition=="both_congru"] <- "congru"
> congruity[condition=="neutral"] <- "neutral"
> congruity <- as.factor(congruity)
> tapply(error*100, congruity, mean, na.rm=T)
 congru neutral 
   0.00    0.51 
> aov1 <- lmer(error ~ 1 +  (1 | subj) + (1 | color), family="binomial")
> aov2 <- lmer(error ~ congruity + (1 | subj) + (1 | color),
> family="binomial")
> anova(aov1, aov2)
Data: 
Models:
aov1: error ~ 1 + (1 | subj) + (1 | color)
aov2: error ~ congruity + (1 | subj) + (1 | color)
     Df   AIC   BIC logLik Chisq Chi Df Pr(>Chisq)  
aov1  3 119.8 136.9  -56.9                          
aov2  4 117.8 140.6  -54.9  4.05      1      0.044 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 
> summary(aov2)
Generalized linear mixed model fit by the Laplace approximation 
Formula: error ~ congruity + (1 | subj) + (1 | color) 
 AIC BIC logLik deviance
 118 141  -54.9      110
Random effects:
 Groups Name        Variance Std.Dev.
 subj   (Intercept) 1.429    1.20    
 color  (Intercept) 0.533    0.73    
Number of obs: 2220, groups: subj, 37; color, 4
Fixed effects:
                 Estimate Std. Error  z value Pr(>|z|)
(Intercept)         -22.0     2026.8 -0.01087        1
congruityneutral     15.8     2026.8  0.00781        1
Correlation of Fixed Effects:
            (Intr)
congrtyntrl -1.000



--
View this message in context: http://r.789695.n4.nabble.com/results-of-model-comparisons-and-summary-tp4663423.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list