How to code a covariate with less observations than the dependent variable? I’m looking to test pre vs post differences in working memory (using R), and have a covariate (IQ) that was only measured once. My data frame looks something like this:
d <- tibble::tibble(time = c(rep("pre", 10), rep("post", 10)),
  wrking_mem = c(abs(rnorm(10, 50, 10.2)), abs(rnorm(10, 70, 13.5))),
  iq = c(rnorm(10, 100, 15), rep(NA, 10)),
  participant_id = as.factor(rep(1:10, 2)))

The R packages I’m using require that the # of outcome observations be equal to the number of predictor / covariate observations to fit the linear model or else you get an error.
Wondering if anyone else has encountered a similar situation, and what you did to solve the issue?
Any help is great - thanks!

Assuming that your intervention is not intended to change IQ, then it might be a reasonable assumption that IQ is constant, so the IQ before can be used as the IQ after.
