anova

Post hoc tests with ezANOVA output

人走茶凉 提交于 2019-12-08 05:38:11
问题 I tried to use TukeyHSD(my_anova$aov) but it gives an error: Error in UseMethod("TukeyHSD") : no applicable method for 'TukeyHSD' applied to an object of class "c('aovlist', 'listof')" Google says that there is no way to post hoc with 'aovlist'. But maybe you have any idea about post hoc with ezANOVA output. Example: require(ez) data(ANT) rt_anova = ezANOVA(data = ANT[ANT$error==0,], dv = rt, wid = subnum, within = cue,return_aov = TRUE) Try to use multcomp: require(multcomp) glht(my_anova

Looping many one-sided ANOVA in R

不打扰是莪最后的温柔 提交于 2019-12-08 04:11:20
问题 I would like to run 100 ANOVA for different numeric vectors. My numeric vectors are (ruy, fjr, akf....) from my data.frame aa=aov(data.frame$ruy~data.frame$Group) anova(aa) ab=aov(data.frame$fjr~data.frame$Group) anova(ab) ac=aov(data.frame$akf~data.frame$Group) anova(ac) ..... ..... My looping skills are poor so please be nice. 回答1: Since aov is based on lm you can cbind dependent variables on the LHS, which results in seperate models being run: formula <- as.formula(paste0("cbind(", paste

Automatically compare nested models from mice's glm.mids

▼魔方 西西 提交于 2019-12-08 00:40:49
问题 I have a multiply-imputed model from R's mice package in which there are lots of factor variables. For example: library(mice) library(Hmisc) # turn all the variables into factors fake = nhanes fake$age = as.factor(nhanes$age) fake$bmi = cut2(nhanes$bmi, g=3) fake$chl = cut2(nhanes$chl, g=3) head(fake) age bmi hyp chl 1 1 <NA> NA <NA> 2 2 [20.4,25.5) 1 [187,206) 3 1 <NA> 1 [187,206) 4 3 <NA> NA <NA> 5 1 [20.4,25.5) 1 [113,187) 6 3 <NA> NA [113,187) imput = mice(nhanes) # big model fit1 = glm

Automatically compare nested models from mice's glm.mids

你说的曾经没有我的故事 提交于 2019-12-06 11:07:30
I have a multiply-imputed model from R's mice package in which there are lots of factor variables. For example: library(mice) library(Hmisc) # turn all the variables into factors fake = nhanes fake$age = as.factor(nhanes$age) fake$bmi = cut2(nhanes$bmi, g=3) fake$chl = cut2(nhanes$chl, g=3) head(fake) age bmi hyp chl 1 1 <NA> NA <NA> 2 2 [20.4,25.5) 1 [187,206) 3 1 <NA> 1 [187,206) 4 3 <NA> NA <NA> 5 1 [20.4,25.5) 1 [113,187) 6 3 <NA> NA [113,187) imput = mice(nhanes) # big model fit1 = glm.mids((hyp==2) ~ age + bmi + chl, data=imput, family = binomial) I want to test the significance of each

How do I get R to spit out the critical value for F-statistic based on ANOVA?

依然范特西╮ 提交于 2019-12-06 04:55:39
问题 The one thing missing from an ANOVA analysis in R is that it doesn't automatically display the critical value. Everything else is given. I can tell that my F-value is way higher than it should be, but I want to know the margin at where the cut-off is. There's this online calculator that yields the critical value for F statistics based on the degrees of freedom, but I want R to do this. http://www.danielsoper.com/statcalc/calculator.aspx?id=4 How do I do it? Example: >anova(anovaModel.model1)

partition of anova and comparisons (orthogonal single df) in r

此生再无相见时 提交于 2019-12-06 03:21:07
问题 I want to do single df orthogonal contrast in anova (fixed or mixed model). Here is just example: require(nlme) data (Alfalfa) Variety: a factor with levels Cossack, Ladak, and Ranger Date : a factor with levels None S1 S20 O7 Block: a factor with levels 1 2 3 4 5 6 Yield : a numeric vector These data are described in Snedecor and Cochran (1980) as an example of a split-plot design. The treatment structure used in the experiment was a 3\times4 full factorial, with three varieties of alfalfa

Planned contrasts using ezANOVA output in R

痞子三分冷 提交于 2019-12-05 13:18:25
问题 I've been looking into using planned contrasts as opposed to post-hoc t-tests. I typically use ezANOVA (Type III ANOVA) but it seems that conducting planned contrasts using ezANOVA is not currently catered for. aov() on the other hand is a Type I ANOVA (I don't want to get into a debate about which type is best for which type of design). It is straight forward to conduct planned contrasts using aov() (for between group designs) but I want to conduct a Type III ANOVA in a repeated measures and

Two Factor ANOVA Errorbar plot in R

梦想与她 提交于 2019-12-05 02:11:33
问题 We're teaching a stats class for biology students and trying to use R as the computing and data visualization platform. As much as possible, we'd like to avoid using extra packages and doing anything terribly "fancy" in R; the focus of the course is on the statistics, not the programming. Nevertheless, we haven't found a very good way of generating an errorbar plot in R for a two factor ANOVA design. We're using the ggplot2 package to make the plot, and while it does have a built-in stat

scikit learn: how to check coefficients significance

我的未来我决定 提交于 2019-12-04 19:27:15
问题 i tried to do a LR with SKLearn for a rather large dataset with ~600 dummy and only few interval variables (and 300 K lines in my dataset) and the resulting confusion matrix looks suspicious. I wanted to check the significance of the returned coefficients and ANOVA but I cannot find how to access it. Is it possible at all? And what is the best strategy for data that contains lots of dummy variables? Thanks a lot! 回答1: Scikit-learn deliberately does not support statistical inference. If you

Custom contrasts in R: contrast coefficient matrix or contrast matrix / coding scheme? And how to get there?

给你一囗甜甜゛ 提交于 2019-12-04 10:29:48
问题 Custom contrasts are very widely used in analyses, e.g.: "Do DV values at level 1 and level 3 of this three-level factor differ significantly?" Intuitively, this contrast is expressed in terms of cell means as: c(1,0,-1) One or more of these contrasts, bound as columns, form a contrast coefficient matrix, e.g. mat = matrix(ncol = 2, byrow = TRUE, data = c( 1, 0, 0, 1, -1, -1) ) [,1] [,2] [1,] 1 0 [2,] 0 1 [3,] -1 -1 However, when it comes to running these contrasts specified by the