# Statistics

## Mixed Factorial ANOVA in R

Load Required Packages Data Description Data Import Mixed ANOVA ANOVA Table Plot Sample Result Reporting Load Required Packages library(afex) ## Loading required package: lme4 ## Loading required package: Matrix ## ************ ## Welcome to afex.

## Unit-Specific vs. Population-Average Models

One thing that I always felt uncomfortable in multilevel modeling (MLM) is the concept of a unit-specific (US)/subject-specific model vs. a population-average (PA) model. I’ve come across it several times, but for some reason I haven’t really made an effort to fully understand it.

## Weighted Least Squares

Load packages Data Polychoric Correlations lavaan OpenMx Weighted Least Squares Estimation One-factor model Standard Errors Final thoughts Recently I was working on a revision for a paper that involves structural equation modeling with categorical observed variables, and it uses a robust variant of weighted least square (also called asymptotic distribution free) estimators.

## Asymptotic Standard Errors in CFA

Define True Model and Simulate Some Data Define Log-Likelihood Function Defining $$\mathcal{l}(\boldsymbol{\mathbf{\Sigma}}; S)$$ in R: MLE Asymptotic Standard Errors Using expected information Observed information (using Hessian) MLM/MLMV MLR Bibliography In our lab meeting I’m going to present the article by Maydeu-Olivares (2017), which talked about standard errors (SEs) of the maximum likelihood estimators (MLEs) in SEM models.

## Bayesian MLM With Group Mean Centering

The Problem Demonstration Group mean centering with lme4 Same analyses with Bayesian using brms Group mean centering treating group means as latent variables With random slopes Using the Full Data With lme4 With Bayesian taking into account the unreliability Bibliography This post is updated on 2020-02-04 with cleaner and more efficient STAN code.