Skip to contents

Given a time variable and optional covariates, generate predicted values from a cosinor fit. Default prediction is the mean value, optionally can predict at a given month

Usage

# S3 method for cglmm
predict(object, newdata, ...)

Arguments

object

An object of class cglmm.

newdata

Optional new data.

...

other arguments passed to glmmTMB:::predict.glmmTMB.

Value

Returns predicted values from the cosinor model.

Examples


fit <- cglmm(vit_d ~ X + amp_acro(time,
  group = "X",
  n_components = 1,
  period = 12
), data = vitamind)
predict(fit)
#>   [1] 28.78703 29.38899 39.65854 32.15901 33.23152 31.59433 23.83651 25.61113
#>   [9] 35.22545 30.23427 36.66338 35.07011 26.82298 35.51448 24.51868 31.44631
#>  [17] 30.00428 32.91062 28.62956 23.75660 35.10536 30.11651 33.63770 34.51069
#>  [25] 25.02505 25.25647 31.02807 23.60527 24.18237 39.37435 25.82357 39.59839
#>  [33] 28.24383 31.14540 35.25047 35.38660 23.42314 24.75488 32.49686 23.44897
#>  [41] 39.11973 23.74275 31.59794 23.83684 25.52791 24.60214 27.60858 28.42553
#>  [49] 35.83474 33.66548 36.72509 27.97113 33.23490 24.11053 24.85594 35.93978
#>  [57] 27.03989 24.93988 35.80208 30.54907 35.57846 27.91994 35.08763 23.59721
#>  [65] 28.99434 27.91936 34.94810 24.87614 35.64055 24.63725 27.62906 32.39134
#>  [73] 30.53587 26.22991 24.15941 29.70517 23.46939 29.52666 38.02665 38.71979
#>  [81] 23.62914 26.19744 35.92551 39.52855 31.46970 31.26501 23.80388 33.81262
#>  [89] 29.29779 24.16631 34.81420 35.51270 23.64597 28.25380 27.66860 28.18308
#>  [97] 23.49232 23.52321 27.05249 24.01758 32.66548 34.64840 23.96458 25.41950
#> [105] 32.41430 30.85780 34.78939 35.56505 33.49875 26.00210 27.13927 27.05351
#> [113] 24.50105 31.40587 24.19340 33.02303 28.51051 35.75483 26.79572 25.19659
#> [121] 25.26220 25.78390 28.30831 32.67383 39.09038 36.50282 28.24510 31.81259
#> [129] 35.83742 35.62749 25.21056 23.77412 33.73027 31.82716 29.17193 33.93879
#> [137] 35.28723 24.98276 32.45258 37.68323 28.36229 34.60108 31.45233 30.26221
#> [145] 35.96024 34.00755 27.33207 23.62559 23.82340 39.55556 36.93157 24.42923
#> [153] 33.54381 35.54254 24.52004 31.84621 26.92623 35.15592 31.66329 35.89971
#> [161] 28.54019 39.65296 23.96760 39.34180 38.38550 29.95681 24.85415 24.70597
#> [169] 38.73700 27.30479 27.17846 23.66411 37.66169 26.28373 39.57867 23.60737
#> [177] 25.78763 35.86054 24.56264 32.71904 27.19674 32.93022 23.63372 23.62670
#> [185] 34.29370 33.67406 34.70216 23.64030 32.34731 24.28945 31.90187 26.48566
#> [193] 24.47011 26.37521 26.95760 30.17249 24.55746 35.49054 28.32652 28.48194