anova

Repeated measures ANOVA - different resutls for SPSS versus R

浪子不回头ぞ 提交于 2020-01-06 02:32:08
问题 I am trying to run a repeated - measures ANOVA using R and compared it to the SPSS output and results differ a lot! Maybe I make a mistake somewhere, but I cannot figure it out So some sample data: id is the subject. Every subject makes one rating for three items (res_1, res_2 and res_3). I want to compare an overall effect of item. id<-c(1,2,3,4,5,6) res_1<-c(1,1,1,2,2,1) res_2<-c(4,5,2,4,4,3) res_3<-c(4,5,6,3,6,6) ## wide format for spss table<-as.data.frame(cbind(id, res_1, res_2, res_3))

manova in R error message: length of 'dimnames' [1] not equal to array extent

时光毁灭记忆、已成空白 提交于 2020-01-05 12:28:15
问题 Trying to run manova on this data: Create a data.frame: acc <- data.frame(Degrees = c("5","8","10"), MPH10=c(0.35, 0.37, 0.32), MPH25=c(0.19, 0.28, 0.30), MPH40=c(0.14, 0.19, 0.29), MPH55=c(0.10, 0.19, 0.23)) check the data.frame: acc Degrees MPH10 MPH25 MPH40 MPH55 1 5 0.35 0.19 0.14 0.10 2 8 0.37 0.28 0.19 0.19 3 10 0.32 0.30 0.29 0.23 I type in: acc_manova <- manova(cbind(MPH10,MPH25,MPH40,MPH55) ~ Degrees, data = acc) then run it: acc_manova I get an error message: Call: manova(cbind

Extract Residual Deviance from anova (glm) in R

天涯浪子 提交于 2020-01-04 03:32:14
问题 I fitted a glm model in R and took the anova table. I need to extract the "Residual Deviance" column. But it generates an error. Here are the codes: Creating data: counts <- c(18,17,15,20,10,20,25,13,12) outcome <- gl(3,1,9) treatment <- gl(3,3) Fitting GLM: glm.D93 <- glm(counts ~ outcome + treatment, family = quasipoisson(link = "log")) Anova table: av.1=anova(glm.D93) av.1 Analysis of Deviance Table Model: quasipoisson, link: log Response: counts Terms added sequentially (first to last) Df

R: In anova.lm(g) : ANOVA F-tests on an essentially perfect fit are unreliable

早过忘川 提交于 2020-01-02 05:25:12
问题 I am pairing up online guides with an old text to learn R (page 182 - http://cran.r-project.org/doc/contrib/Faraway-PRA.pdf). When I use data from a package from R (as in the tutorial examples) there is no problem. However, when I use data from my text, I always end with no F-value and the warning. Take a look: data into a data.frame: car.noise <- data.frame( speed = c("idle", "0-60mph", "over 60"), chrysler = c(41,65,76), bmw = c(45,67,72), ford = c(44,66,76), chevy = c(45,66,77), subaru = c

How can I classify post-hoc test results in R?

被刻印的时光 ゝ 提交于 2020-01-01 10:14:08
问题 I am trying to understand how to work with ANOVAs and post-hoc tests in R. So far, I have used aov() and TukeyHSD() to analyse my data. Example: uni2.anova <- aov(Sum_Uni ~ Micro, data= uni2) uni2.anova Call: aov(formula = Sum_Uni ~ Micro, data = uni2) Terms: Micro Residuals Sum of Squares 0.04917262 0.00602925 Deg. of Freedom 15 48 Residual standard error: 0.01120756 Estimated effects may be unbalanced My problem is, now I have a huge list of pairwise comparisons but cannot do anything with

Using Kolmogorov Smirnov Test in R

空扰寡人 提交于 2019-12-30 10:32:00
问题 I designed 3000 experiments, so that in one experiment there are 4 groups (treatment), in each group there are 50 individuals (subjects). For each experiment I do a standard one way ANOVA and proof if their p.values has a uni probability function under the null-hypothesis, but ks.test rejects this assumption and I cant see why? subject<-50 treatment<-4 experiment<-list() R<-3000 seed<-split(1:(R*subject),1:R) for(i in 1:R){ e<-c() for(j in 1:subject){ set.seed(seed[[i]][j]) e<-c(e,rmvnorm

Using Kolmogorov Smirnov Test in R

做~自己de王妃 提交于 2019-12-30 10:31:43
问题 I designed 3000 experiments, so that in one experiment there are 4 groups (treatment), in each group there are 50 individuals (subjects). For each experiment I do a standard one way ANOVA and proof if their p.values has a uni probability function under the null-hypothesis, but ks.test rejects this assumption and I cant see why? subject<-50 treatment<-4 experiment<-list() R<-3000 seed<-split(1:(R*subject),1:R) for(i in 1:R){ e<-c() for(j in 1:subject){ set.seed(seed[[i]][j]) e<-c(e,rmvnorm

ANOVA: Degrees of freedom almost all equal 1

房东的猫 提交于 2019-12-30 09:22:23
问题 I have a data set that begins like this: > d.weight R N P C D.weight 1 1 0 0 GO 45.3 2 2 0 0 GO 34.0 3 3 0 0 GO 19.1 4 4 0 0 GO 26.6 5 5 0 0 GO 23.5 6 1 45 0 GO 22.1 7 2 45 0 GO 15.5 8 3 45 0 GO 23.4 9 4 45 0 GO 15.8 10 5 45 0 GO 42.9 ... and so on. R is replicate and there are 5 of them (1-5). N is nitrogen level, and there are 5 as well (0, 45, 90, 180, 360). P is phosphorus level, and there are 5 as well (0, 35, 70, 140, 280). C is plant combination, and there are 4 (GO, GB, LO, LB). D

ANOVA: Degrees of freedom almost all equal 1

孤街醉人 提交于 2019-12-30 09:22:22
问题 I have a data set that begins like this: > d.weight R N P C D.weight 1 1 0 0 GO 45.3 2 2 0 0 GO 34.0 3 3 0 0 GO 19.1 4 4 0 0 GO 26.6 5 5 0 0 GO 23.5 6 1 45 0 GO 22.1 7 2 45 0 GO 15.5 8 3 45 0 GO 23.4 9 4 45 0 GO 15.8 10 5 45 0 GO 42.9 ... and so on. R is replicate and there are 5 of them (1-5). N is nitrogen level, and there are 5 as well (0, 45, 90, 180, 360). P is phosphorus level, and there are 5 as well (0, 35, 70, 140, 280). C is plant combination, and there are 4 (GO, GB, LO, LB). D

A difference-in-difference boxplot-like plot in Matlab

纵然是瞬间 提交于 2019-12-25 07:24:11
问题 I am interested in creating a plot like this in Matlab. (source: 3rs-reduction.co.uk) By "like this" I mean that I wish to have a two groups, call them A and B, observed twice, pretreatment and post-treatment, where the plot consists of a left group of the box plots of A and B at time pretreatment and the right group consists of boxplots of A and B at time post-treatment, and where the mean of A pre is linked by a line to mean of A post and the mean of B pre is linked by a line to mean of B