Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: How to graph means with correct SE after repeated ANOVA?

From   "RAMPL Linn" <>
To   <>
Subject   st: How to graph means with correct SE after repeated ANOVA?
Date   Thu, 25 Mar 2010 15:24:53 +0100

Dear statalists,

I am trying to graph the means of a 2-way REPEATED ANOVA in bar charts
and would like to include the correct standard errors. 

Here is how I would do this in a BETWEEN subject 2-way ANOVA:
Y = like
X1 = trial_2 (binary)
X2 = frequency (binary)

collapse (mean) m_like=like (sd) sd_like=like (count) n_like=like,
by(trial_2 wta_group)
generate like_uc1 = m_like + invttail(n_like,0.025)*sd_like/sqrt(n_like)
generate like_lc1 = m_like - invttail(n_like,0.025)*sd_like/sqrt(n_like)

generate  group_trial_2 = trial_2 if wta_group == 0
replace   group_trial_2 = trial_2 + 3 if wta_group == 1

#delimit ;
twoway (bar m_like group_trial_2 if trial_2 == 0, color(gs2)) (bar
m_like group_trial_2 if trial_2 == 1, color(gs11)) (rcap like_uc1
like_lc1 group_trial_2) ;
#delimit cr

But since the both covariates are repeated variables across subjects,
the standard errors would not be correct in the example above.

I tried the postestimation command "anovaplot" (which does not plot bars
but only dots, I guess?!) but it does not work after a repeated
regression, since it needs to have the repeated variable (in this case
the subjects) included in the command. Therefore, the desired command
"anovaplot trial_2 frequency" does not work, only "anovaplot subject
trial_2 frequency", which gives you a plot including the results for
EVERY participant instead of the group means for trial_2 and frequency
and does not include the SE either.

==> Does anyone know how to do a bar chart with the means for the two
REPEATED covariates (trial_2 and frequency, repeated over subjects)
including the STANDARD ERRORS?

That would really help a lot!!
Appreciate any advice! Thanks.


*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index