bpnme {bpnreg}R Documentation

Fit a Bayesian circular mixed-effects model

Description

This function fits a Bayesian circular mixed-effects model based on the projected normal distribution.

Usage

bpnme(
  pred.I,
  data,
  pred.II = pred.I,
  its = 1000,
  burn = 1,
  n.lag = 1,
  seed = NULL
)

Arguments

pred.I

model equation for effects of component 1.

data

the dataframe used for analysis.

pred.II

model equation for effects of component 2.

its

output iterations of the MCMC sampler.

burn

number of burn-in iterations.

n.lag

amount of lag for the iterations and burn-in.

seed

user-specified random seed.

Details

Because the model is based on the projected normal distribution, a model equation has to be given for the fixed and random effects of the two components. By default the model equation of the second component pred.II is set to be equal to that of the first component. Note that the circular outcome needs to be measured in radians on a scale from 0 to 2\pi. For more information about the projected normal distribution see Presnell, Morrisson & Littell (1998). The model can handle at most one grouping factor.

A tutorial on how to use this function can be found in Cremers & Klugkist (2018). More details on the sampling algorithm and interpretation of the coefficients from the model can be found in Nuñez-Antonio & Guttiérrez-Peña (2014) and Cremers, Pennings, Mainhard & Klugkist (2019). The uninformative priors for the fixed effect regression coefficients of the two components are set to N(0, 10000). Note that the model is only developed for models with a single nesting variable.

Value

A bpnme object, which can be further analyzed using the associated functions traceplot.bpnme, BFc.bpnme, coef_lin.bpnme, coef_circ.bpnme, coef_ran.bpnme, fit.bpnme and print.bpnme.

A bpnr object contains the following elements (some elements are not returned if not applicable)

beta1

A matrix of posterior samples for the fixed effects coefficients for the first component.

beta2

A matrix of posterior samples for the fixed effects coefficients for the second component.

b1

An array of posterior samples for the random effects coefficients for the first component.

b2

An array of posterior samples for the random effects coefficients for the second component.

omega1

An array of posterior samples for the random effect variances of the first component.

omega2

An array of posterior samples for the random effect variances of the second component.

predictiva

A list containing the posterior density values for all timepoints of individuals in the dataset for all iterations. The rowsums of this matrix are the likelihood values for all iterations

circular.ri

A vector of posterior samples for the circular random intercepts.

N

Number of observed cases.

its

Number of output iterations.

n.lag

One in n.lag iterations will be saved as output iteration. Set lag to 1 to save all iterations (default).

burn

Burn-in time for the MCMC sampler.

p1

Number of fixed effect parameters predicting the first component.

p2

Number of fixed effect parameters predicting the second component.

q1

Number of random effect parameters predicting the first component.

q2

Number of random effect parameters predicting the second component.

a.x

A matrix of posterior samples for a.x which describes the location of the inflection point of the regression curve on the axis of the predictor.

a.c

A matrix of posterior samples for a.c which describes the location of the inflection point of the regression curve on the axis of the circular outcome.

b.c

A matrix of posterior samples for b.c which describes the slope of the tangent line at the inflection point.

SAM

A matrix of posterior samples for the circular regression slopes at the mean.

AS

A matrix of posterior samples for the average slopes of the circular regression.

SSDO

A matrix of posterior samples for the signed shortest distance to the origin.

circ.diff

A matrix of posterior samples for the circular difference found between levels of categorical variables and the intercept.

cRSnum

A vector of posterior samples of the circular random slope estimates for the continuous variables

cRScat

A vector of posterior samples of the circular random slope estimates for the categorical variables

cRS

A vector of posterior samples of the circular random slope estimates

cRI

A vector of posterior samples of the mean resultant length of the circular random intercept, a measure of concentration.

Call

The matched call.

lin.coef.I

The mean, mode, standard deviation and 95 posterior density of the linear fixed effect coefficients for beta1.

lin.coef.II

The mean, mode, standard deviation and 95 confidence interval of the highest posterior density of the linear fixed effect coefficients for beta2.

circ.coef

The mean, mode, standard deviation and 95 density for a.x, a.c, SSDO, and the circular fixed effect coefficients b.c, AS, and SAM

circ.coef.cat

The mean, mode, standard deviation and 95 confidence interval of the highest posterior density the circular difference between levels of categorical variables and the intercept.

circ.coef.means

The mean, mode, standard deviation and 95 confidence interval of the highest posterior density of circular means of the categorical variables.

model.fit

A list of information criteria for assessment of model fit.

lin.res.varrand.I

The mean, mode, standard deviation and 95 variances of the random intercepts and slopes of component I.

lin.res.varrand.II

The mean, mode, standard deviation and 95 of component II.

circ.res.varrand

The mean, mode, standard deviation and 95 random intercepts and slopes.

mm

A list of information, model matrices, sample size, etc. on the specified model.

Source

Cremers, J., Mainhard, M.T. & Klugkist, I. (2018). Assessing a Bayesian Embedding Approach to Circular Regression Models. Methodology, 14, 69-81.

Cremers, J. & Klugkist, I. (2018). One direction? A tutorial for circular data with examples in cognitive psychology. Frontiers in Psychology: Cognitive Science.

Cremers, J., Pennings, H.J.M., Mainhard, M.T. & Klugkist, I. (2019). Circular Modelling of Circumplex Measurements for Interpersonal Behavior. Assessment, Online First.

Nuñez-Antonio, G. & Gutiérrez-Peña, E. (2014). A Bayesian model for longitudinal circular data based on the projected normal distribution. Computational Statistics and Data Analysis, 71, 506-519.

Presnell, B., Morrison, S.P. & Littell, R.C. (1998). Projected multivariate linear models for directional data. Journal of the American Statistical Association, 93 (443), 1068 - 1077.

Examples

library(bpnreg)
bpnme(Error.rad ~ Maze + Trial.type + (1|Subject), Maps, its = 100)


[Package bpnreg version 2.0.3 Index]