*Bounty: 50*

*Bounty: 50*

Suppose I have the following data, in which 20 participants each rated 10 items on five different dimensions. In reality I have much more of each, but I am just using this as an example.

```
set.seed(123)
library(data.table)
library(psych)
ppt <- rep(1:20, each = 10)
item <- rep(1:10, times = 20)
dim_a <- rnorm(200)
dim_b <- rnorm(200)
dim_c <- rnorm(200)
dim_d <- rnorm(200)
dim_e <- rnorm(200)
d <- as.data.table(cbind(ppt, item, dim_a, dim_b, dim_c, dim_d, dim_e))
```

I am interested in conducting a factor analysis on the five dimensions. I could do so with something like this. (In this example it suggests no factors be extracted because of the random data, but I proceed as though it suggested two.)

```
parallel <- fa.parallel(d[, c(3:7)], fm = 'pa', fa = 'fa')
efa2 <- fa(d[, c(3:7)], nfactors =2, rotate = "oblimin", fm = 'pa', max.iter = 100000)
print(efa2$loadings,cutoff = 0.5)
```

However, this doesn’t account for the fact that ratings were nested in participants, and in items. It seems like what I need is to add crossed random effects for subjects and items. After a lot of searching, it seems like this isn’t possible in R. Am I right?