1
$\begingroup$

I need to find p value for a set of variables in a 2 groups (treatment and control) 2-times scenario (same subjects, pre and post). groups have the same n, with different subjects that have been randomly assigned.

My data looks like this:

> str(t_wide)
Classes ‘tbl_df’, ‘tbl’ and 'data.frame':   32 obs. of  31 variables:
 $ Subject    : num  1 1 2 2 3 3 4 4 5 5 ...
 $ Time       : num  0 1 0 1 0 1 0 1 0 1 ...
 $ Group      : chr  "Treat" "Treat" "Treat" "Treat" ...
 $ VAR1         : num  7.6 7.7 9.4 9.5 8.3 8.2 7.5 7.6 7.4 7.4 ...
 $ VAR2       : num  8400 8350 8200 8220 8300 8400 7200 7380 7200 7250 ...
 ...

my first try was to get p value like this:

t.test( VAR1 ~ Group, data=t_wide )

but i guess this leave Time variable out of the model (and probably just duplicates the cases in each group). how should i proceed? should i calculate some sort of variance of pre/post for each subject?

many thanks!

$\endgroup$

1 Answer 1

1
$\begingroup$

I think we first need to clarify whether the same subjects exist in pre and post because your original post is not quite clear on this. Assuming the pre and post contain the same subjects:

You will probably need to use ANCOVA or a linear mixed model. You may need to control for the individual differences if you have more than 1 repeated measure for each subject that is pre/post. You will definitely need to examine the pre/post differences relative to condition.

Refer to here for a full discussion of tradeoffs in this situation: Best practice when analysing pre-post treatment-control designs

$\endgroup$
2
  • $\begingroup$ same subjects for pre/post, indeed. overall i only have 2 times, so i'm not sure if this is a "repetead measurement". $\endgroup$
    – cubil
    Commented Sep 10, 2018 at 21:37
  • $\begingroup$ If you have more than 1 measure per participant then we can consider the experiment a repeated measures experiment. I would consider following an ANOVA design with an error term for the participant and a time and group interaction term. But be sure to check the assumptions for this analysis (iid, sphericity, normal response). Examples of the analysis can be found here: stats.idre.ucla.edu/r/seminars/… $\endgroup$ Commented Sep 11, 2018 at 1:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.