Description Usage Arguments Value Examples
circa_single_mixed
is similar to circa_single
but allows for some simple, user-specified random-effects on the rhythmic parameters of choice.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
x |
data.frame. This is the data.frame which contains the rhythmic data in a tidy format. |
col_time |
The name of the column within the data.frame, x, which contains time in hours at which the data were collected. |
col_outcome |
The name of the column within the data.frame, x, which contains outcome measure of interest. |
col_id |
The name of the column within the data.frame, |
randomeffects |
which rhythmic parameters to allow random effects. The default is to include all rhythmic parameters. |
period |
The period of the rhythm. For circadian rhythms, leave this as the default value, |
alpha_threshold |
The level of alpha for which the presence of rhythmicity is considered. Default is to |
nlme_control |
A list of control values for the estimation algorithm to replace the default values returned by the function nlme::nlmeControl. Defaults to an empty list. |
nlme_method |
A character string. If "REML" the model is fit by maximizing the restricted log-likelihood. If "ML" the log-likelihood is maximized. Defaults to "ML". |
verbose |
An optional logical value. If |
timeout_n |
The upper limit for the model fitting attempts. Default is |
return_figure |
Whether or not to return a ggplot graph of the rhythm and cosine model. |
control |
|
list
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | set.seed(42)
mixed_data <- function(n){
counter <- 1
for(i in 1:n){
x <- make_data(k1=rnorm(1, 10, 2), alpha1=0, phi1=0)
x$id <- counter
counter <- counter + 1
if(i==1){res <- x}else{res <- rbind(res, x)}
}
return(res)
}
df <- mixed_data(n=50)
out <- circa_single_mixed(x = df, col_time = "time", col_outcome = "measure",
col_id = "id", randomeffects = c("k"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.