Random Effects Model by Hand I use random effects models (aka mixed-effects models aka multi-level models aka hierarchical linear models) frequently in my research. Although I understood the intuition behind them for a long time, I was lost on the mechanics, so I decided to finally sit down and try to code one from scratch. The random effects model is given by the equation: $$y_i = X_i\alpha + Z_ib_i + e_i$$
A Structural Equation Model from Scratch In this post, I will build a latent variable Structural Equation Model (SEM) from scratch. Latent variable models are useful for reducing many observations into a single variable. For example, let’s say there a battery of questionnaires that assess depressive symptoms, and those batteries consist of many different items. It is possible to construct a latent variable of depression from those batteries and items.
Introduction For this post, I want to look at the earnings of immigrants by the year that they immigrate to the United States. I want to to this because I am interested in looking to see if the earnings of immigrants are declining over time. I hear a constant debate in the media on whether or not the American Dream is dead. I thought that looking into the earnings of immigrants is a particularly good way to get an answer to this debate.
Some interesting articles for the week of August 10, 2020 to August 17, 2020: Education and Cognitive Functioning Across the Life Span: Authors find that there is no effect of education on decline in cognitive ability over the lifespan, but educational attainment does increase the peak of cognitive ability that people reach, which in leads to higher valleys later in life. Partisan ideological attitudes: Liberals are tolerant; the intelligent are intolerant: This one is paywalled, unfortunately, but it seems to gather further evidence for a troubling finding: the intelligent can be particularly intolerant.
Introduction On July 26, 2020, Propublica released a dataset on police discipline records. I wanted to get a look at the data and do some exploratory analysis. library(tidyverse) ## ── Attaching packages ──────────────────────────────────────────────────────────────────────── tidyverse 1.3.0 ── ## ✓ ggplot2 3.3.2 ✓ purrr 0.3.4 ## ✓ tibble 3.0.3 ✓ dplyr 1.0.0 ## ✓ tidyr 1.1.0 ✓ stringr 1.4.0 ## ✓ readr 1.3.1 ✓ forcats 0.5.0 ## Warning: package 'ggplot2' was built under R version 3.