title: How to Adjust for Cronbach's Alpha Measurement Error in lavaan in R
body: <p>Can anyone advise how best to account for measurement error (as measure by Cronbach's alpha) using the lavaan package in R? Below is a full example. The example attempts to predict the number of friends someone has based on their level of extraversion. Note my failed attempt to try to account for the measurement error of extraversion at the very end of the code.</p>
  <pre><code>#Setup dataset with 10000 observations (individuals).
  set.seed(1226)
  np &lt;- 10000
  df &lt;- data.frame(matrix(0,np,0))
  
  #Create 'true' extraversion with mean=5, SD=0.5.
  df$TruE &lt;- round(rnorm(np, 5, 0.5),0)
  
  #Create Friends variable, making it depend on Extraversion such that 
  #for every 1 unit increase in extraversion, the person has +3 friends.
  df$Frnd &lt;- 3*df$TruE+round(rnorm(np,5,5),0)
  
  #Create items that attempt to measure true extraversion (TruE).
  df$ext1 &lt;- df$TruE+round(rnorm(np,0,0.8),0)
  df$ext2 &lt;- df$TruE+round(rnorm(np,0,0.8),0)
  df$ext3 &lt;- df$TruE+round(rnorm(np,0,0.8),0)
  df$ext4 &lt;- df$TruE+round(rnorm(np,0,0.8),0)
  df$ext5 &lt;- df$TruE+round(rnorm(np,0,0.8),0)
  multi.hist(df[,c(&quot;ext1&quot;, &quot;ext2&quot;, &quot;ext3&quot;, &quot;ext4&quot;, &quot;ext5&quot;)])
  
  #Create latent variable that attempts to measure extraversion from the items.
  df$LatE &lt;- rowMeans(df[,c(&quot;ext1&quot;, &quot;ext2&quot;, &quot;ext3&quot;, &quot;ext4&quot;, &quot;ext5&quot;)])
  
  #Check correlation matrix.
  round(cor(df),2)
  
  #Check Cronbach alpha for latent variable.
  psych::alpha(df[,c(&quot;ext1&quot;, &quot;ext2&quot;, &quot;ext3&quot;, &quot;ext4&quot;, &quot;ext5&quot;)])
  
  #Recover the true model using standard regression (works as expected).
  summary(lm(Frnd~TruE, data=df))
  
  #Attempt to recover the true model based on the latent variable using standard regression.
  summary(lm(Frnd~LatE, data=df)) #Not correct due to poor reliability
  
  #Using lavaan with latent variable modelling (works very well).
  Mod1 &lt;- 'LatE2 =~ ext1 + ext2 + ext3 + ext4 + ext5
           
           Frnd ~ LatE2
          '
  Fit1 &lt;- lavaan::sem(Mod1, data=df)
  summary(Fit1, standardized=TRUE)
  
  #Attempt to adjust for Cronbach alpha (doesn't work).
  Mod2 &lt;- 'Frnd ~ (1-.69)*LatE
          '
  Fit2 &lt;- lavaan::sem(Mod2, data=df)
  summary(Fit2, standardized=TRUE)
  </code></pre>