| bpnme | R Documentation |
This function fits a Bayesian circular mixed-effects model based on the projected normal distribution.
bpnme(
pred.I,
data,
pred.II = pred.I,
its = 1000,
burn = 1,
n.lag = 1,
seed = NULL
)
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. |
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.
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)
beta1A matrix of posterior samples for the fixed effects coefficients for the first component.
beta2A matrix of posterior samples for the fixed effects coefficients for the second component.
b1An array of posterior samples for the random effects coefficients for the first component.
b2An array of posterior samples for the random effects coefficients for the second component.
omega1An array of posterior samples for the random effect variances of the first component.
omega2An array of posterior samples for the random effect variances of the second component.
predictivaA 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.riA vector of posterior samples for the circular random intercepts.
NNumber of observed cases.
itsNumber of output iterations.
n.lagOne in n.lag iterations will
be saved as output iteration. Set lag to 1 to save all iterations
(default).
burnBurn-in time for the MCMC sampler.
p1Number of fixed effect parameters predicting the first component.
p2Number of fixed effect parameters predicting the second component.
q1Number of random effect parameters predicting the first component.
q2Number of random effect parameters predicting the second component.
a.xA 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.cA 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.cA matrix of posterior
samples for b.c which describes the slope of the tangent line at the
inflection point.
SAMA matrix of posterior samples for the circular regression slopes at the mean.
ASA matrix of posterior samples for the average slopes of the circular regression.
SSDOA matrix of posterior samples for the signed shortest distance to the origin.
circ.diffA matrix of posterior samples for the circular difference found between levels of categorical variables and the intercept.
cRSnumA vector of posterior samples of the circular random slope estimates for the continuous variables
cRScatA vector of posterior samples of the circular random slope estimates for the categorical variables
cRSA vector of posterior samples of the circular random slope estimates
cRIA vector of posterior samples of the mean resultant length of the circular random intercept, a measure of concentration.
CallThe matched call.
lin.coef.IThe mean,
mode, standard deviation and 95
posterior density of the linear fixed effect coefficients for beta1.
lin.coef.IIThe mean, mode, standard deviation and 95
confidence interval of the highest posterior density of the linear fixed
effect coefficients for beta2.
circ.coefThe 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.catThe 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.meansThe mean, mode, standard deviation and 95 confidence interval of the highest posterior density of circular means of the categorical variables.
model.fitA list of information criteria for assessment of model fit.
lin.res.varrand.IThe mean, mode, standard deviation and 95 variances of the random intercepts and slopes of component I.
lin.res.varrand.IIThe mean, mode, standard deviation and 95 of component II.
circ.res.varrandThe mean, mode, standard deviation and 95 random intercepts and slopes.
mmA list of information, model matrices, sample size, etc. on the specified model.
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.
library(bpnreg)
bpnme(Error.rad ~ Maze + Trial.type + (1|Subject), Maps, its = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.