Skip to content

Instantly share code, notes, and snippets.

@vasishth
Created March 15, 2013 19:50
Show Gist options
  • Save vasishth/5172613 to your computer and use it in GitHub Desktop.
Save vasishth/5172613 to your computer and use it in GitHub Desktop.
Calculating correlations of fixed effects in LMEs
> b1.vals<-subset(BHHshoes,material=="A")$wear
> b2.vals<-subset(BHHshoes,material=="B")$wear
>
> vcovmatrix<-var(cbind(b1.vals,b2.vals))
>
> covar<-vcovmatrix[1,2]
> sds<-sqrt(diag(vcovmatrix))
> covar/(sds[1]*sds[2])
b1.vals
0.98823
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment