Hello
I am trying to fit this multivariate frailty model, and I get this error :
"Error in aggregate.data.frame(as.data.frame(x), ...) : arguments must have same length"
Is there a solution to this problem? The program and datasets are pasted below
program:
modMultiv.weib <- multivPenal(Surv(time,tstat1)~cluster(pseudoid)+sex+
event2(tstat2)+terminal(dead),formula.Event2=~sex,
formula.terminalEvent=~sex,data=newdata,n.knots=c(100,100,100),kappa=c(4,4,4))
Data:
obs pseudoid sex dead time tstat1 tstat2
1 61703217 2 1 6.94 0 0
2 61636820 2 1 0.53 0 0
3 62180197 1 0 59.80 0 0
4 61940983 1 1 0.79 0 0
5 62830754 2 0 35.92 0 0
6 62512401 2 0 49.01 0 0
7 62934698 1 1 0.69 0 0
8 62934698 1 1 9.01 0 1
9 63646560 1 0 12.37 0 0
10 63325056 2 0 24.24 0 0
11 63392333 2 0 2.20 0 0
12 63392333 2 0 21.68 0 1
13 61396157 2 1 10.56 0 0
14 61396851 1 1 7.40 0 0
15 61834591 2 0 82.14 0 0
16 61732760 2 0 96.28 0 0
17 61727439 1 0 79.61 0 0
18 61727445 1 0 96.74 0 0
19 61772493 1 1 0.43 0 0
20 61772493 1 1 1.68 0 1
21 61676366 1 0 95.39 0 0
22 61963959 2 0 47.11 0 0
23 62174970 1 1 5.53 0 0
24 61929455 1 1 6.15 0 0
25 62480363 2 1 5.95 0 0
26 62801809 2 1 6.28 0 0
27 62810948 1 1 24.54 0 0
28 62798856 2 1 7.50 0 0
29 62712042 2 1 4.67 0 0
30 63157421 2 1 6.18 0 0
31 63155286 2 0 24.34 0 0
32 62922671 2 0 23.13 0 0
33 64173340 1 1 3.13 0 0
34 64172735 1 0 6.02 0 0
35 64169670 2 0 5.66 0 0
36 63754589 1 0 6.09 0 0
37 63696336 2 1 5.86 0 0
38 62317115 2 0 12.70 0 0
39 62797207 2 0 4.70 0 0
40 62787651 2 0 3.55 0 0
41 62829862 1 0 5.10 0 0
42 62829870 1 0 4.87 0 0
43 62846436 2 0 4.41 0 0
44 62770669 1 0 8.62 0 0
45 62904869 2 0 4.80 0 0
46 62913697 1 0 24.34 0 0
47 62909259 2 1 1.81 0 0
48 62909259 2 1 2.96 0 1
49 62909282 1 0 5.03 0 0
50 62894162 1 0 8.75 0 0
51 62442356 1 0 14.01 0 0
52 62439850 2 0 14.64 0 0
53 62390939 2 0 12.76 0 0
54 62391021 2 0 5.95 0 0
55 62390997 1 0 6.61 0 0
56 62425496 1 0 1.61 0 0
57 62425496 1 0 6.22 0 1
58 62437459 2 0 8.45 0 0
59 62432330 1 0 6.22 0 0
60 62411342 1 0 6.05 0 0
61 62433881 1 1 5.59 0 0
62 63120173 1 0 6.84 0 0
63 63120165 1 1 8.55 0 0
64 62682329 2 0 8.45 0 0
65 62666754 1 1 1.41 0 0
66 63179526 1 0 3.82 0 0
67 63335267 2 1 0.36 0 0
68 63311954 2 1 3.72 0 0
69 63393148 2 0 7.30 0 0
70 63472183 1 0 6.41 0 0
71 63472153 1 0 1.55 0 0
72 63472153 1 0 2.04 0 1
73 63929104 1 0 3.45 0 0
74 63552812 1 0 6.15 0 0
75 61392853 2 1 94.93 0 0
76 61826920 1 1 2.43 0 0
77 62413717 2 1 0.59 0 0
78 63002767 2 1 2.20 0 0
79 63392069 2 1 2.01 0 0
80 61846064 1 0 94.84 0 0
81 61761978 2 1 1.58 0 0
82 60052323 1 0 71.74 0 0
83 61780144 2 1 2.83 0 0
84 62076749 1 1 2.60 0 0
85 62347573 2 0 72.11 0 0
86 62922572 2 0 11.09 0 0
87 63114219 1 0 35.79 0 0
88 62979179 1 0 0.92 0 0
89 62979179 1 0 23.03 0 1
90 63330670 1 0 24.54 0 0
91 63321913 1 1 1.12 0 0
92 63321913 1 1 0.72 0 1
93 63321913 1 1 11.91 1 0
94 63213547 2 0 3.62 0 0
95 63213547 2 0 8.52 0 1
96 63642739 2 0 11.58 0 0
97 63527048 1 0 12.11 0 0
98 63459635 1 0 12.17 0 0
99 63860507 1 0 5.66 0 0
100 62085736 1 1 0.43 0 0
101 62085736 1 1 3.88 0 1
102 62085736 1 1 0.39 1 0
103 62216451 1 0 0.46 0 0
104 62216451 1 0 60.86 0 1
105 62174358 2 0 60.99 0 0
106 62354449 1 0 0.86 0 0
107 62354449 1 0 71.51 0 1
108 61627649 2 0 73.26 0 0
109 61659023 1 1 0.49 0 0
110 62207726 2 1 62.93 0 0
111 62002763 2 1 40.39 0 0
112 62722853 1 1 4.57 0 0
113 62450885 2 1 7.07 0 0
114 62941609 1 1 1.02 0 0
115 62941609 1 1 0.95 0 1
116 63031786 2 1 0.63 0 0
117 63031786 2 1 1.34 0 1
118 63031786 2 1 1.32 1 0
119 63369926 1 0 15.03 0 0
120 63271922 1 0 12.43 0 0
121 63319090 2 0 12.53 0 0
122 63588009 2 0 12.53 0 0
123 63692960 2 0 12.24 0 0
124 61841509 2 1 1.94 0 0
125 61655083 1 0 63.85 0 0
126 61645045 1 1 1.38 0 0
127 61775015 2 1 1.32 0 0
128 61937806 1 1 1.35 0 0
129 63031427 1 0 24.21 0 0
130 63841134 2 0 6.22 0 0
131 62409302 2 0 1.22 0 0
132 62409302 2 0 58.22 0 1
133 62409823 1 0 48.13 0 0
134 62410153 2 0 48.13 0 0
135 62686634 2 0 35.92 0 0
136 62926747 2 1 3.03 0 0
137 62926747 2 1 3.85 0 1
138 61828183 1 0 0.33 0 0
139 61828183 1 0 96.31 0 1
140 61395165 2 1 14.38 0 0
141 61762958 1 1 27.04 0 0
142 61859257 1 1 27.07 0 0
143 61860420 2 1 11.61 0 0
144 61541421 2 0 97.60 0 0
145 61463388 1 0 0.46 0 0
146 61463388 1 0 94.38 0 1
147 61558578 1 0 55.49 0 0
148 61563610 2 1 0.63 0 0
149 61563610 2 1 3.25 0 1
150 61380545 1 1 0.30 0 0
151 61380545 1 1 23.15 0 1
152 61361486 1 1 14.18 0 0
153 61373042 1 0 0.69 0 0
154 61373042 1 0 98.69 0 1
155 61372164 1 1 10.69 0 0
156 61371545 1 1 0.69 0 0
157 61371545 1 1 1.88 0 1
158 61345458 1 0 0.30 0 0
159 61345458 1 0 96.18 0 1
160 61722610 1 1 80.43 0 0
161 61660673 1 1 0.89 0 0
162 61660673 1 1 2.83 0 1
163 61794525 1 1 6.84 0 0
164 61793199 2 1 8.36 0 0
165 61792869 1 0 90.82 0 0
166 61783375 2 0 65.59 0 0