Diff for "FAQ/singcase" - CBU statistics Wiki
location: Diff for "FAQ/singcase"
Differences between revisions 1 and 6 (spanning 5 versions)
Revision 1 as of 2007-02-12 12:12:42
Size: 923
Editor: PeterWatson
Comment:
Revision 6 as of 2007-02-20 14:59:32
Size: 1121
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== Comparing a pairwise mean difference to
a single case ==
== Comparing a within subjects group difference to that of a single case ==
Line 4: Line 3:
Suppose a group of controls and a single case do a pair of conditions and we are interested in seeing if the relationship between the conditions in the controls is the same as that in the single case. '''Pairwise case '''

Suppose a group of controls and a single case do a pair of conditions (c1, c2, say) and we are interested in seeing if the relationship between the conditions in the controls is the same as that in the single case.
Line 10: Line 11:
There is a one-sample t-test option under analyze:means in SPSS. Alternatively the below example will work using R. There is a one-sample t-test option under analyze:means in SPSS. Alternatively the below example will work using R. Here c1 and c2 are the two conditions and sub denotes if the subject is a control or a case.
Line 24: Line 25:

[:FAQ/singcase/multiW: Three or more conditions]

Comparing a within subjects group difference to that of a single case

Pairwise case

Suppose a group of controls and a single case do a pair of conditions (c1, c2, say) and we are interested in seeing if the relationship between the conditions in the controls is the same as that in the single case.

Since we have a single case we can treat its difference as a constant. So we end up with a one sample t-test on the control group difference minus the case difference. Ie we test if the mean difference in controls - difference in case equals 0.

There is a one-sample t-test option under analyze:means in SPSS. Alternatively the below example will work using R. Here c1 and c2 are the two conditions and sub denotes if the subject is a control or a case.

c1 <- c(2,1,2,3,1,2,2,1,1,3,3,1)
c2 <- c(3,4,1,1,6,1,3,2,2,5,2,2)
sub <- c(1,1,1,1,1,1,1,1,1,1,1,2)
diff <- c1 – c2
diffn <- diff[sub == 1]
diffp <- diff[sub == 2]
diffy <- diffn - diffp 
const <- gl(1,length(diffn))
id <- gl(length(diffn),1)
t.test(diffy, mu=0)

[:FAQ/singcase/multiW: Three or more conditions]

None: FAQ/singcase (last edited 2017-04-04 15:57:39 by PeterWatson)