|
244 | 244 | @test Z == expected
|
245 | 245 | Z = T.data_random_effects(f, df_cat)
|
246 | 246 | @test Z == expected
|
247 |
| - |
248 |
| - expected = Dict("slope_x_int" => [1.0, 2.0, 3.0, 4.0]) |
249 |
| - f = @formula y_float ~ 1 + (1 + x_int | x_cat) |
250 |
| - Z = T.data_random_effects(f, nt_str) |
251 |
| - @test Z == expected |
252 |
| - Z = T.data_random_effects(f, nt_cat) |
253 |
| - @test Z == expected |
254 |
| - Z = T.data_random_effects(f, df_str) |
255 |
| - @test Z == expected |
256 |
| - Z = T.data_random_effects(f, df_cat) |
257 |
| - @test Z == expected |
258 |
| - |
259 |
| - expected = Dict( |
260 |
| - "slope_x_float" => [1.1, 2.3, 3.14, 3.65], "slope_x_int" => [1.0, 2.0, 3.0, 4.0] |
261 |
| - ) |
262 |
| - f = @formula y_float ~ 1 + (1 + x_int + x_float | x_cat) |
263 |
| - Z = T.data_random_effects(f, nt_str) |
264 |
| - @test Z == expected |
265 |
| - Z = T.data_random_effects(f, nt_cat) |
266 |
| - @test Z == expected |
267 |
| - Z = T.data_random_effects(f, df_str) |
268 |
| - @test Z == expected |
269 |
| - Z = T.data_random_effects(f, df_cat) |
270 |
| - @test Z == expected |
271 |
| - |
272 |
| - expected = Dict( |
273 |
| - "slope_x_float" => [1.1, 2.3, 3.14, 3.65], "slope_x_int" => [1.0, 2.0, 3.0, 4.0] |
274 |
| - ) |
275 |
| - f = @formula y_float ~ |
276 |
| - 1 + (1 + x_int + x_float | x_cat) + (1 + x_int + x_float | group) |
277 |
| - Z = T.data_random_effects(f, nt_str) |
278 |
| - @test Z == expected |
279 |
| - Z = T.data_random_effects(f, nt_cat) |
280 |
| - @test Z == expected |
281 |
| - Z = T.data_random_effects(f, df_str) |
282 |
| - @test Z == expected |
283 |
| - Z = T.data_random_effects(f, df_cat) |
284 |
| - @test Z == expected |
285 | 247 | end
|
286 | 248 |
|
287 | 249 | @testset "has_ranef" begin
|
|
310 | 272 |
|
311 | 273 | f = @formula y_float ~ x_int + (1 | x_cat)
|
312 | 274 | @test T.ranef(f) isa Tuple{T.RandomEffectsTerm}
|
313 |
| - |
314 |
| - f = @formula y_float ~ x_int + (1 + x_float | x_cat) |
315 |
| - @test T.ranef(f) isa Tuple{T.RandomEffectsTerm} |
316 | 275 | end
|
317 | 276 |
|
318 | 277 | @testset "n_ranef" begin
|
|
327 | 286 |
|
328 | 287 | f = @formula y_float ~ 1 + x_float + (1 | x_cat) + (1 | group)
|
329 | 288 | @test T.n_ranef(f) == 2
|
330 |
| - |
331 |
| - f = @formula y_float ~ x_int + (1 + x_float | x_cat) |
332 |
| - @test T.n_ranef(f) == 2 |
333 |
| - |
334 |
| - f = @formula y_float ~ 1 + (1 + x_int + x_float | x_cat) |
335 |
| - @test T.n_ranef(f) == 3 |
336 |
| - |
337 |
| - f = @formula y_float ~ |
338 |
| - 1 + (1 + x_int + x_float | x_cat) + (1 + x_int + x_float | group) |
339 |
| - @test T.n_ranef(f) == 6 |
340 | 289 | end
|
341 | 290 |
|
342 | 291 | @testset "intercept_per_ranef" begin
|
343 | 292 | f = @formula y_float ~ 1 + x_int + xcat + (1 | x_cat)
|
344 | 293 | @test T.intercept_per_ranef(T.ranef(f)) == ["x_cat"]
|
345 | 294 |
|
346 |
| - f = @formula y_float ~ 1 + (1 + x_int + x_float | x_cat) |
347 |
| - @test T.intercept_per_ranef(T.ranef(f)) == ["x_cat"] |
348 |
| - |
349 | 295 | f = @formula y_float ~ 1 + x_float + (1 | x_cat) + (1 | x_cat)
|
350 | 296 | @test T.intercept_per_ranef(T.ranef(f)) == ["x_cat"]
|
351 | 297 |
|
352 | 298 | f = @formula y_float ~ 1 + x_float + (1 | x_cat) + (1 | group)
|
353 | 299 | @test T.intercept_per_ranef(T.ranef(f)) == ["x_cat", "group"]
|
354 |
| - |
355 |
| - f = @formula y_float ~ 1 + (1 + x_int + x_float | x_cat) |
356 |
| - @test T.intercept_per_ranef(T.ranef(f)) == ["x_cat"] |
357 |
| - |
358 |
| - f = @formula y_float ~ |
359 |
| - 1 + (1 + x_int + x_float | x_cat) + (1 + x_int + x_float | group) |
360 |
| - @test T.intercept_per_ranef(T.ranef(f)) == ["x_cat", "group"] |
361 | 300 | end
|
362 | 301 |
|
363 | 302 | @testset "slope_per_ranef" begin
|
364 | 303 | f = @formula y_float ~ 1 + x_int + xcat + (1 | x_cat)
|
365 | 304 | @test T.slope_per_ranef(T.ranef(f)) == T.SlopePerRanEf()
|
366 | 305 |
|
367 |
| - f = @formula y_float ~ 2 + (1 + x_int + x_float | x_cat) |
368 |
| - @test T.slope_per_ranef(T.ranef(f)) == |
369 |
| - T.SlopePerRanEf(Dict("x_cat" => ["x_int", "x_float"])) |
370 |
| - |
371 | 306 | f = @formula y_float ~ 1 + x_float + (1 | x_cat) + (1 | x_cat)
|
372 | 307 | @test T.slope_per_ranef(T.ranef(f)) == T.SlopePerRanEf()
|
373 |
| - |
374 |
| - f = @formula y_float ~ 1 + x_float + (1 | x_cat) + (1 | group) |
375 |
| - @test T.slope_per_ranef(T.ranef(f)) == T.SlopePerRanEf() |
376 |
| - |
377 |
| - f = @formula y_float ~ |
378 |
| - 1 + (1 + x_int + x_float | x_cat) + (1 + x_int + x_float | group) |
379 |
| - @test T.slope_per_ranef(T.ranef(f)) == T.SlopePerRanEf( |
380 |
| - Dict("x_cat" => ["x_int", "x_float"], "group" => ["x_int", "x_float"]) |
381 |
| - ) |
382 | 308 | end
|
383 | 309 |
|
384 | 310 | @testset "get_idx" begin
|
|
0 commit comments