bayesian - BUGS model for (nested?) repeated measures ANOVA -


i wondering if has code bugs/jags model repeated measures anova? basically, have response (y) want model against time of day, day, , treatment. include 2 interaction terms, treatment x time of day , treatment x day. there 20 individuals in study, measured 4 times per day on 1 week. i'm not entirely sure start, , i'm concerned time of day covariate should nested within day covariate? if has code likelihood portion of bugs/jags model, appreciated. can take care of priors. can't seem off ground one.

there few ambiguities in question.

  1. do want time of day , day enter continuous covariates or discrete factors?

  2. do want individual identity enter model fixed or random effect?

  3. if either day or time of day factor, want include fixed or random effect?

  4. you ask whether time of day should nested within day. impossible answer without knowing more data , aims.

here's example of code assumes want treat individuals random effect.

also assumed: treatment, time.of.day, , day have constant slopes across individuals. straightforward extend model fixed- or random-slopes model different individuals separate modeled slopes. example, random-slopes model, you'd modify beta parameters below treat them in manner similar alpha parameter.

following op's request, likelihood portion only, , not include priors.

for(i in 1:n.observations){    y[i] ~ dnorm(alpha[individual[[i]] + beta1*day[i] + beta2*time.of.day[i] + beta3*treatment[i] + beta4*treatment[i]*day[i] + beta5*treatment[i]*time.of.day[i], tau.obs) } # individual[i] contains numerical index representing individual corresponds observation i.  for(j in 1:n.individuals){    alpha[j] ~ dnorm(mu, tau) } 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -