0

I am trying to do analysis for repeated measure crossover study with 2 periods, 2 treatment at 3 time. However, on running crossCarryKron function, I am getting this error: ****Error in r_media[ii, ] <- media_temp/(n_suj) : replacement has length zero** **

My data is in same format as in demo data- Arterial. I am not able to understand why i am getting this error. Can anyone help?

Code: carrydata<- createCarry(data=rop, treatment= "treatment", period= "period", id="sno") data<- carrydata$data carry<- carrydata$carryover

model<- CrossGEEKron(response= "syst", treatment = "treatment", 
         period = "period", id= "sno", time = "time",
         carry= "Carry_2", data=data, correlation="ar1")

Result:

Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
running glm to get initial regression estimate
(Intercept)     period2  treatment2     Carry_2        time 
   78.71847    -2.05556    -6.94444     1.88889     0.06081 
Error in r_media[ii, ] <- media_temp/(n_suj) : 
  replacement has length zero

My dataset is:

 time   babysuhidno        sno         syst diast    hr   period    treatment
                                
1   0   104944203   104944203   82  36  172 1   2
2   0   104944203   104944203   76  41  171 2   1
3   0   10583361    10583361    84  47  170 1   2
4   0   10583361    10583361    87  42  156 2   1
5   0   105855122   105855122   83  44  153 1   1
6   0   105855122   105855122   65  33  167 2   2
7   0   105855143   105855143   71  32  168 1   1
8   0   105855143   105855143   76  43  165 2   2
9   0   105904967   105904967   53  26  177 1   2
10  0   105904967   105904967   73  52  163 2   1
11  20  104944203   104944203   81  40  174 1   2
12  20  104944203   104944203   81  51  170 2   1
13  20  10583361    10583361    85  39  181 1   2
14  20  10583361    10583361    83  57  157 2   1
15  20  105855122   105855122   80  36  165 1   1
16  20  105855122   105855122   61  31  171 2   2
17  20  105855143   105855143   72  33  165 1   1
18  20  105855143   105855143   76  41  162 2   2
19  20  105904967   105904967   54  27  172 1   2
20  20  105904967   105904967   82  42  152 2   1
21  35  104944203   104944203   75  33  177 1   2
22  35  104944203   104944203   81  42  159 2   1
23  35  10583361    10583361    80  37  173 1   2
24  35  10583361    10583361    83  48  153 2   1
25  35  105855122   105855122   88  45  156 1   1
26  35  105855122   105855122   72  43  174 2   2
27  35  105855143   105855143   85  66  154 1   1
28  35  105855143   105855143   75  42  133 2   2
29  35  105904967   105904967   62  32  177 1   2
30  35  105904967   105904967   71  41  141 2   1

Anyone know how to circumvent this error?

toyota Supra
  • 3,181
  • 4
  • 15
  • 19

0 Answers0