[R] ANOVA stuffs_How to save each result from FOR command?

jim holtman jholtman at gmail.com
Tue Oct 19 12:34:50 CEST 2010


Here is how you can get the results back in a list that you can then analyze:

results_ezANOVA <- list()
for(i in 1:90) {
    results_ezANOVA[[i]] <-  ezANOVA(data=subset(ast.ast_coef,
        ast.ast_coef$coef_thr==i), dv=.(ast.values),
        between=.(gender), wid=.(subj),
        within=.(cond))
}

On Tue, Oct 19, 2010 at 6:16 AM, BumSeok Jeong <bumseok.jeong at gmail.com> wrote:
> Dear R experts,
>
> I'm new in R and a beginner in terms of statistics.
> It should be simple question, but definitely difficult to solve it by
> myself.
>
> I'd like to see main effect of group(gender: sample size is
> different(M:F=23:18) and one of condition(cond) and the interaction at each
> subset from 90 datasets
> So I perform anova 90 times using a command like below;
>
> for(i in 1:90) {results_ezANOVA = ezANOVA(data=subset(ast.ast_coef,
> ast.ast_coef$coef_thr==i), dv=.(ast.values), between=.(gender), wid=.(subj),
> within=.(cond))}
>
> But I got the last(90th) result, not all.
> Here are my questions.
>
> 1) Is my command correct?
> 2) If correct, please let me know if I can get all 90 results.
> 3) What kind of postHoc would be appropriate?
>
> Thank you,
>
> Jeong
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?



More information about the R-help mailing list