EMA dataset 1 trouble [RSABE / ABEL]
Hi all,
I am fiddling a bit around with scaled BE and trying to use R for same.
Cannot get to 107.11% - 124.89% for EMA dataset 1 / method A. My PE is correct so the trouble I guess is in somewhere in one of these parts:
1. sqrt(0.5*(1/nSeq1 + 1/nSeq2)
2. df and the critical T-value.
Ad 1:
Looks to me like the lm allows effect estimates for 75 subjects; this means subjects with a missing value are not tossed out. So I guess all is fine with 77 in total; seemingly 38 and 39. But I get the wrong CI anyway.
Ad 2:
For df I tried both the df form the full model and from the Ref-only model (let me add: I think it is a valid argument that the df from the latter should be used but I am sure we can have a good fight over that some other time).
Any ideas?
Here's some code bits:
Thanks in advance.
I am fiddling a bit around with scaled BE and trying to use R for same.
Cannot get to 107.11% - 124.89% for EMA dataset 1 / method A. My PE is correct so the trouble I guess is in somewhere in one of these parts:
1. sqrt(0.5*(1/nSeq1 + 1/nSeq2)
2. df and the critical T-value.
Ad 1:
Looks to me like the lm allows effect estimates for 75 subjects; this means subjects with a missing value are not tossed out. So I guess all is fine with 77 in total; seemingly 38 and 39. But I get the wrong CI anyway.
Ad 2:
For df I tried both the df form the full model and from the Ref-only model (let me add: I think it is a valid argument that the df from the latter should be used but I am sure we can have a good fight over that some other time).
Any ideas?
Here's some code bits:
A=read.table("EMAset1b.csv", header=T)
Model1=lm(log(A$DATA)~0+factor(A$FORMULATION)+
factor(A$PERIOD)+factor(A$SEQUENCE)+factor(A$SUBJECT))
lnPE=(coef(Model1)[2]-coef(Model1)[1]) ## works!
B=subset(A, FORMULATION=='R')
Model2=lm(log(B$DATA)~
factor(B$PERIOD)+factor(B$SEQUENCE)+factor(B$SUBJECT))
s=summary(Model2)$sigma ## works!
CV=sqrt(exp(s*s)-1.0) ## works!
DF=Model1$df.residual ## or use Model2's residual. Discuss some other time.
CritT=qt(1-0.05, DF)
(blah blah code for extraction of n per sequence)
lnU=lnPE+s*CritT*sqrt(0.5*(1/nBABA+1/nABAB)) ##can't get it right.
lnL=lnPE-s*CritT*sqrt(0.5*(1/nBABA+1/nABAB)) ##can't get it right.
Thanks in advance.
—
Pass or fail!
ElMaestro
Pass or fail!
ElMaestro
Complete thread:
- EMA dataset 1 troubleElMaestro 2013-04-08 20:23
- complete (RR) only Helmut 2013-04-09 02:37
- EMA dataset 1 - programmers trouble d_labes 2013-04-09 09:01
- Still not exactly sure ElMaestro 2013-04-09 10:12
- Still not exactly sure - why d_labes 2013-04-09 15:57
- My problem(s) ElMaestro 2013-04-09 16:39
- More confusion ElMaestro 2013-04-09 23:29
- Confusion help d_labes 2013-04-10 10:51
- Still not exactly sure - why d_labes 2013-04-09 15:57
- Still not exactly sure ElMaestro 2013-04-09 10:12